return fold_storage.c_str ();
}
-/* The "encoded" form of DECODED, according to GNAT conventions. */
+/* The "encoded" form of DECODED, according to GNAT conventions. If
+ FOLD is true (the default), case-fold any ordinary symbol. Symbols
+ with <...> quoting are not folded in any case. */
std::string
-ada_encode (const char *decoded)
+ada_encode (const char *decoded, bool fold)
{
- if (decoded[0] != '<')
+ if (fold && decoded[0] != '<')
decoded = ada_fold_name (decoded);
return ada_encode_1 (decoded, true);
}
global symbols are searched. */
struct bound_minimal_symbol
-ada_lookup_simple_minsym (const char *name)
+ada_lookup_simple_minsym (const char *name, struct objfile *objfile)
{
struct bound_minimal_symbol result;
symbol_name_matcher_ftype *match_name
= ada_get_symbol_name_matcher (lookup_name);
- for (objfile *objfile : current_program_space->objfiles ())
- {
- for (minimal_symbol *msymbol : objfile->msymbols ())
- {
- if (match_name (msymbol->linkage_name (), lookup_name, NULL)
- && msymbol->type () != mst_solib_trampoline)
- {
- result.minsym = msymbol;
- result.objfile = objfile;
- break;
- }
- }
- }
+ gdbarch_iterate_over_objfiles_in_search_order
+ (objfile != NULL ? objfile->arch () : target_gdbarch (),
+ [&result, lookup_name, match_name] (struct objfile *obj)
+ {
+ for (minimal_symbol *msymbol : obj->msymbols ())
+ {
+ if (match_name (msymbol->linkage_name (), lookup_name, nullptr)
+ && msymbol->type () != mst_solib_trampoline)
+ {
+ result.minsym = msymbol;
+ result.objfile = obj;
+ return 1;
+ }
+ }
+
+ return 0;
+ }, objfile);
return result;
}
break;
default:
- internal_error (__FILE__, __LINE__, _("unexpected catchpoint type"));
+ internal_error (_("unexpected catchpoint type"));
break;
}
uiout->text (disposition == disp_del
? "\nTemporary catchpoint " : "\nCatchpoint ");
- uiout->field_signed ("bkptno", number);
+ print_num_locno (bs, uiout);
uiout->text (", ");
/* ada_exception_name_addr relies on the selected frame being the
break;
default:
- internal_error (__FILE__, __LINE__, _("unexpected catchpoint type"));
+ internal_error (_("unexpected catchpoint type"));
break;
}
break;
default:
- internal_error (__FILE__, __LINE__, _("unexpected catchpoint type"));
+ internal_error (_("unexpected catchpoint type"));
break;
}
}
break;
default:
- internal_error (__FILE__, __LINE__, _("unexpected catchpoint type"));
+ internal_error (_("unexpected catchpoint type"));
}
print_recreate_thread (fp);
}
return (data->exception_info->catch_handlers_sym);
break;
default:
- internal_error (__FILE__, __LINE__,
- _("unexpected catchpoint kind (%d)"), ex);
+ internal_error (_("unexpected catchpoint kind (%d)"), ex);
}
}
{
if (preg == NULL || preg->exec (name, 0, NULL, 0) == 0)
{
- struct bound_minimal_symbol msymbol
- = ada_lookup_simple_minsym (name);
+ symbol_name_match_type match_type = name_match_type_from_name (name);
+ lookup_name_info lookup_name (name, match_type);
- if (msymbol.minsym != NULL)
- {
- struct ada_exc_info info
- = {name, msymbol.value_address ()};
+ symbol_name_matcher_ftype *match_name
+ = ada_get_symbol_name_matcher (lookup_name);
- exceptions->push_back (info);
+ /* Iterate over all objfiles irrespective of scope or linker
+ namespaces so we get all exceptions anywhere in the
+ progspace. */
+ for (objfile *objfile : current_program_space->objfiles ())
+ {
+ for (minimal_symbol *msymbol : objfile->msymbols ())
+ {
+ if (match_name (msymbol->linkage_name (), lookup_name,
+ nullptr)
+ && msymbol->type () != mst_solib_trampoline)
+ {
+ ada_exc_info info
+ = {name, msymbol->value_address (objfile)};
+
+ exceptions->push_back (info);
+ }
+ }
}
}
}
SEARCH_GLOBAL_BLOCK | SEARCH_STATIC_BLOCK,
VARIABLES_DOMAIN);
+ /* Iterate over all objfiles irrespective of scope or linker namespaces
+ so we get all exceptions anywhere in the progspace. */
for (objfile *objfile : current_program_space->objfiles ())
{
for (compunit_symtab *s : objfile->compunits ())