aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/symtab.h')
-rw-r--r--gdb/symtab.h22
1 files changed, 17 insertions, 5 deletions
diff --git a/gdb/symtab.h b/gdb/symtab.h
index e85ae68..efdbada 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -539,7 +539,21 @@ struct general_symbol_info
section_offsets for this objfile. Negative means that the symbol
does not get relocated relative to a section. */
- short section;
+ short m_section;
+
+ /* Set the index into the obj_section list (within the containing
+ objfile) for the section that contains this symbol. See M_SECTION
+ for more details. */
+
+ void set_section_index (short idx)
+ { m_section = idx; }
+
+ /* Return the index into the obj_section list (within the containing
+ objfile) for the section that contains this symbol. See M_SECTION
+ for more details. */
+
+ short section_index () const
+ { return m_section; }
/* Return the obj_section from OBJFILE for this symbol. The symbol
returned is based on the SECTION member variable, and can be nullptr
@@ -570,7 +584,6 @@ extern CORE_ADDR get_symbol_address (const struct symbol *sym);
#define SYMBOL_VALUE_COMMON_BLOCK(symbol) (symbol)->value.common_block
#define SYMBOL_BLOCK_VALUE(symbol) (symbol)->value.block
#define SYMBOL_VALUE_CHAIN(symbol) (symbol)->value.chain
-#define SYMBOL_SECTION(symbol) (symbol)->section
/* Try to determine the demangled name for a symbol, based on the
language of that symbol. If the language is set to language_auto,
@@ -755,7 +768,7 @@ extern CORE_ADDR get_msymbol_address (struct objfile *objf,
#define MSYMBOL_VALUE_ADDRESS(objfile, symbol) \
(((symbol)->maybe_copied) ? get_msymbol_address (objfile, symbol) \
: ((symbol)->value.address \
- + (objfile)->section_offsets[(symbol)->section]))
+ + (objfile)->section_offsets[(symbol)->section_index ()]))
/* For a bound minsym, we can easily compute the address directly. */
#define BMSYMBOL_VALUE_ADDRESS(symbol) \
MSYMBOL_VALUE_ADDRESS ((symbol).objfile, (symbol).minsym)
@@ -764,7 +777,6 @@ extern CORE_ADDR get_msymbol_address (struct objfile *objf,
#define MSYMBOL_VALUE_BYTES(symbol) (symbol)->value.bytes
#define MSYMBOL_BLOCK_VALUE(symbol) (symbol)->value.block
#define MSYMBOL_VALUE_CHAIN(symbol) (symbol)->value.chain
-#define MSYMBOL_SECTION(symbol) (symbol)->section
#include "minsyms.h"
@@ -1118,7 +1130,7 @@ struct symbol : public general_symbol_info, public allocate_on_obstack
language_specific.obstack = nullptr;
m_language = language_unknown;
ada_mangled = 0;
- section = -1;
+ m_section = -1;
/* GCC 4.8.5 (on CentOS 7) does not correctly compile class-
initialization of unions, so we initialize it manually here. */
owner.symtab = nullptr;