aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/symtab.h')
-rw-r--r--gdb/symtab.h27
1 files changed, 23 insertions, 4 deletions
diff --git a/gdb/symtab.h b/gdb/symtab.h
index b3a9a6b..3f645b1 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -711,10 +711,19 @@ struct symbol
struct type *type;
- /* The symbol table containing this symbol. This is the file
- associated with LINE. It can be NULL during symbols read-in but it is
- never NULL during normal operation. */
- struct symtab *symtab;
+ /* The owner of this symbol.
+ Which one to use is defined by symbol.is_arch_owned. */
+
+ union
+ {
+ /* The symbol table containing this symbol. This is the file associated
+ with LINE. It can be NULL during symbols read-in but it is never NULL
+ during normal operation. */
+ struct symtab *symtab;
+
+ /* For types defined by the architecture. */
+ struct gdbarch *arch;
+ } owner;
/* Domain code. */
@@ -726,6 +735,11 @@ struct symbol
unsigned int aclass_index : SYMBOL_ACLASS_BITS;
+ /* If non-zero then symbol is objfile-owned, use owner.symtab.
+ Otherwise symbol is arch-owned, use owner.arch. */
+
+ unsigned int is_objfile_owned : 1;
+
/* Whether this is an argument. */
unsigned is_argument : 1;
@@ -742,6 +756,7 @@ struct symbol
SYMBOL_INLINED set) this is the line number of the function's call
site. Inlined function symbols are not definitions, and they are
never found by symbol table lookup.
+ If this symbol is arch-owned, LINE shall be zero.
FIXME: Should we really make the assumption that nobody will try
to debug files longer than 64K lines? What about machine
@@ -769,10 +784,14 @@ struct symbol
extern const struct symbol_impl *symbol_impls;
+/* Note: There is no accessor macro for symbol.owner because it is
+ "private". */
+
#define SYMBOL_DOMAIN(symbol) (symbol)->domain
#define SYMBOL_IMPL(symbol) (symbol_impls[(symbol)->aclass_index])
#define SYMBOL_ACLASS_INDEX(symbol) (symbol)->aclass_index
#define SYMBOL_CLASS(symbol) (SYMBOL_IMPL (symbol).aclass)
+#define SYMBOL_OBJFILE_OWNED(symbol) ((symbol)->is_objfile_owned)
#define SYMBOL_IS_ARGUMENT(symbol) (symbol)->is_argument
#define SYMBOL_INLINED(symbol) (symbol)->is_inlined
#define SYMBOL_IS_CPLUS_TEMPLATE_FUNCTION(symbol) \