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 BEBAC3898001 for ; Mon, 30 Nov 2020 16:52:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BEBAC3898001 X-ASG-Debug-ID: 1606755172-0c856e6cd6295f50001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id vutdp4tE78VbJggy (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 30 Nov 2020 11:52:53 -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 E47AD441B21; Mon, 30 Nov 2020 11:52:52 -0500 (EST) From: Simon Marchi 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 Cc: Simon Marchi Subject: [PATCH 3/4] gdb: make record-btrace target clear its async event handler in wait Date: Mon, 30 Nov 2020 11:52:50 -0500 X-ASG-Orig-Subj: [PATCH 3/4] gdb: make record-btrace target clear its async event handler in wait Message-Id: <20201130165251.830482-4-simon.marchi@efficios.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201130165251.830482-1-simon.marchi@efficios.com> References: <20201130165251.830482-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: 1606755173 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: 1660 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.86230 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Spam-Status: No, score=-21.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, 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: Mon, 30 Nov 2020 16:52:54 -0000 For the same reason explained in the previous patch (which was for the remote target), move clearing of the async event handler of the record-btrace target to the wait method. The record-btrace target already re-sets its async event handler if needed in its wait method, so that part doesn't need to be changed: /* In async mode, we need to announce further events. */ if (target_is_async_p ()) record_btrace_maybe_mark_async_event (moving, no_history); gdb/ChangeLog: * record-btrace.c (record_btrace_handle_async_inferior_event): Don't clear async event handler. (record_btrace_target::wait): Clear async event handler at beginning. Change-Id: Ib32087a81bf94f1b884a938c8167ac8bbe09e362 --- gdb/record-btrace.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c index d5338c74aed..aca76dae0dd 100644 --- a/gdb/record-btrace.c +++ b/gdb/record-btrace.c @@ -326,7 +326,6 @@ record_btrace_auto_disable (void) static void record_btrace_handle_async_inferior_event (gdb_client_data data) { - clear_async_event_handler (record_btrace_async_inferior_event_handler); inferior_event_handler (INF_REG_EVENT); } @@ -2543,6 +2542,9 @@ record_btrace_target::wait (ptid_t ptid, struct target_waitstatus *status, std::vector moving; std::vector no_history; + /* Clear this, if needed we'll re-mark it below. */ + clear_async_event_handler (record_btrace_async_inferior_event_handler); + DEBUG ("wait %s (0x%x)", target_pid_to_str (ptid).c_str (), (unsigned) options); -- 2.29.2