diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2024-07-16 23:52:00 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2024-08-12 10:31:09 -0400 |
commit | c8979ae4fbcc2b84b4192d0596597c3352fa430b (patch) | |
tree | f5a24bbbe6ab8b3aee270ce5bb586933371fae93 /gdb/linux-fork.c | |
parent | 03b40f6f55bed82bd16b2a1fd94fb8c8dbf797bf (diff) | |
download | binutils-c8979ae4fbcc2b84b4192d0596597c3352fa430b.zip binutils-c8979ae4fbcc2b84b4192d0596597c3352fa430b.tar.gz binutils-c8979ae4fbcc2b84b4192d0596597c3352fa430b.tar.bz2 |
gdb: make lookup_minimal_symbol objf and sfile parameters optional
Most calls to lookup_minimal_symbol don't pass a value for sfile and
objf. Make these parameters optional (have a default value of
nullptr). And since passing a value to `objf` is much more common than
passing a value to `sfile`, swap the order so `objf` comes first, to
avoid having to pass a nullptr value to `sfile` when wanting to pass a
value to `objf`.
Change-Id: I8e9cc6b942e593bec640f9dfd30f62786b0f5a27
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.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c index e34c5e0..d36511b 100644 --- a/gdb/linux-fork.c +++ b/gdb/linux-fork.c @@ -484,10 +484,9 @@ 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", NULL, NULL).minsym != NULL) + if (lookup_minimal_symbol ("waitpid").minsym != nullptr) waitpid_fn = find_function_in_inferior ("waitpid", &waitpid_objf); - if (!waitpid_fn - && lookup_minimal_symbol ("_waitpid", NULL, NULL).minsym != NULL) + if (!waitpid_fn && lookup_minimal_symbol ("_waitpid").minsym != nullptr) waitpid_fn = find_function_in_inferior ("_waitpid", &waitpid_objf); if (waitpid_fn != nullptr) { @@ -701,10 +700,10 @@ checkpoint_command (const char *args, int from_tty) /* Make the inferior fork, record its (and gdb's) state. */ - if (lookup_minimal_symbol ("fork", NULL, NULL).minsym != NULL) + if (lookup_minimal_symbol ("fork").minsym != nullptr) fork_fn = find_function_in_inferior ("fork", &fork_objf); if (!fork_fn) - if (lookup_minimal_symbol ("_fork", NULL, NULL).minsym != NULL) + if (lookup_minimal_symbol ("_fork").minsym != nullptr) fork_fn = find_function_in_inferior ("fork", &fork_objf); if (!fork_fn) error (_("checkpoint: can't find fork function in inferior.")); |