diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2024-02-07 11:53:20 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2024-02-09 11:09:55 -0500 |
commit | f5928702044db6274a7dd652de5c428b3e29948b (patch) | |
tree | d9dcee9a90e719976e46c90cd4242baf1edbb361 /gdb/infcmd.c | |
parent | c72348e3b48cbb0843f6f91e3577dfc6e61eb3d3 (diff) | |
download | gdb-f5928702044db6274a7dd652de5c428b3e29948b.zip gdb-f5928702044db6274a7dd652de5c428b3e29948b.tar.gz gdb-f5928702044db6274a7dd652de5c428b3e29948b.tar.bz2 |
gdb: add inferior parameter to breakpoint_init_inferior
By inspection, I believe that breakpoint_init_inferior doesn't call
anything that relies on the current program space or inferior. So,
add an inferior parameter, to make the current inferior / program space
references bubble up one level.
Change-Id: Ib07b7a6d360e324f6ae1aa502dd314b8cce421b7
Approved-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gdb/infcmd.c')
-rw-r--r-- | gdb/infcmd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 54063b3..4e17a6b 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -2824,14 +2824,14 @@ detach_command (const char *args, int from_tty) /* Hold a strong reference to the target while (maybe) detaching the parent. Otherwise detaching could close the target. */ - auto target_ref - = target_ops_ref::new_reference (current_inferior ()->process_target ()); + inferior *inf = current_inferior (); + auto target_ref = target_ops_ref::new_reference (inf->process_target ()); /* Save this before detaching, since detaching may unpush the process_stratum target. */ bool was_non_stop_p = target_is_non_stop_p (); - target_detach (current_inferior (), from_tty); + target_detach (inf, from_tty); update_previous_thread (); @@ -2840,11 +2840,11 @@ detach_command (const char *args, int from_tty) this within target_detach because that is also used when following child forks, and in that case we will want to transfer breakpoints to the child, not delete them. */ - breakpoint_init_inferior (inf_exited); + breakpoint_init_inferior (inf, inf_exited); /* If the solist is global across inferiors, don't clear it when we detach from a single inferior. */ - if (!gdbarch_has_global_solist (current_inferior ()->arch ())) + if (!gdbarch_has_global_solist (inf->arch ())) no_shared_libraries (nullptr, from_tty); if (deprecated_detach_hook) |