aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2021-02-04 13:35:09 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2021-02-04 13:35:09 -0500
commit85d3ad8e0b44832e7726d20eaf456051b5262b43 (patch)
tree85eaa26ec2c6bb430a82e4a4e3c98296246a935d
parentbaa8575b29fe83e158e203485d4d019621c0d245 (diff)
downloadgdb-85d3ad8e0b44832e7726d20eaf456051b5262b43.zip
gdb-85d3ad8e0b44832e7726d20eaf456051b5262b43.tar.gz
gdb-85d3ad8e0b44832e7726d20eaf456051b5262b43.tar.bz2
gdb: make record-btrace clear event handler in wait
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
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/record-btrace.c4
2 files changed, 10 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c8cae1c..0e617df 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
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
beginning, mark if needed at the end.
(remote_async_inferior_event_handler): Don't set or clear async
diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c
index ea339b8..ac51ff2 100644
--- a/gdb/record-btrace.c
+++ b/gdb/record-btrace.c
@@ -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);