gdb: add obj_section function to bound_minimal_symbol

Add a new obj_section function to bound_minimal_symbol, this just
calls obj_section on the contained minimal_symbol passing in the
contained objfile.

This allows some minor code simplification in a few places.

There should be no user visible changes after this commit.

gdb/ChangeLog:

	* breakpoint.c (resolve_sal_pc): Make use of
	bound_minimal_symbol::obj_section.
	* maint.c (maintenance_translate_address): Likewise.
	* minsyms.c (minimal_symbol_upper_bound): Likewise.
	* minsyms.h (struct bound_minimal_symbol) <obj_section>: New
	member function.
	* printcmd.c (info_address_command): Make use of
	bound_minimal_symbol::obj_section.
This commit is contained in:
Andrew Burgess 2021-02-10 15:07:04 +00:00
parent 31c711a2b3
commit 1db66e348a
6 changed files with 22 additions and 4 deletions

View file

@ -1678,7 +1678,7 @@ info_address_command (const char *exp, int from_tty)
printf_filtered ("unresolved");
else
{
section = msym.minsym->obj_section (msym.objfile);
section = msym.obj_section ();
if (section
&& (section->the_bfd_section->flags & SEC_THREAD_LOCAL) != 0)