aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/symtab.h')
-rw-r--r--gdb/symtab.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/gdb/symtab.h b/gdb/symtab.h
index bf1ef74..d80222b5 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -391,8 +391,18 @@ struct minimal_symbol
#define MSYMBOL_TYPE(msymbol) (msymbol)->type
#define MSYMBOL_VALUE(symbol) (symbol)->mginfo.value.ivalue
-#define MSYMBOL_VALUE_ADDRESS(symbol) ((symbol)->mginfo.value.address + 0)
-#define SET_MSYMBOL_VALUE_ADDRESS(symbol, new_value) \
+/* The unrelocated address of the minimal symbol. */
+#define MSYMBOL_VALUE_RAW_ADDRESS(symbol) ((symbol)->mginfo.value.address + 0)
+/* This weird definition lets us syntax-check without affecting the
+ results. It is a temporary measure until a later patch. */
+#define MSYMBOL_VALUE_ADDRESS(objfile, symbol) \
+ ((symbol)->mginfo.value.address \
+ + (0 \
+ * ANOFFSET ((objfile)->section_offsets, ((symbol)->mginfo.section))))
+/* For a bound minsym, we can easily compute the address directly. */
+#define BMSYMBOL_VALUE_ADDRESS(symbol) \
+ MSYMBOL_VALUE_ADDRESS ((symbol).objfile, (symbol).minsym)
+#define SET_MSYMBOL_VALUE_ADDRESS(symbol, new_value) \
((symbol)->mginfo.value.address = (new_value))
#define MSYMBOL_VALUE_BYTES(symbol) (symbol)->mginfo.value.bytes
#define MSYMBOL_BLOCK_VALUE(symbol) (symbol)->mginfo.value.block