diff options
author | Tom Tromey <tromey@adacore.com> | 2019-06-25 11:53:11 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2019-10-02 09:53:17 -0600 |
commit | 38583298e0ab81ab78689d89abcb5122e0251c74 (patch) | |
tree | 2b36a7aa7b2874177aacd6ce83ad7b0f4256ab99 /gdb/dwarf2read.c | |
parent | 9344c18feb0ef3dfacfd1d0437c0d1e329feaa83 (diff) | |
download | gdb-38583298e0ab81ab78689d89abcb5122e0251c74.zip gdb-38583298e0ab81ab78689d89abcb5122e0251c74.tar.gz gdb-38583298e0ab81ab78689d89abcb5122e0251c74.tar.bz2 |
Change SYMBOL_VALUE_ADDRESS to be an rvalue
This changes SYMBOL_VALUE_ADDRESS to be an rvalue. The symbol readers
generally assign using this, so this also introduces
SET_SYMBOL_VALUE_ADDRESS and updates the readers. Making this change
is useful in a subsequent patch, which redefined SYMBOL_VALUE_ADDRESS.
gdb/ChangeLog
2019-10-02 Tom Tromey <tromey@adacore.com>
* coffread.c (process_coff_symbol): Update.
* dwarf2read.c (var_decode_location, new_symbol): Update.
* mdebugread.c (parse_symbol): Update.
* objfiles.c (relocate_one_symbol): Update.
* stabsread.c (define_symbol, fix_common_block)
(scan_file_globals): Update.
* symtab.h (SYMBOL_VALUE_ADDRESS): Expand to an rvalue.
(SET_SYMBOL_VALUE_ADDRESS): New macro.
* xcoffread.c (process_xcoff_symbol): Update.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r-- | gdb/dwarf2read.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 30658b2..f10f384 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -21495,15 +21495,20 @@ var_decode_location (struct attribute *attr, struct symbol *sym, unsigned int dummy; if (DW_BLOCK (attr)->data[0] == DW_OP_addr) - SYMBOL_VALUE_ADDRESS (sym) = - read_address (objfile->obfd, DW_BLOCK (attr)->data + 1, cu, &dummy); + SET_SYMBOL_VALUE_ADDRESS (sym, + read_address (objfile->obfd, + DW_BLOCK (attr)->data + 1, + cu, &dummy)); else - SYMBOL_VALUE_ADDRESS (sym) = - read_addr_index_from_leb128 (cu, DW_BLOCK (attr)->data + 1, &dummy); + SET_SYMBOL_VALUE_ADDRESS + (sym, read_addr_index_from_leb128 (cu, DW_BLOCK (attr)->data + 1, + &dummy)); SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC; fixup_symbol_section (sym, objfile); - SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (objfile->section_offsets, - SYMBOL_SECTION (sym)); + SET_SYMBOL_VALUE_ADDRESS (sym, + SYMBOL_VALUE_ADDRESS (sym) + + ANOFFSET (objfile->section_offsets, + SYMBOL_SECTION (sym))); return; } @@ -21617,7 +21622,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, addr = attr_value_as_address (attr); addr = gdbarch_adjust_dwarf2_addr (gdbarch, addr + baseaddr); - SYMBOL_VALUE_ADDRESS (sym) = addr; + SET_SYMBOL_VALUE_ADDRESS (sym, addr); } SYMBOL_TYPE (sym) = objfile_type (objfile)->builtin_core_addr; SYMBOL_DOMAIN (sym) = LABEL_DOMAIN; |