mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-12-19 01:19:41 +08:00
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:
committed by
Simon Marchi
parent
03b40f6f55
commit
c8979ae4fb
@@ -120,9 +120,9 @@ lookup_objc_class (struct gdbarch *gdbarch, const char *classname)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (lookup_minimal_symbol("objc_lookUpClass", 0, 0).minsym)
|
||||
if (lookup_minimal_symbol ("objc_lookUpClass").minsym != nullptr)
|
||||
function = find_function_in_inferior("objc_lookUpClass", NULL);
|
||||
else if (lookup_minimal_symbol ("objc_lookup_class", 0, 0).minsym)
|
||||
else if (lookup_minimal_symbol ("objc_lookup_class").minsym != nullptr)
|
||||
function = find_function_in_inferior("objc_lookup_class", NULL);
|
||||
else
|
||||
{
|
||||
@@ -149,9 +149,9 @@ lookup_child_selector (struct gdbarch *gdbarch, const char *selname)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (lookup_minimal_symbol("sel_getUid", 0, 0).minsym)
|
||||
if (lookup_minimal_symbol ("sel_getUid").minsym != nullptr)
|
||||
function = find_function_in_inferior("sel_getUid", NULL);
|
||||
else if (lookup_minimal_symbol ("sel_get_any_uid", 0, 0).minsym)
|
||||
else if (lookup_minimal_symbol ("sel_get_any_uid").minsym != nullptr)
|
||||
function = find_function_in_inferior("sel_get_any_uid", NULL);
|
||||
else
|
||||
{
|
||||
@@ -180,17 +180,18 @@ value_nsstring (struct gdbarch *gdbarch, const char *ptr, int len)
|
||||
stringValue[2] = value_string(ptr, len, char_type);
|
||||
stringValue[2] = value_coerce_array(stringValue[2]);
|
||||
/* _NSNewStringFromCString replaces "istr" after Lantern2A. */
|
||||
if (lookup_minimal_symbol("_NSNewStringFromCString", 0, 0).minsym)
|
||||
if (lookup_minimal_symbol ("_NSNewStringFromCString").minsym != nullptr)
|
||||
{
|
||||
function = find_function_in_inferior("_NSNewStringFromCString", NULL);
|
||||
nsstringValue = call_function_by_hand(function, NULL, stringValue[2]);
|
||||
}
|
||||
else if (lookup_minimal_symbol("istr", 0, 0).minsym)
|
||||
else if (lookup_minimal_symbol ("istr").minsym != nullptr)
|
||||
{
|
||||
function = find_function_in_inferior("istr", NULL);
|
||||
nsstringValue = call_function_by_hand(function, NULL, stringValue[2]);
|
||||
}
|
||||
else if (lookup_minimal_symbol("+[NSString stringWithCString:]", 0, 0).minsym)
|
||||
else if (lookup_minimal_symbol ("+[NSString stringWithCString:]").minsym
|
||||
!= nullptr)
|
||||
{
|
||||
function
|
||||
= find_function_in_inferior("+[NSString stringWithCString:]", NULL);
|
||||
@@ -1137,7 +1138,7 @@ find_imps (const char *method, std::vector<const char *> *symbol_names)
|
||||
symbol_names->push_back (sym->natural_name ());
|
||||
else
|
||||
{
|
||||
bound_minimal_symbol msym = lookup_minimal_symbol (selector, 0, 0);
|
||||
bound_minimal_symbol msym = lookup_minimal_symbol (selector);
|
||||
|
||||
if (msym.minsym != NULL)
|
||||
symbol_names->push_back (msym.minsym->natural_name ());
|
||||
|
||||
Reference in New Issue
Block a user