aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-fork.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2024-07-16 23:52:02 -0400
committerSimon Marchi <simon.marchi@efficios.com>2024-08-12 10:31:09 -0400
commit4144d36a68bda0f20c02e6a4444052b44a462155 (patch)
tree35f30b63534a727ff1ce4cb2d7e3f406f0ced154 /gdb/linux-fork.c
parent8d2f4b7c3168f79fdef3e50163c91cca43da1381 (diff)
downloadgdb-4144d36a68bda0f20c02e6a4444052b44a462155.zip
gdb-4144d36a68bda0f20c02e6a4444052b44a462155.tar.gz
gdb-4144d36a68bda0f20c02e6a4444052b44a462155.tar.bz2
gdb: add program_space parameter to lookup_minimal_symbol
>From what I can see, lookup_minimal_symbol doesn't have any dependencies on the global current state other than the single reference to current_program_space. Add a program_space parameter and make that current_program_space reference bubble up one level. Change-Id: I759415e2f9c74c9627a2fe05bd44eb4147eee6fe Reviewed-by: Keith Seitz <keiths@redhat.com> Approved-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gdb/linux-fork.c')
-rw-r--r--gdb/linux-fork.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c
index d36511b..c457a90 100644
--- a/gdb/linux-fork.c
+++ b/gdb/linux-fork.c
@@ -484,9 +484,12 @@ inferior_call_waitpid (ptid_t pptid, int pid)
scoped_switch_fork_info switch_fork_info (pptid);
/* Get the waitpid_fn. */
- if (lookup_minimal_symbol ("waitpid").minsym != nullptr)
+ if (lookup_minimal_symbol (current_program_space, "waitpid").minsym
+ != nullptr)
waitpid_fn = find_function_in_inferior ("waitpid", &waitpid_objf);
- if (!waitpid_fn && lookup_minimal_symbol ("_waitpid").minsym != nullptr)
+ if (!waitpid_fn
+ && (lookup_minimal_symbol (current_program_space, "_waitpid").minsym
+ != nullptr))
waitpid_fn = find_function_in_inferior ("_waitpid", &waitpid_objf);
if (waitpid_fn != nullptr)
{
@@ -700,10 +703,11 @@ checkpoint_command (const char *args, int from_tty)
/* Make the inferior fork, record its (and gdb's) state. */
- if (lookup_minimal_symbol ("fork").minsym != nullptr)
+ if (lookup_minimal_symbol (current_program_space, "fork").minsym != nullptr)
fork_fn = find_function_in_inferior ("fork", &fork_objf);
if (!fork_fn)
- if (lookup_minimal_symbol ("_fork").minsym != nullptr)
+ if (lookup_minimal_symbol (current_program_space, "_fork").minsym
+ != nullptr)
fork_fn = find_function_in_inferior ("fork", &fork_objf);
if (!fork_fn)
error (_("checkpoint: can't find fork function in inferior."));