+2019-12-12 Tom Tromey <tom@tromey.com>
+
+ * progspace.c (program_space::multi_objfile_p): New method.
+ * printcmd.c (info_symbol_command): Update.
+ * maint.c (maintenance_translate_address): Update.
+ * objfiles.h (MULTI_OBJFILE_P): Remove.
+ * progspace.h (struct program_space) <multi_objfile_p>: New
+ method.
+
2019-12-12 Tom Tromey <tom@tromey.com>
* progspace.h (struct program_space) <remove_objfile>: Declare.
gdb_assert (sect->objfile && objfile_name (sect->objfile));
obj_name = objfile_name (sect->objfile);
- if (MULTI_OBJFILE_P ())
+ if (current_program_space->multi_objfile_p ())
printf_filtered (_("%s + %s in section %s of %s\n"),
symbol_name, symbol_offset,
section_name, obj_name);
uninitialized section index. */
#define SECT_OFF_BSS(objfile) (objfile)->sect_index_bss
-/* Answer whether there is more than one object file loaded. */
-
-#define MULTI_OBJFILE_P() (object_files && object_files->next)
-
/* Reset the per-BFD storage area on OBJ. */
void set_objfile_per_bfd (struct objfile *obj);
gdb_assert (osect->objfile && objfile_name (osect->objfile));
obj_name = objfile_name (osect->objfile);
- if (MULTI_OBJFILE_P ())
+ if (current_program_space->multi_objfile_p ())
if (pc_in_unmapped_range (addr, osect))
if (section_is_overlay (osect))
printf_filtered (_("%s in load address range of "
_("remove_objfile: objfile already unlinked"));
}
+/* See progspace.h. */
+
+bool
+program_space::multi_objfile_p () const
+{
+ return objfiles_head != nullptr && objfiles_head->next != nullptr;
+}
+
/* Copies program space SRC to DEST. Copies the main executable file,
and the main symbol file. Returns DEST. */
/* Remove OBJFILE from the list of objfiles. */
void remove_objfile (struct objfile *objfile);
+ /* Return true if there is more than one object file loaded; false
+ otherwise. */
+ bool multi_objfile_p () const;
+
+
/* Pointer to next in linked list. */
struct program_space *next = NULL;