aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2024-02-07 11:53:21 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2024-02-09 11:09:55 -0500
commit85e8a786f485b1058854af3138f11e0d295ff060 (patch)
tree37a79eb59667a5f0ec5e9d57f0f5c3c533797715 /gdb
parentf5928702044db6274a7dd652de5c428b3e29948b (diff)
downloadgdb-85e8a786f485b1058854af3138f11e0d295ff060.zip
gdb-85e8a786f485b1058854af3138f11e0d295ff060.tar.gz
gdb-85e8a786f485b1058854af3138f11e0d295ff060.tar.bz2
gdb: add program_space parameter to disable_breakpoints_in_shlibs
Make the current_program_space reference bubble up one level. Change-Id: Ide917aa306bff1872d961244901d79f65d2da62e Approved-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gdb')
-rw-r--r--gdb/breakpoint.c7
-rw-r--r--gdb/breakpoint.h5
-rw-r--r--gdb/solib.c2
-rw-r--r--gdb/windows-nat.c2
4 files changed, 9 insertions, 7 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 8d8e974..5f05657 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -7972,11 +7972,10 @@ create_and_insert_solib_event_breakpoint (struct gdbarch *gdbarch, CORE_ADDR add
return b;
}
-/* Disable any breakpoints that are on code in shared libraries. Only
- apply to enabled breakpoints, disabled ones can just stay disabled. */
+/* See breakpoint.h. */
void
-disable_breakpoints_in_shlibs (void)
+disable_breakpoints_in_shlibs (program_space *pspace)
{
for (bp_location *loc : all_bp_locations ())
{
@@ -7992,7 +7991,7 @@ disable_breakpoints_in_shlibs (void)
|| (b->type == bp_jit_event)
|| (b->type == bp_hardware_breakpoint)
|| (is_tracepoint (b)))
- && loc->pspace == current_program_space
+ && loc->pspace == pspace
&& !loc->shlib_disabled
&& solib_name_from_address (loc->pspace, loc->address)
)
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index 8530a71..226e4d0 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -1802,7 +1802,10 @@ extern void remove_solib_event_breakpoints (void);
delete at next stop disposition. */
extern void remove_solib_event_breakpoints_at_next_stop (void);
-extern void disable_breakpoints_in_shlibs (void);
+/* Disable any breakpoints that are on code in shared libraries in PSPACE.
+ Only apply to enabled breakpoints, disabled ones can just stay disabled. */
+
+extern void disable_breakpoints_in_shlibs (program_space *pspace);
/* This function returns true if B is a catchpoint. */
diff --git a/gdb/solib.c b/gdb/solib.c
index 0a88843..98cda03 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -1187,7 +1187,7 @@ clear_solib (void)
{
const solib_ops *ops = gdbarch_so_ops (current_inferior ()->arch ());
- disable_breakpoints_in_shlibs ();
+ disable_breakpoints_in_shlibs (current_program_space);
current_program_space->so_list.clear_and_dispose ([] (solib *so) {
notify_solib_unloaded (current_program_space, *so);
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 48b0d10..7f3044f 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -1906,7 +1906,7 @@ windows_nat_target::do_initial_windows_stuff (DWORD pid, bool attaching)
inf = current_inferior ();
if (!inf->target_is_pushed (this))
inf->push_target (this);
- disable_breakpoints_in_shlibs ();
+ disable_breakpoints_in_shlibs (current_program_space);
windows_clear_solib ();
clear_proceed_status (0);
init_wait_for_inferior ();