diff options
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r-- | gdb/infrun.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c index 473a0fb..0e0a7a6 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -1528,6 +1528,21 @@ infrun_inferior_exit (struct inferior *inf) inf->displaced_step_state.reset (); } +static void +infrun_inferior_execd (inferior *inf) +{ + /* If a thread was doing a displaced step in this inferior at the moment of + the exec, it no longer exists. Even if the exec'ing thread was the one + doing a displaced step, we don't want to to any fixup nor restore displaced + stepping buffer bytes. */ + inf->displaced_step_state.reset (); + + /* Since an in-line step is done with everything else stopped, if there was + one in progress at the time of the exec, it must have been the exec'ing + thread. */ + clear_step_over_info (); +} + /* If ON, and the architecture supports it, GDB will use displaced stepping to step over breakpoints. If OFF, or if the architecture doesn't support it, GDB will instead use the traditional @@ -9509,6 +9524,7 @@ enabled by default on some platforms."), gdb::observers::thread_stop_requested.attach (infrun_thread_stop_requested); gdb::observers::thread_exit.attach (infrun_thread_thread_exit); gdb::observers::inferior_exit.attach (infrun_inferior_exit); + gdb::observers::inferior_execd.attach (infrun_inferior_execd); /* Explicitly create without lookup, since that tries to create a value with a void typed value, and when we get here, gdbarch |