This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] Reset a few infrun variables
- From: Daniel Jacobowitz <drow at false dot org>
- To: gdb-patches at sourceware dot org
- Date: Thu, 6 Dec 2007 19:52:56 -0500
- Subject: [commit] Reset a few infrun variables
This patch is mostly on principle; the stop_stack_dummy
change fixes confusion if you disconnect from a target while it's
stopped at a dummy frame and reconnect to it when it's stopped at a
shared library load event. I don't remember what motivated the
additional reset of target_last_wait_ptid but it's clearly right.
At init_wait_for_inferior the last target to stop is unrelated to the
next one.
Tested on x86_64-linux and committed.
--
Daniel Jacobowitz
CodeSourcery
2007-12-06 Daniel Jacobowitz <dan@codesourcery.com>
* infrun.c (init_wait_for_inferior): Reset target_last_wait_ptid.
(handle_inferior_event): Clear stop_stack_dummy earlier.
Index: src/gdb/infrun.c
===================================================================
--- src.orig/gdb/infrun.c 2007-12-06 14:26:01.000000000 -0500
+++ src/gdb/infrun.c 2007-12-06 14:26:07.000000000 -0500
@@ -888,6 +888,8 @@ init_wait_for_inferior (void)
stepping_past_singlestep_breakpoint = 0;
stepping_past_breakpoint = 0;
+
+ target_last_wait_ptid = minus_one_ptid;
}
/* This enum encodes possible reasons for doing a target_wait, so that
@@ -1249,6 +1251,9 @@ handle_inferior_event (struct execution_
target_last_wait_ptid = ecs->ptid;
target_last_waitstatus = *ecs->wp;
+ /* Always clear state belonging to the previous time we stopped. */
+ stop_stack_dummy = 0;
+
adjust_pc_after_break (ecs);
switch (ecs->infwait_state)
@@ -1866,7 +1871,6 @@ handle_inferior_event (struct execution_
ecs->another_trap = 0;
bpstat_clear (&stop_bpstat);
stop_step = 0;
- stop_stack_dummy = 0;
stop_print_frame = 1;
ecs->random_signal = 0;
stopped_by_random_signal = 0;