diff options
author | Tom Tromey <tromey@redhat.com> | 2013-08-15 08:44:43 -0600 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2014-02-26 12:11:16 -0700 |
commit | 40c1a0073715c1e3f93afc83edac8396eb362a98 (patch) | |
tree | f18968c9b394e0ba915bf5d59e95de4b7869185c /gdb | |
parent | efd66ac6698323d9523a4dce352008c4c835812e (diff) | |
download | gdb-40c1a0073715c1e3f93afc83edac8396eb362a98.zip gdb-40c1a0073715c1e3f93afc83edac8396eb362a98.tar.gz gdb-40c1a0073715c1e3f93afc83edac8396eb362a98.tar.bz2 |
make MSYMBOL_VALUE_ADDRESS an rvalue
This changes MSYMBOL_VALUE_ADDRESS to be an rvalue. In a later patch
we change this macro to compute its value; this patch introduces a
setter to make the break a bit cleaner.
2014-02-26 Tom Tromey <tromey@redhat.com>
* minsyms.c (prim_record_minimal_symbol_full): Use
SET_MSYMBOL_VALUE_ADDRESS.
* objfiles.c (objfile_relocate1): Use SET_MSYMBOL_VALUE_ADDRESS.
* sh64-tdep.c (sh64_elf_make_msymbol_special): Use
SET_MSYMBOL_VALUE_ADDRESS.
* symtab.h (MSYMBOL_VALUE_ADDRESS): Expand to an rvalue.
(SET_MSYMBOL_VALUE_ADDRESS): New macro.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 10 | ||||
-rw-r--r-- | gdb/minsyms.c | 2 | ||||
-rw-r--r-- | gdb/objfiles.c | 5 | ||||
-rw-r--r-- | gdb/sh64-tdep.c | 2 | ||||
-rw-r--r-- | gdb/symtab.h | 4 |
5 files changed, 18 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3d3140c..0f44e5c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,15 @@ 2014-02-26 Tom Tromey <tromey@redhat.com> + * minsyms.c (prim_record_minimal_symbol_full): Use + SET_MSYMBOL_VALUE_ADDRESS. + * objfiles.c (objfile_relocate1): Use SET_MSYMBOL_VALUE_ADDRESS. + * sh64-tdep.c (sh64_elf_make_msymbol_special): Use + SET_MSYMBOL_VALUE_ADDRESS. + * symtab.h (MSYMBOL_VALUE_ADDRESS): Expand to an rvalue. + (SET_MSYMBOL_VALUE_ADDRESS): New macro. + +2014-02-26 Tom Tromey <tromey@redhat.com> + * symtab.h (struct minimal_symbol) <mginfo>: Rename from ginfo. (MSYMBOL_VALUE, MSYMBOL_VALUE_ADDRESS, MSYMBOL_VALUE_BYTES) (MSYMBOL_BLOCK_VALUE, MSYMBOL_VALUE_CHAIN, MSYMBOL_LANGUAGE) diff --git a/gdb/minsyms.c b/gdb/minsyms.c index aad7685..dde7d90 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -944,7 +944,7 @@ prim_record_minimal_symbol_full (const char *name, int name_len, int copy_name, MSYMBOL_SET_LANGUAGE (msymbol, language_auto, &objfile->objfile_obstack); MSYMBOL_SET_NAMES (msymbol, name, name_len, copy_name, objfile); - MSYMBOL_VALUE_ADDRESS (msymbol) = address; + SET_MSYMBOL_VALUE_ADDRESS (msymbol, address); MSYMBOL_SECTION (msymbol) = section; MSYMBOL_TYPE (msymbol) = ms_type; diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 89b8943..dba13fb 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -805,8 +805,9 @@ objfile_relocate1 (struct objfile *objfile, ALL_OBJFILE_MSYMBOLS (objfile, msym) if (MSYMBOL_SECTION (msym) >= 0) - MSYMBOL_VALUE_ADDRESS (msym) += ANOFFSET (delta, - MSYMBOL_SECTION (msym)); + SET_MSYMBOL_VALUE_ADDRESS (msym, (MSYMBOL_VALUE_ADDRESS (msym) + + ANOFFSET (delta, + MSYMBOL_SECTION (msym)))); } /* Relocating different sections by different amounts may cause the symbols to be out of order. */ diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c index ab1c96d..cf93d53 100644 --- a/gdb/sh64-tdep.c +++ b/gdb/sh64-tdep.c @@ -224,7 +224,7 @@ sh64_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym) if (((elf_symbol_type *)(sym))->internal_elf_sym.st_other == STO_SH5_ISA32) { MSYMBOL_TARGET_FLAG_1 (msym) = 1; - MSYMBOL_VALUE_ADDRESS (msym) |= 1; + SET_MSYMBOL_VALUE_ADDRESS (msym, MSYMBOL_VALUE_ADDRESS (msym) | 1); } } diff --git a/gdb/symtab.h b/gdb/symtab.h index 4bf3035..bf1ef74 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -391,7 +391,9 @@ 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 +#define MSYMBOL_VALUE_ADDRESS(symbol) ((symbol)->mginfo.value.address + 0) +#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 #define MSYMBOL_VALUE_CHAIN(symbol) (symbol)->mginfo.value.chain |