From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id 078FD395C402 for ; Wed, 2 Dec 2020 15:48:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 078FD395C402 X-ASG-Debug-ID: 1606924087-0c856e67e21ece0001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id uKkDNGod0lKlyUDf (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 02 Dec 2020 10:48:07 -0500 (EST) X-Barracuda-Envelope-From: simon.marchi@polymtl.ca X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from simark.localdomain (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) by smtp.ebox.ca (Postfix) with ESMTP id 59580441D68; Wed, 2 Dec 2020 10:48:07 -0500 (EST) From: Simon Marchi X-Barracuda-RBL-IP: 173.246.6.90 X-Barracuda-Effective-Source-IP: 173-246-6-90.qc.cable.ebox.net[173.246.6.90] X-Barracuda-Apparent-Source-IP: 173.246.6.90 To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH v2 07/14] gdb: rename displaced_step_fixup to displaced_step_finish Date: Wed, 2 Dec 2020 10:47:58 -0500 X-ASG-Orig-Subj: [PATCH v2 07/14] gdb: rename displaced_step_fixup to displaced_step_finish Message-Id: <20201202154805.1484317-8-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201202154805.1484317-1-simon.marchi@polymtl.ca> References: <20201202154805.1484317-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1606924087 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 4496 X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.86262 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Spam-Status: No, score=-13.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_QUARANTINE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2020 15:48:11 -0000 From: Simon Marchi This is a preparatory patch to reduce a little bit the diff size of the main patch later in this series. It renames the displaced_step_fixup function in infrun.c to displaced_step_finish. The rationale is to better differentiate the low and high level operations. We first have the low level operation of writing an instruction to a displaced buffer, called "copy_insn". The mirror low level operation to fix up the state after having executed the instruction is "fixup". The high level operation of preparing a thread for a displaced step (which includes doing the "copy_insn" and some more bookkeeping) is called "prepare" (as in displaced_step_prepare). The mirror high level operation to cleaning up after a displaced step (which includes doing the "fixup" and some more bookkeeping) is currently also called "fixup" (as in displaced_step_fixup), just like the low level operation. I think that choosing a different name for the low and high level cleanup operation makes it clearer, hence "finish". gdb/ChangeLog: * infrun.c (displaced_step_fixup): Rename to... (displaced_step_finish): ... this, update all callers. Change-Id: Id32f48c1e2091d09854c77fcedcc14d2519957a2 --- gdb/infrun.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gdb/infrun.c b/gdb/infrun.c index 175d095154cc..1b747fedbbc5 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -1457,7 +1457,7 @@ step_over_info_valid_p (void) place it in the displaced_step_request_queue. Whenever a displaced step finishes, we pick the next thread in the queue and start a new displaced step operation on it. See displaced_step_prepare and - displaced_step_fixup for details. */ + displaced_step_finish for details. */ /* Default destructor for displaced_step_copy_insn_closure. */ @@ -1840,7 +1840,7 @@ displaced_step_restore (struct displaced_step_inferior_state *displaced, -1. If the thread wasn't displaced stepping, return 0. */ static int -displaced_step_fixup (thread_info *event_thread, enum gdb_signal signal) +displaced_step_finish (thread_info *event_thread, enum gdb_signal signal) { displaced_step_inferior_state *displaced = &event_thread->inf->displaced_step_state; @@ -2201,7 +2201,7 @@ do_target_resume (ptid_t resume_ptid, bool step, enum gdb_signal sig) Likewise if we're displaced stepping, otherwise a trap for a breakpoint in a signal handler might be confused with the - displaced step finishing. We don't make the displaced_step_fixup + displaced step finishing. We don't make the displaced_step_finish step distinguish the cases instead, because: - a backtrace while stopped in the signal handler would show the @@ -4815,7 +4815,7 @@ stop_all_threads (void) t->suspend.waitstatus.kind = TARGET_WAITKIND_IGNORE; t->suspend.waitstatus_pending_p = 0; - if (displaced_step_fixup (t, GDB_SIGNAL_0) < 0) + if (displaced_step_finish (t, GDB_SIGNAL_0) < 0) { /* Add it back to the step-over queue. */ infrun_debug_printf @@ -4843,7 +4843,7 @@ stop_all_threads (void) sig = (event.ws.kind == TARGET_WAITKIND_STOPPED ? event.ws.value.sig : GDB_SIGNAL_0); - if (displaced_step_fixup (t, sig) < 0) + if (displaced_step_finish (t, sig) < 0) { /* Add it back to the step-over queue. */ t->control.trap_expected = 0; @@ -5313,7 +5313,7 @@ handle_inferior_event (struct execution_control_state *ecs) has been done. Perform cleanup for parent process here. Note that this operation also cleans up the child process for vfork, because their pages are shared. */ - displaced_step_fixup (ecs->event_thread, GDB_SIGNAL_TRAP); + displaced_step_finish (ecs->event_thread, GDB_SIGNAL_TRAP); /* Start a new step-over in another thread if there's one that needs it. */ start_step_over (); @@ -5656,8 +5656,8 @@ resumed_thread_with_pending_status (struct thread_info *tp, static int finish_step_over (struct execution_control_state *ecs) { - displaced_step_fixup (ecs->event_thread, - ecs->event_thread->suspend.stop_signal); + displaced_step_finish (ecs->event_thread, + ecs->event_thread->suspend.stop_signal); bool had_step_over_info = step_over_info_valid_p (); -- 2.29.2