From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id MJgsEDQKq18oGQAAWB0awg (envelope-from ) for ; Tue, 10 Nov 2020 16:46:28 -0500 Received: by simark.ca (Postfix, from userid 112) id 17D321E590; Tue, 10 Nov 2020 16:46:28 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 56C441F08D for ; Tue, 10 Nov 2020 16:46:23 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 59B0C3987034; Tue, 10 Nov 2020 21:46:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 59B0C3987034 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605044782; bh=G8aNIxgRh+AJEJW0AghkD9EsHXGtmbepQWqIDAkuN3A=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=YPw7QB7l0V0pNgoJTZNLcvpoqJZy5oxd6Af35z8WxBv5MJEqnqavx4BE5MjB6PxaN EVvR6YB/IyjQSjzgY0YjZBgeQGBSYjGsN1F20ZDH8jSUUfr/v/9I3+CWe4Kc0x3aD3 2O53jGTziqZ137PH5sxmffJO+Dj4HGXPIpX8SRK0= Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id 639133986834 for ; Tue, 10 Nov 2020 21:46:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 639133986834 X-ASG-Debug-ID: 1605044776-0c856e6cd571460001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id 60UWCL5rKLMK7PXO (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 10 Nov 2020 16:46:16 -0500 (EST) X-Barracuda-Envelope-From: simon.marchi@efficios.com X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from epycamd.internal.efficios.com (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) by smtp.ebox.ca (Postfix) with ESMTP id 77115441B21; Tue, 10 Nov 2020 16:46:16 -0500 (EST) X-Barracuda-RBL-IP: 192.222.181.218 X-Barracuda-Effective-Source-IP: 192-222-181-218.qc.cable.ebox.net[192.222.181.218] X-Barracuda-Apparent-Source-IP: 192.222.181.218 To: gdb-patches@sourceware.org Subject: [PATCH 05/12] gdb: rename displaced_step_fixup to displaced_step_finish Date: Tue, 10 Nov 2020 16:46:07 -0500 X-ASG-Orig-Subj: [PATCH 05/12] gdb: rename displaced_step_fixup to displaced_step_finish Message-Id: <20201110214614.2842615-6-simon.marchi@efficios.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201110214614.2842615-1-simon.marchi@efficios.com> References: <20201110214614.2842615-1-simon.marchi@efficios.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1605044776 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: 4459 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.85785 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 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: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Cc: Simon Marchi Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" 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 71e0ab1e4fb..cdf198bb307 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. */ @@ -1847,7 +1847,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) { struct displaced_step_inferior_state *displaced = get_displaced_stepping_state (event_thread->inf); @@ -2208,7 +2208,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 @@ -4822,7 +4822,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 @@ -4850,7 +4850,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; @@ -5318,7 +5318,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 (); @@ -5661,8 +5661,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.28.0