[v5,3/4] gdb, infrun, record: move no-history notification into normal_stop

Message ID 20240410074613.54520-4-markus.t.metzger@intel.com
State New
Headers
Series PR gdb/31353 |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Testing passed

Commit Message

Metzger, Markus T April 10, 2024, 7:46 a.m. UTC
  Leave calling gdb::observers::no_history.notify to normal_stop based on
the last waitstatus.

Reviewed-By: Guinevere Larsen <blarsen@redhat.com>
---
 gdb/infrun.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Patch

diff --git a/gdb/infrun.c b/gdb/infrun.c
index cda9afc3dfb..d3738ebbd66 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -6573,8 +6573,6 @@  handle_inferior_event (struct execution_control_state *ecs)
       if (handle_stop_requested (ecs))
 	return;
 
-      interps_notify_no_history ();
-
       /* Cancel an in-flight step-over.  It will not succeed since we
 	 won't be able to step at the end of the execution history.  */
       {
@@ -9037,7 +9035,6 @@  keep_going_pass_signal (struct execution_control_state *ecs)
   if (ecs->event_thread->control.is_replaying
       && !target_record_is_replaying (ecs->event_thread->ptid))
     {
-      interps_notify_no_history ();
       ecs->ws.set_no_history ();
       set_last_target_status (ecs->target, ecs->ptid, ecs->ws);
       stop_print_frame = true;
@@ -9677,6 +9674,9 @@  normal_stop ()
   if (saved_context.changed ())
     return true;
 
+  if (last.kind () == TARGET_WAITKIND_NO_HISTORY)
+    interps_notify_no_history ();
+
   /* Notify observers about the stop.  This is where the interpreters
      print the stop event.  */
   notify_normal_stop ((inferior_ptid != null_ptid