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/breakpoint.c | |
parent | c72348e3b48cbb0843f6f91e3577dfc6e61eb3d3 (diff) | |
download | binutils-f5928702044db6274a7dd652de5c428b3e29948b.zip binutils-f5928702044db6274a7dd652de5c428b3e29948b.tar.gz binutils-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/breakpoint.c')
-rw-r--r-- | gdb/breakpoint.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index d844ef7..8d8e974 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -4226,33 +4226,21 @@ mark_breakpoints_out (program_space *pspace) bl->inserted = 0; } -/* Clear the "inserted" flag in all breakpoints and delete any - breakpoints which should go away between runs of the program. - - Plus other such housekeeping that has to be done for breakpoints - between runs. - - Note: this function gets called at the end of a run (by - generic_mourn_inferior) and when a run begins (by - init_wait_for_inferior). */ - - +/* See breakpoint.h. */ void -breakpoint_init_inferior (enum inf_context context) +breakpoint_init_inferior (inferior *inf, inf_context context) { - struct program_space *pspace = current_program_space; - /* If breakpoint locations are shared across processes, then there's nothing to do. */ - if (gdbarch_has_global_breakpoints (current_inferior ()->arch ())) + if (gdbarch_has_global_breakpoints (inf->arch ())) return; - mark_breakpoints_out (pspace); + mark_breakpoints_out (inf->pspace); for (breakpoint &b : all_breakpoints_safe ()) { - if (b.has_locations () && b.first_loc ().pspace != pspace) + if (b.has_locations () && b.first_loc ().pspace != inf->pspace) continue; switch (b.type) |