From patchwork Fri Oct 13 01:43:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 23524 Received: (qmail 68725 invoked by alias); 13 Oct 2017 01:43:38 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 68707 invoked by uid 89); 13 Oct 2017 01:43:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=8488, Hx-languages-length:6813 X-HELO: sessmg23.ericsson.net Received: from sessmg23.ericsson.net (HELO sessmg23.ericsson.net) (193.180.251.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 13 Oct 2017 01:43:33 +0000 Received: from ESESSHC014.ericsson.se (Unknown_Domain [153.88.183.60]) by sessmg23.ericsson.net (Symantec Mail Security) with SMTP id C1.B6.09869.24A10E95; Fri, 13 Oct 2017 03:43:30 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (153.88.183.145) by oa.msg.ericsson.com (153.88.183.60) with Microsoft SMTP Server (TLS) id 14.3.352.0; Fri, 13 Oct 2017 03:43:29 +0200 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=simon.marchi@ericsson.com; Received: from elxacz23q12.lan (192.222.251.162) by DB4PR07MB316.eurprd07.prod.outlook.com (2a01:111:e400:982f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.5; Fri, 13 Oct 2017 01:43:24 +0000 From: Simon Marchi To: CC: Simon Marchi Subject: [pushed] Remove simple_displaced_step_copy_insn Date: Thu, 12 Oct 2017 21:43:14 -0400 Message-ID: <1507858994-1314-1-git-send-email-simon.marchi@ericsson.com> MIME-Version: 1.0 X-ClientProxiedBy: BN6PR09CA0064.namprd09.prod.outlook.com (2603:10b6:404:7a::26) To DB4PR07MB316.eurprd07.prod.outlook.com (2a01:111:e400:982f::24) X-MS-Office365-Filtering-Correlation-Id: 3a835417-07cb-4abe-a4fe-08d511dbcb99 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DB4PR07MB316; X-Microsoft-Exchange-Diagnostics: 1; DB4PR07MB316; 3:YkOnG7Cm9YWUaMaDpOHlE2damSoqGc9AIR17ZorV7eZ93r/eE6IVf63/Co/ZgiN7oaJCdCYFub/0yzhgzRa88dP44Dx3q/1oC1smbweP7Gt1aoBGPHzcrPqFQrUOZQi1bnXkIHJ/cu0rhMo1doXYhgWbarEmXd54dqqg+RsRMt0i/wZWnZLeW+G9sX11MpNI2BtpwIBBJ0tu/Q661XCYpV5CiaI5ScQBVn/ZM55CsdH2EAvTXkghDKujl1Ft09ZI; 25:6v1AjFwrfpVZTmLLhG1uDPpJ8VD8LkczadkC2s9m7EhXc4iutqezmBR9/zaUxt8/ijttv+YLlEuJIq/HVUa59oNIlsBnoROmu8Lr5OoCiR2MgB9uPAevTqcLDl25ig27bJIJuO4XTTHfXJW0ZEi2HyVqBlyBO0+I1XQy1LMs0gxIEuQENXZMywjxSLhY7CNegoFwEHMgg/ZNev9pGDts5IPQnfaDnkCgPDkEpCz5zhqGwqDqZcX41QTqGrDFDgPGmq9km8BMUf3yEiZGIhyBpJbrALgbBHS6lN+DOIKVwvySv2FNKdsasoy5L5BvRyc0SlZ8zY1hyKRgzVH88hlLdiIG6ugXe6/A62aGun1vjHs=; 31:wgSmcCClT3H0TV/AGOYl+G5fAMjMo+0Du5i5zFfO8Hv4ZAw7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1gfCiJ4IrP1cxZMT6IM= X-Exchange-Antispam-Report-Test: UriScan:(37575265505322); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6041248)(20161123562025)(20161123560025)(20161123555025)(20161123558100)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB4PR07MB316; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB4PR07MB316; X-Forefront-PRVS: 04599F3534 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(39860400002)(376002)(189002)(377424004)(199003)(54534003)(86362001)(5660300001)(101416001)(16526018)(7736002)(8936002)(305945005)(8676002)(81156014)(33646002)(81166006)(2361001)(6916009)(47776003)(6666003)(105586002)(5003940100001)(66066001)(189998001)(6486002)(6506006)(21086003)(106356001)(4326008)(316002)(48376002)(107886003)(69596002)(4001150100001)(2351001)(50986999)(36756003)(25786009)(6512007)(478600001)(68736007)(2906002)(16586007)(50226002)(6116002)(97736004)(50466002)(3846002)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB4PR07MB316; H:elxacz23q12.lan; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB4PR07MB316; 23:WvPzQG2XKwgpntYy1PUp2hIqgjRxAHzzG64lg6wTv1?= =?us-ascii?Q?lXfrksEYKAyrU20y8QDvdZ8HB4ecklAYjJqYGPqgStWPmSfnAvzE6mf4M45K?= =?us-ascii?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ZR0GogZM3jVvTksRx3aaz9G2xxFJAwKr5EA98ncz1vjsSLuAydUVwK5dMKrwL4dw/eGS4xv0OHUQ6LXSi+mvc1s5jVmudXwZK6HPG+B0NKtQfjjENgzXnumjQgYwX09ZUSAlkbeEce1lExkBdFPlvh6FEs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2017 01:43:24.8834 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR07MB316 X-OriginatorOrg: ericsson.com X-IsSubscribed: yes Nothing uses this function. Remove it, and adjust comments referring to it. gdb/ChangeLog: * arch-utils.h (simple_displaced_step_copy_insn): Remove. * arch-utils.c (simple_displaced_step_copy_insn): Remove. * gdbarch.sh (displaced_step_copy_insn): Adjust comment. * gdbarch.h: Regenerate. * i386-linux-tdep.c (i386_linux_displaced_step_copy_insn): Adjust comment. * i386-tdep.c (i386_displaced_step_copy_insn): Adjust comment. (i386_displaced_step_fixup): Adjust comment. * rs6000-tdep.c (ppc_displaced_step_copy_insn): Adjust comment. --- gdb/ChangeLog | 12 ++++++++++++ gdb/arch-utils.c | 21 --------------------- gdb/arch-utils.h | 12 ------------ gdb/gdbarch.h | 4 ---- gdb/gdbarch.sh | 4 ---- gdb/i386-linux-tdep.c | 6 +++--- gdb/i386-tdep.c | 6 ++---- gdb/rs6000-tdep.c | 3 +-- 8 files changed, 18 insertions(+), 50 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 65a3265..032d8d3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,15 @@ +2017-10-12 Simon Marchi + + * arch-utils.h (simple_displaced_step_copy_insn): Remove. + * arch-utils.c (simple_displaced_step_copy_insn): Remove. + * gdbarch.sh (displaced_step_copy_insn): Adjust comment. + * gdbarch.h: Regenerate. + * i386-linux-tdep.c (i386_linux_displaced_step_copy_insn): + Adjust comment. + * i386-tdep.c (i386_displaced_step_copy_insn): Adjust comment. + (i386_displaced_step_fixup): Adjust comment. + * rs6000-tdep.c (ppc_displaced_step_copy_insn): Adjust comment. + 2017-10-12 Tom Tromey * prologue-value.h (pv_area::store_would_trash): Return bool. diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index 02ffd6b..6bdcc01 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -39,27 +39,6 @@ #include "dis-asm.h" -struct displaced_step_closure * -simple_displaced_step_copy_insn (struct gdbarch *gdbarch, - CORE_ADDR from, CORE_ADDR to, - struct regcache *regs) -{ - size_t len = gdbarch_max_insn_length (gdbarch); - gdb_byte *buf = (gdb_byte *) xmalloc (len); - - read_memory (from, buf, len); - write_memory (to, buf, len); - - if (debug_displaced) - { - fprintf_unfiltered (gdb_stdlog, "displaced: copy %s->%s: ", - paddress (gdbarch, from), paddress (gdbarch, to)); - displaced_step_dump_bytes (gdb_stdlog, buf, len); - } - - return (struct displaced_step_closure *) buf; -} - int default_displaced_step_hw_singlestep (struct gdbarch *gdbarch, struct displaced_step_closure *closure) diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h index fa29086..6d3c362 100644 --- a/gdb/arch-utils.h +++ b/gdb/arch-utils.h @@ -73,18 +73,6 @@ struct bp_manipulation_endian bp_manipulation_endian -/* An implementation of gdbarch_displaced_step_copy_insn for - processors that don't need to modify the instruction before - single-stepping the displaced copy. - - Simply copy gdbarch_max_insn_length (ARCH) bytes from FROM to TO. - The closure is an array of that many bytes containing the - instruction's bytes, allocated with xmalloc. */ -extern struct displaced_step_closure * - simple_displaced_step_copy_insn (struct gdbarch *gdbarch, - CORE_ADDR from, CORE_ADDR to, - struct regcache *regs); - /* Default implementation of gdbarch_displaced_hw_singlestep. */ extern int default_displaced_step_hw_singlestep (struct gdbarch *, diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index f276d09..d2e6b6f 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -984,10 +984,6 @@ extern void set_gdbarch_max_insn_length (struct gdbarch *gdbarch, ULONGEST max_i If you do not provide this function, GDB assumes that the architecture does not support displaced stepping. - If your architecture doesn't need to adjust instructions before - single-stepping them, consider using simple_displaced_step_copy_insn - here. - If the instruction cannot execute out of line, return NULL. The core falls back to stepping past the instruction in-line instead in that case. */ diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index ea15c8c..6459b12 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -793,10 +793,6 @@ V;ULONGEST;max_insn_length;;;0;0 # If you do not provide this function, GDB assumes that the # architecture does not support displaced stepping. # -# If your architecture doesn't need to adjust instructions before -# single-stepping them, consider using simple_displaced_step_copy_insn -# here. -# # If the instruction cannot execute out of line, return NULL. The # core falls back to stepping past the instruction in-line instead in # that case. diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c index 87a9598..8cec675 100644 --- a/gdb/i386-linux-tdep.c +++ b/gdb/i386-linux-tdep.c @@ -803,13 +803,13 @@ i386_linux_displaced_step_copy_insn (struct gdbarch *gdbarch, struct regcache *regs) { struct displaced_step_closure *closure; - + closure = i386_displaced_step_copy_insn (gdbarch, from, to, regs); if (i386_linux_get_syscall_number_from_regcache (regs) != -1) { - /* Since we use simple_displaced_step_copy_insn, our closure is a - copy of the instruction. */ + /* The closure returned by i386_displaced_step_copy_insn is simply a + buffer with a copy of the instruction. */ gdb_byte *insn = (gdb_byte *) closure; /* Fake nop. */ diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 9eb1192..46e5e32 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -794,8 +794,7 @@ i386_insn_is_jump (struct gdbarch *gdbarch, CORE_ADDR addr) return i386_jmp_p (insn); } -/* Some kernels may run one past a syscall insn, so we have to cope. - Otherwise this is just simple_displaced_step_copy_insn. */ +/* Some kernels may run one past a syscall insn, so we have to cope. */ struct displaced_step_closure * i386_displaced_step_copy_insn (struct gdbarch *gdbarch, @@ -848,8 +847,7 @@ i386_displaced_step_fixup (struct gdbarch *gdbarch, applying it. */ ULONGEST insn_offset = to - from; - /* Since we use simple_displaced_step_copy_insn, our closure is a - copy of the instruction. */ + /* Our closure is a copy of the instruction. */ gdb_byte *insn = (gdb_byte *) closure; /* The start of the insn, needed in case we see some prefixes. */ gdb_byte *insn_start = insn; diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 92395ad..df1a84d 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -1014,8 +1014,7 @@ typedef BP_MANIPULATION_ENDIAN (little_breakpoint, big_breakpoint) || (insn & STORE_CONDITIONAL_MASK) == STHCX_INSTRUCTION \ || (insn & STORE_CONDITIONAL_MASK) == STQCX_INSTRUCTION) -/* We can't displaced step atomic sequences. Otherwise this is just - like simple_displaced_step_copy_insn. */ +/* We can't displaced step atomic sequences. */ static struct displaced_step_closure * ppc_displaced_step_copy_insn (struct gdbarch *gdbarch,