aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib-svr4.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2024-07-16 23:52:00 -0400
committerSimon Marchi <simon.marchi@efficios.com>2024-08-12 10:31:09 -0400
commitc8979ae4fbcc2b84b4192d0596597c3352fa430b (patch)
treef5a24bbbe6ab8b3aee270ce5bb586933371fae93 /gdb/solib-svr4.c
parent03b40f6f55bed82bd16b2a1fd94fb8c8dbf797bf (diff)
downloadgdb-c8979ae4fbcc2b84b4192d0596597c3352fa430b.zip
gdb-c8979ae4fbcc2b84b4192d0596597c3352fa430b.tar.gz
gdb-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/solib-svr4.c')
-rw-r--r--gdb/solib-svr4.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index 4633757..666e173 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -751,7 +751,7 @@ elf_locate_base (void)
/* This may be a static executable. Look for the symbol
conventionally named _r_debug, as a last resort. */
bound_minimal_symbol msymbol
- = lookup_minimal_symbol ("_r_debug", NULL,
+ = lookup_minimal_symbol ("_r_debug",
current_program_space->symfile_object_file);
if (msymbol.minsym != NULL)
return msymbol.value_address ();
@@ -2481,8 +2481,7 @@ enable_break (struct svr4_info *info, int from_tty)
objfile *objf = current_program_space->symfile_object_file;
for (bkpt_namep = solib_break_names; *bkpt_namep != NULL; bkpt_namep++)
{
- bound_minimal_symbol msymbol
- = lookup_minimal_symbol (*bkpt_namep, NULL, objf);
+ bound_minimal_symbol msymbol = lookup_minimal_symbol (*bkpt_namep, objf);
if ((msymbol.minsym != NULL)
&& (msymbol.value_address () != 0))
{
@@ -2502,7 +2501,7 @@ enable_break (struct svr4_info *info, int from_tty)
for (bkpt_namep = bkpt_names; *bkpt_namep != NULL; bkpt_namep++)
{
bound_minimal_symbol msymbol
- = lookup_minimal_symbol (*bkpt_namep, NULL, objf);
+ = lookup_minimal_symbol (*bkpt_namep, objf);
if ((msymbol.minsym != NULL)
&& (msymbol.value_address () != 0))
{