This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFC/WIP PATCH 12/14] Fix deref of stale pointer
ecs->event_thread was being referenced somewhere after
target_mourn_inferior. I don't recall where now though... :-P In any
case, I'm not sure this is the right fix, so I'll need to revert and
revisit. Meanwhile, this is necessary to get things working.
---
gdb/infrun.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 6b16184..44fa074 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -4011,6 +4011,7 @@ handle_inferior_event (struct execution_control_state *ecs)
current_inferior ()->exit_code = (LONGEST) ecs->ws.value.integer;
gdb_flush (gdb_stdout);
+ ecs->event_thread = NULL;
target_mourn_inferior ();
singlestep_breakpoints_inserted_p = 0;
cancel_single_step_breakpoints ();
@@ -4033,6 +4034,7 @@ handle_inferior_event (struct execution_control_state *ecs)
target_kill() was called here, which hints that fatal signals aren't
really fatal on some systems. If that's true, then some changes
may be needed. */
+ ecs->event_thread = NULL;
target_mourn_inferior ();
print_signal_exited_reason (ecs->ws.value.sig);