- string_holder = string_printf ("%s + %u", msym_name, offset);
- loc_string = string_holder.c_str ();
- }
- else
- loc_string = msym_name;
-
- gdb_assert (osect->objfile && objfile_name (osect->objfile));
- obj_name = objfile_name (osect->objfile);
-
- if (MULTI_OBJFILE_P ())
- if (pc_in_unmapped_range (addr, osect))
- if (section_is_overlay (osect))
- printf_filtered (_("%s in load address range of "
- "%s overlay section %s of %s\n"),
- loc_string, mapped, sec_name, obj_name);
- else
- printf_filtered (_("%s in load address range of "
- "section %s of %s\n"),
- loc_string, sec_name, obj_name);
- else
- if (section_is_overlay (osect))
- printf_filtered (_("%s in %s overlay section %s of %s\n"),
- loc_string, mapped, sec_name, obj_name);
- else
- printf_filtered (_("%s in section %s of %s\n"),
- loc_string, sec_name, obj_name);
- else
- if (pc_in_unmapped_range (addr, osect))
- if (section_is_overlay (osect))
- printf_filtered (_("%s in load address range of %s overlay "
- "section %s\n"),
- loc_string, mapped, sec_name);
+ const char *obj_name, *mapped, *sec_name, *msym_name;
+ const char *loc_string;
+
+ matches = 1;
+ offset = sect_addr - MSYMBOL_VALUE_ADDRESS (objfile, msymbol);
+ mapped = section_is_mapped (osect) ? _("mapped") : _("unmapped");
+ sec_name = osect->the_bfd_section->name;
+ msym_name = msymbol->print_name ();
+
+ /* Don't print the offset if it is zero.
+ We assume there's no need to handle i18n of "sym + offset". */
+ std::string string_holder;
+ if (offset)
+ {
+ string_holder = string_printf ("%s + %u", msym_name, offset);
+ loc_string = string_holder.c_str ();
+ }