gdb: make record-btrace clear event handler in wait
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 4 Feb 2021 18:35:09 +0000 (13:35 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Thu, 4 Feb 2021 18:35:09 +0000 (13:35 -0500)
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 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/ChangeLog
gdb/record-btrace.c

index c8cae1c77da57d452d86dbbf2f3b16eba1e1082d..0e617df13b2deca4f0f6bb70beed797b7ff476cc 100644 (file)
@@ -1,3 +1,10 @@
+2021-02-04  Simon Marchi  <simon.marchi@efficios.com>
+
+       * 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.
+
 2021-02-04  Simon Marchi  <simon.marchi@efficios.com>
 
        * remote.c (remote_target::wait): Clear async event handler at
index ea339b865b35f41da68fc1206fdd7003d308c3c7..ac51ff2bf49b7f7e138890b2ee98995afe1dcbd4 100644 (file)
@@ -325,7 +325,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);
 }
 
@@ -2532,6 +2531,9 @@ record_btrace_target::wait (ptid_t ptid, struct target_waitstatus *status,
   std::vector<thread_info *> moving;
   std::vector<thread_info *> 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);
 
This page took 0.03423 seconds and 4 git commands to generate.