mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 09:58:19 +08:00
gdb, cp: update add_symbol_overload_list_qualified
Iterate over objfiles in search order using the objfile of the selected block as current_objfile so the iteration can stay inside the block's linker namespace.
This commit is contained in:
@ -1460,30 +1460,30 @@ add_symbol_overload_list_qualified (const char *func_name,
|
|||||||
/* Go through the symtabs and check the externs and statics for
|
/* Go through the symtabs and check the externs and statics for
|
||||||
symbols which match. */
|
symbols which match. */
|
||||||
|
|
||||||
for (objfile *objfile : current_program_space->objfiles ())
|
const block *block = get_selected_block (0);
|
||||||
{
|
struct objfile *current_objfile = block ? block_objfile (block) : nullptr;
|
||||||
for (compunit_symtab *cust : objfile->compunits ())
|
|
||||||
{
|
|
||||||
QUIT;
|
|
||||||
const block *b = cust->blockvector ()->global_block ();
|
|
||||||
add_symbol_overload_list_block (func_name, b, overload_list);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (objfile *objfile : current_program_space->objfiles ())
|
gdbarch_iterate_over_objfiles_in_search_order
|
||||||
{
|
(current_objfile ? current_objfile->arch () : target_gdbarch (),
|
||||||
for (compunit_symtab *cust : objfile->compunits ())
|
[func_name, surrounding_static_block, &overload_list]
|
||||||
{
|
(struct objfile *obj)
|
||||||
QUIT;
|
{
|
||||||
const block *b = cust->blockvector ()->static_block ();
|
for (compunit_symtab *cust : obj->compunits ())
|
||||||
|
{
|
||||||
|
QUIT;
|
||||||
|
const struct block *b = cust->blockvector ()->global_block ();
|
||||||
|
add_symbol_overload_list_block (func_name, b, overload_list);
|
||||||
|
|
||||||
/* Don't do this block twice. */
|
b = cust->blockvector ()->static_block ();
|
||||||
if (b == surrounding_static_block)
|
/* Don't do this block twice. */
|
||||||
continue;
|
if (b == surrounding_static_block)
|
||||||
|
continue;
|
||||||
|
|
||||||
add_symbol_overload_list_block (func_name, b, overload_list);
|
add_symbol_overload_list_block (func_name, b, overload_list);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
return 0;
|
||||||
|
}, current_objfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Lookup the rtti type for a class name. */
|
/* Lookup the rtti type for a class name. */
|
||||||
|
Reference in New Issue
Block a user