struct language_defn;
struct probe;
struct common_block;
+struct obj_section;
+struct cmd_list_element;
/* Some of the structures in this file are space critical.
The space-critical structures are:
This is used to select one of the fields from the language specific
union above. */
- ENUM_BITFIELD(language) language : 8;
+ ENUM_BITFIELD(language) language : LANGUAGE_BITS;
/* This is only used by Ada. If set, then the 'mangled_lang' field
of language_specific is valid. Otherwise, the 'obstack' field is
within a given .o file. */
mst_file_text, /* Static version of mst_text */
mst_file_data, /* Static version of mst_data */
- mst_file_bss /* Static version of mst_bss */
+ mst_file_bss, /* Static version of mst_bss */
+ nr_minsym_types
};
+/* The number of enum minimal_symbol_type values, with some padding for
+ reasonable growth. */
+#define MINSYM_TYPE_BITS 4
+gdb_static_assert (nr_minsym_types <= (1 << MINSYM_TYPE_BITS));
+
/* Define a simple structure used to hold some very basic information about
all defined global symbols (text, data, bss, abs, etc). The only required
information is the general_symbol_info.
struct general_symbol_info mginfo;
- /* Size of this symbol. end_psymtab in dbxread.c uses this
+ /* Size of this symbol. dbx_end_psymtab in dbxread.c uses this
information to calculate the end of the partial symtab based on the
address of the last symbol plus the size of the last symbol. */
/* Classification type for this minimal symbol. */
- ENUM_BITFIELD(minimal_symbol_type) type : 8;
+ ENUM_BITFIELD(minimal_symbol_type) type : MINSYM_TYPE_BITS;
/* Non-zero if this symbol was created by gdb.
Such symbols do not appear in the output of "info var|fun". */
/* Fortran common blocks. Their naming must be separate from VAR_DOMAIN.
They also always use LOC_COMMON_BLOCK. */
- COMMON_BLOCK_DOMAIN
+ COMMON_BLOCK_DOMAIN,
+
+ /* This must remain last. */
+ NR_DOMAINS
} domain_enum;
/* The number of bits in a symbol used to represent the domain. */
-#define SYMBOL_DOMAIN_BITS 4
+#define SYMBOL_DOMAIN_BITS 3
+gdb_static_assert (NR_DOMAINS <= (1 << SYMBOL_DOMAIN_BITS));
extern const char *domain_name (domain_enum);
not find it in the full symbol table. But a reference to an external
symbol in a local block shadowing other definition requires full symbol
without possibly having its address available for LOC_STATIC. Testcase
- is provided as `gdb.dwarf2/dw2-unresolved.exp'. */
+ is provided as `gdb.dwarf2/dw2-unresolved.exp'.
+
+ This is also used for thread local storage (TLS) variables. In this case,
+ the address of the TLS variable must be determined when the variable is
+ referenced, from the MSYMBOL_VALUE_RAW_ADDRESS, which is the offset
+ of the TLS variable in the thread local storage of the shared
+ library/object. */
LOC_UNRESOLVED,
LOC_FINAL_VALUE
};
+/* The number of bits needed for values in enum address_class, with some
+ padding for reasonable growth, and room for run-time registered address
+ classes. See symtab.c:MAX_SYMBOL_IMPLS.
+ This is a #define so that we can have a assertion elsewhere to
+ verify that we have reserved enough space for synthetic address
+ classes. */
+#define SYMBOL_ACLASS_BITS 5
+gdb_static_assert (LOC_FINAL_VALUE <= (1 << SYMBOL_ACLASS_BITS));
+
/* The methods needed to implement LOC_COMPUTED. These methods can
use the symbol's .aux_value for additional per-symbol information.
uninitialized in such case. */
void (*find_frame_base_location) (struct symbol *framefunc, CORE_ADDR pc,
const gdb_byte **start, size_t *length);
+
+ /* Return the frame base address. FRAME is the frame for which we want to
+ compute the base address while FRAMEFUNC is the symbol for the
+ corresponding function. Return 0 on failure (FRAMEFUNC may not hold the
+ information we need).
+
+ This method is designed to work with static links (nested functions
+ handling). Static links are function properties whose evaluation returns
+ the frame base address for the enclosing frame. However, there are
+ multiple definitions for "frame base": the content of the frame base
+ register, the CFA as defined by DWARF unwinding information, ...
+
+ So this specific method is supposed to compute the frame base address such
+ as for nested fuctions, the static link computes the same address. For
+ instance, considering DWARF debugging information, the static link is
+ computed with DW_AT_static_link and this method must be used to compute
+ the corresponding DW_AT_frame_base attribute. */
+ CORE_ADDR (*get_frame_base) (struct symbol *framefunc,
+ struct frame_info *frame);
};
/* Functions used with LOC_REGISTER and LOC_REGPARM_ADDR. */
const struct symbol_register_ops *ops_register;
};
-/* The number of bits we reserve in a symbol for the aclass index.
- This is a #define so that we can have a assertion elsewhere to
- verify that we have reserved enough space for synthetic address
- classes. */
-
-#define SYMBOL_ACLASS_BITS 6
-
/* This structure is space critical. See space comments at the top. */
struct symbol
/* An arbitrary data pointer, allowing symbol readers to record
additional information on a per-symbol basis. Note that this data
must be allocated using the same obstack as the symbol itself. */
- /* So far it is only used by LOC_COMPUTED to
- find the location information. For a LOC_BLOCK symbol
- for a function in a compilation unit compiled with DWARF 2
- information, this is information used internally by the DWARF 2
- code --- specifically, the location expression for the frame
+ /* So far it is only used by:
+ LOC_COMPUTED: to find the location information
+ LOC_BLOCK (DWARF2 function): information used internally by the
+ DWARF 2 code --- specifically, the location expression for the frame
base for this function. */
/* FIXME drow/2003-02-21: For the LOC_BLOCK case, it might be better
to add a magic symbol to the block containing this information,