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>
This commit is contained in:
Simon Marchi
2024-07-16 23:52:00 -04:00
committed by Simon Marchi
parent 03b40f6f55
commit c8979ae4fb
57 changed files with 104 additions and 133 deletions

View File

@@ -449,8 +449,7 @@ language_defn::read_var_value (struct symbol *var,
(var->arch (),
[var, &bmsym] (objfile *objfile)
{
bmsym = lookup_minimal_symbol (var->linkage_name (), nullptr,
objfile);
bmsym = lookup_minimal_symbol (var->linkage_name (), objfile);
/* Stop if a match is found. */
return bmsym.minsym != nullptr;