/* Definitions for symbol file management in GDB.
- Copyright (C) 1992-2014 Free Software Foundation, Inc.
+ Copyright (C) 1992-2015 Free Software Foundation, Inc.
This file is part of GDB.
struct bcache;
struct htab;
-struct symtab;
struct objfile_data;
/* This structure maintains information on a per-objfile basis about the
struct program_space *pspace;
- /* Each objfile points to a linked list of symtabs derived from this file,
- one symtab structure for each compilation unit (source file). Each link
- in the symtab list contains a backpointer to this objfile. */
+ /* List of compunits.
+ These are used to do symbol lookups and file/line-number lookups. */
- struct symtab *symtabs;
+ struct compunit_symtab *compunit_symtabs;
/* Each objfile points to a linked list of partial symtabs derived from
this file, one partial symtab structure for each compilation unit
#define OBJF_REORDERED (1 << 0) /* Functions are reordered */
/* Distinguish between an objfile for a shared library and a "vanilla"
- objfile. (If not set, the objfile may still actually be a solib.
- This can happen if the user created the objfile by using the
- add-symbol-file command. GDB doesn't in that situation actually
- check whether the file is a solib. Rather, the target's
- implementation of the solib interface is responsible for setting
- this flag when noticing solibs used by an inferior.) */
+ objfile. This may come from a target's implementation of the solib
+ interface, from add-symbol-file, or any other mechanism that loads
+ dynamic objects. */
#define OBJF_SHARED (1 << 1) /* From a shared library */
extern struct objfile *allocate_objfile (bfd *, const char *name, int);
-extern struct gdbarch *get_objfile_arch (struct objfile *);
+extern struct gdbarch *get_objfile_arch (const struct objfile *);
extern int entry_point_address_query (CORE_ADDR *entry_p);
extern int is_addr_in_objfile (CORE_ADDR addr, const struct objfile *objfile);
-/* Return true if ADDRESS maps into one of the sections of the
- userloaded ("add-symbol-file") objfiles of PSPACE and false
- otherwise. */
+/* Return true if ADDRESS maps into one of the sections of a
+ OBJF_SHARED objfile of PSPACE and false otherwise. */
-extern int userloaded_objfile_contains_address_p (struct program_space *pspace,
- CORE_ADDR address);
+extern int shared_objfile_contains_address_p (struct program_space *pspace,
+ CORE_ADDR address);
/* This operation deletes all objfile entries that represent solibs that
weren't explicitly loaded by the user, via e.g., the add-symbol-file
#define ALL_PSPACE_OBJFILES(ss, obj) \
for ((obj) = ss->objfiles; (obj) != NULL; (obj) = (obj)->next)
-#define ALL_PSPACE_OBJFILES_SAFE(ss, obj, nxt) \
- for ((obj) = ss->objfiles; \
- (obj) != NULL? ((nxt)=(obj)->next,1) :0; \
- (obj) = (nxt))
-
#define ALL_OBJFILES(obj) \
for ((obj) = current_program_space->objfiles; \
(obj) != NULL; \
/* Traverse all symtabs in one objfile. */
-#define ALL_OBJFILE_SYMTABS(objfile, s) \
- for ((s) = (objfile) -> symtabs; (s) != NULL; (s) = (s) -> next)
+#define ALL_OBJFILE_FILETABS(objfile, cu, s) \
+ ALL_OBJFILE_COMPUNITS (objfile, cu) \
+ ALL_COMPUNIT_FILETABS (cu, s)
-/* Traverse all primary symtabs in one objfile. */
+/* Traverse all compunits in one objfile. */
-#define ALL_OBJFILE_PRIMARY_SYMTABS(objfile, s) \
- ALL_OBJFILE_SYMTABS ((objfile), (s)) \
- if ((s)->primary)
+#define ALL_OBJFILE_COMPUNITS(objfile, cu) \
+ for ((cu) = (objfile) -> compunit_symtabs; (cu) != NULL; (cu) = (cu) -> next)
/* Traverse all minimal symbols in one objfile. */
/* Traverse all symtabs in all objfiles in the current symbol
space. */
-#define ALL_SYMTABS(objfile, s) \
- ALL_OBJFILES (objfile) \
- ALL_OBJFILE_SYMTABS (objfile, s)
-
-#define ALL_PSPACE_SYMTABS(ss, objfile, s) \
- ALL_PSPACE_OBJFILES (ss, objfile) \
- ALL_OBJFILE_SYMTABS (objfile, s)
+#define ALL_FILETABS(objfile, ps, s) \
+ ALL_OBJFILES (objfile) \
+ ALL_OBJFILE_FILETABS (objfile, ps, s)
-/* Traverse all symtabs in all objfiles in the current program space,
- skipping included files (which share a blockvector with their
- primary symtab). */
+/* Traverse all compunits in all objfiles in the current program space. */
-#define ALL_PRIMARY_SYMTABS(objfile, s) \
+#define ALL_COMPUNITS(objfile, cu) \
ALL_OBJFILES (objfile) \
- ALL_OBJFILE_PRIMARY_SYMTABS (objfile, s)
-
-#define ALL_PSPACE_PRIMARY_SYMTABS(pspace, objfile, s) \
- ALL_PSPACE_OBJFILES (ss, objfile) \
- ALL_OBJFILE_PRIMARY_SYMTABS (objfile, s)
+ ALL_OBJFILE_COMPUNITS (objfile, cu)
/* Traverse all minimal symbols in all objfiles in the current symbol
space. */
void set_objfile_per_bfd (struct objfile *obj);
+/* Return canonical name for OBJFILE.
+ This is the real file name if the file has been opened.
+ Otherwise it is the original name supplied by the user. */
+
const char *objfile_name (const struct objfile *objfile);
+/* Return the (real) file name of OBJFILE if the file has been opened,
+ otherwise return NULL. */
+
+const char *objfile_filename (const struct objfile *objfile);
+
+/* Return the name to print for OBJFILE in debugging messages. */
+
+extern const char *objfile_debug_name (const struct objfile *objfile);
+
/* Set the objfile's notion of the "main" name and language. */
extern void set_objfile_main_name (struct objfile *objfile,