[binutils-gdb] gdb: make record-full clear async handler in wait

Simon Marchi simark@sourceware.org
Thu Feb 4 18:40:00 GMT 2021


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=fdbc5215e756e75cdda894b4d84150de35438061

commit fdbc5215e756e75cdda894b4d84150de35438061
Author: Simon Marchi <simon.marchi@efficios.com>
Date:   Thu Feb 4 13:35:37 2021 -0500

    gdb: make record-full clear async handler in wait
    
    For the same reason explained in the previous patch (which was for the
    record-btrace target), move clearing of the async event handler of the
    record-full target to the wait method.
    
    I'm not sure if/where that target needs to re-set its async event
    handler in the wait method.  Since it only supports a single thread,
    there probably can't be multiple events to report at the same time.
    
    gdb/ChangeLog:
    
            * record-full.c (record_full_async_inferior_event_handler):
            Don't clear async event handler.
            (record_full_base_target::wait): Clear async event handler at
            beginning.
    
    Change-Id: I146fbdb53d99e3a32766ac7cd337ac5ed7fd9adf

Diff:
---
 gdb/ChangeLog     | 7 +++++++
 gdb/record-full.c | 3 ++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0e617df13b2..c73a8cd9df3 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2021-02-04  Simon Marchi  <simon.marchi@efficios.com>
+
+	* record-full.c (record_full_async_inferior_event_handler):
+	Don't clear async event handler.
+	(record_full_base_target::wait): Clear async event handler at
+	beginning.
+
 2021-02-04  Simon Marchi  <simon.marchi@efficios.com>
 
 	* record-btrace.c (record_btrace_handle_async_inferior_event):
diff --git a/gdb/record-full.c b/gdb/record-full.c
index 247573cc5c6..2373741470c 100644
--- a/gdb/record-full.c
+++ b/gdb/record-full.c
@@ -903,7 +903,6 @@ static struct async_event_handler *record_full_async_inferior_event_token;
 static void
 record_full_async_inferior_event_handler (gdb_client_data data)
 {
-  clear_async_event_handler (record_full_async_inferior_event_token);
   inferior_event_handler (INF_REG_EVENT);
 }
 
@@ -1454,6 +1453,8 @@ record_full_base_target::wait (ptid_t ptid, struct target_waitstatus *status,
 {
   ptid_t return_ptid;
 
+  clear_async_event_handler (record_full_async_inferior_event_token);
+
   return_ptid = record_full_wait_1 (this, ptid, status, options);
   if (status->kind != TARGET_WAITKIND_IGNORE)
     {


More information about the Gdb-cvs mailing list