aboutsummaryrefslogtreecommitdiff
path: root/gdb/findvar.c
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2021-02-05 22:01:48 +0000
committerAndrew Burgess <andrew.burgess@embecosm.com>2021-02-10 14:38:08 +0000
commitebbc3a7d56f82f68bbeece3d7daf1823c9d98170 (patch)
tree07d4658bb23d7c55f074c9a2cf7fb0141f389948 /gdb/findvar.c
parent52ff20fe7ba8e8de2660339fff5308ed932e2b32 (diff)
downloadgdb-ebbc3a7d56f82f68bbeece3d7daf1823c9d98170.zip
gdb-ebbc3a7d56f82f68bbeece3d7daf1823c9d98170.tar.gz
gdb-ebbc3a7d56f82f68bbeece3d7daf1823c9d98170.tar.bz2
gdb: Delete SYMBOL_OBJ_SECTION and MSYMBOL_OBJ_SECTION
Replace the two macros SYMBOL_OBJ_SECTION and MSYMBOL_OBJ_SECTION with a member function on general_symbol_info. There should be no user visible change after this commit. gdb/ChangeLog: * breakpoint.c (resolve_sal_pc): Replace SYMBOL_OBJ_SECTION and MSYMBOL_OBJ_SECTION. * findvar.c (language_defn::read_var_value): Likewise. * infcmd.c (jump_command): Likewise. * linespec.c (minsym_found): Likewise. * maint.c (maintenance_translate_address): Likewise. * minsyms.c (lookup_minimal_symbol_by_pc_section): Likewise. (minimal_symbol_upper_bound): Likewise. * parse.c (find_minsym_type_and_address): Likewise. (operator_check_standard): Likewise. * printcmd.c (info_address_command): Likewise. * symmisc.c (dump_msymbols): Likewise. (print_symbol): Likewise. * symtab.c (general_symbol_info::obj_section): Define new function. (fixup_symbol_section): Replace SYMBOL_OBJ_SECTION. (find_pc_sect_compunit_symtab): Likewise. (find_function_start_sal): Likewise. (skip_prologue_sal): Replace SYMBOL_OBJ_SECTION and MSYMBOL_OBJ_SECTION. * symtab.h (struct general_symbol_info) <obj_section>: Declare new function. (SYMBOL_OBJ_SECTION): Delete. (MSYMBOL_OBJ_SECTION): Delete.
Diffstat (limited to 'gdb/findvar.c')
-rw-r--r--gdb/findvar.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/gdb/findvar.c b/gdb/findvar.c
index 6abcd3a..fcd9719 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -638,11 +638,9 @@ language_defn::read_var_value (struct symbol *var,
v = allocate_value (type);
if (overlay_debugging)
{
- addr
- = symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var),
- SYMBOL_OBJ_SECTION (symbol_objfile (var),
- var));
-
+ struct objfile *var_objfile = symbol_objfile (var);
+ addr = symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var),
+ var->obj_section (var_objfile));
store_typed_address (value_contents_raw (v), type, addr);
}
else
@@ -665,9 +663,9 @@ language_defn::read_var_value (struct symbol *var,
case LOC_STATIC:
if (overlay_debugging)
- addr = symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var),
- SYMBOL_OBJ_SECTION (symbol_objfile (var),
- var));
+ addr
+ = symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var),
+ var->obj_section (symbol_objfile (var)));
else
addr = SYMBOL_VALUE_ADDRESS (var);
break;
@@ -709,7 +707,7 @@ language_defn::read_var_value (struct symbol *var,
if (overlay_debugging)
addr = symbol_overlayed_address
(BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (var)),
- SYMBOL_OBJ_SECTION (symbol_objfile (var), var));
+ var->obj_section (symbol_objfile (var)));
else
addr = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (var));
break;
@@ -777,7 +775,7 @@ language_defn::read_var_value (struct symbol *var,
error (_("Missing %s symbol \"%s\"."),
flavour_name, var->linkage_name ());
}
- obj_section = MSYMBOL_OBJ_SECTION (lookup_data.result.objfile, msym);
+ obj_section = msym->obj_section (lookup_data.result.objfile);
/* Relocate address, unless there is no section or the variable is
a TLS variable. */
if (obj_section == NULL