Message ID | alpine.LFD.2.21.1910182100030.2438@redsun52.ssa.fujisawa.hgst.com |
---|---|
State | Superseded |
Headers | show |
On Sat, 19 Oct 2019, Maciej W. Rozycki wrote: > Fix an issue with the `step_over_info' structure introduced with commit > 31e77af205cf ("PR breakpoints/7143 - Watchpoint does not trigger when > first set"), where information stored in there is not invalidated in a > remote debug scenario where software stepping in the all-stop mode is > forcibly interrupted and the target connection then closed. As a result > a subsequent target connection triggers an assertion failure on > `ecs->event_thread->control.trap_expected' and cannot be successfully > established, making the particular instance of GDB unusable. Ping for: <https://sourceware.org/ml/gdb-patches/2019-10/msg00659.html> Maciej
On 10/19/19 8:10 PM, Maciej W. Rozycki wrote: > Correct the issue by making a call to clear global breakpoint step-over > information from `exit_inferior_1', which is where we already do all > kinds of similar clean-ups, e.g. `delete_thread' called from there > clears per-thread step-over information. > This looks like a fragile place to clear this, considering multiprocess. I.e., what if we're calling exit_inferior for some inferior other than the one that was stepping. The step over information is associated with a thread. I think it'd be better to clear the step over information when the corresponding thread is deleted. So something like adding a thread_info parameter to clear_step_over_info, and then calling clear_step_over_info from clear_thread_inferior_resources. clear_step_over_info would only clear the info if the thread matched, or if NULL is passed. Would that work? Thanks, Pedro Alves
Index: binutils-gdb/gdb/inferior.c =================================================================== --- binutils-gdb.orig/gdb/inferior.c +++ binutils-gdb/gdb/inferior.c @@ -209,6 +209,9 @@ exit_inferior_1 (struct inferior *inftoe /* Reset it. */ inf->control = inferior_control_state (NO_STOP_QUIETLY); + /* Remove any stale breakpoint step-over information. */ + clear_step_over_info (); + /* Clear the register cache and the frame cache. */ registers_changed (); reinit_frame_cache (); Index: binutils-gdb/gdb/infrun.c =================================================================== --- binutils-gdb.orig/gdb/infrun.c +++ binutils-gdb/gdb/infrun.c @@ -1330,10 +1330,9 @@ set_step_over_info (const address_space step_over_info.thread = thread; } -/* Called when we're not longer stepping over a breakpoint / an - instruction, so all breakpoints are free to be (re)inserted. */ +/* See infrun.h. */ -static void +void clear_step_over_info (void) { if (debug_infrun) Index: binutils-gdb/gdb/infrun.h =================================================================== --- binutils-gdb.orig/gdb/infrun.h +++ binutils-gdb/gdb/infrun.h @@ -120,6 +120,10 @@ extern void insert_step_resume_breakpoin struct symtab_and_line , struct frame_id); +/* Called when we're not longer stepping over a breakpoint / an + instruction, so all breakpoints are free to be (re)inserted. */ +void clear_step_over_info (void); + /* Returns true if we're trying to step past the instruction at ADDRESS in ASPACE. */ extern int stepping_past_instruction_at (struct address_space *aspace,