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

Markus Metzger
2024-04-10T07:47:36Z

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(-)

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
--
2.34.1

Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva