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.
This commit is contained in:
Andrew Burgess 2021-02-05 22:01:48 +00:00
parent 52ff20fe7b
commit ebbc3a7d56
12 changed files with 73 additions and 43 deletions

View file

@ -1534,7 +1534,7 @@ info_address_command (const char *exp, int from_tty)
fputs_styled (paddress (gdbarch, load_addr), address_style.style (),
gdb_stdout);
printf_filtered (" in a file compiled without debugging");
section = MSYMBOL_OBJ_SECTION (objfile, msymbol.minsym);
section = msymbol.minsym->obj_section (objfile);
if (section_is_overlay (section))
{
load_addr = overlay_unmapped_address (load_addr, section);
@ -1558,7 +1558,7 @@ info_address_command (const char *exp, int from_tty)
printf_filtered ("\" is ");
val = SYMBOL_VALUE (sym);
if (SYMBOL_OBJFILE_OWNED (sym))
section = SYMBOL_OBJ_SECTION (symbol_objfile (sym), sym);
section = sym->obj_section (symbol_objfile (sym));
else
section = NULL;
gdbarch = symbol_arch (sym);
@ -1678,7 +1678,7 @@ info_address_command (const char *exp, int from_tty)
printf_filtered ("unresolved");
else
{
section = MSYMBOL_OBJ_SECTION (msym.objfile, msym.minsym);
section = msym.minsym->obj_section (msym.objfile);
if (section
&& (section->the_bfd_section->flags & SEC_THREAD_LOCAL) != 0)