aboutsummaryrefslogtreecommitdiff
path: root/gdb/stabsread.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2019-06-25 11:53:11 -0600
committerTom Tromey <tromey@adacore.com>2019-10-02 09:53:17 -0600
commit38583298e0ab81ab78689d89abcb5122e0251c74 (patch)
tree2b36a7aa7b2874177aacd6ce83ad7b0f4256ab99 /gdb/stabsread.c
parent9344c18feb0ef3dfacfd1d0437c0d1e329feaa83 (diff)
downloadgdb-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/stabsread.c')
-rw-r--r--gdb/stabsread.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index 48c88de..da455da 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -942,7 +942,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
SYMBOL_TYPE (sym) = read_type (&p, objfile);
SYMBOL_ACLASS_INDEX (sym) = LOC_LABEL;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
- SYMBOL_VALUE_ADDRESS (sym) = valu;
+ SET_SYMBOL_VALUE_ADDRESS (sym, valu);
add_symbol_to_list (sym, get_local_symbols ());
break;
@@ -1188,7 +1188,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
/* Static symbol at top level of file. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC;
- SYMBOL_VALUE_ADDRESS (sym) = valu;
+ SET_SYMBOL_VALUE_ADDRESS (sym, valu);
if (gdbarch_static_transform_name_p (gdbarch)
&& gdbarch_static_transform_name (gdbarch,
SYMBOL_LINKAGE_NAME (sym))
@@ -1204,7 +1204,8 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
(gdbarch, SYMBOL_LINKAGE_NAME (sym));
SYMBOL_SET_LINKAGE_NAME (sym, new_name);
- SYMBOL_VALUE_ADDRESS (sym) = BMSYMBOL_VALUE_ADDRESS (msym);
+ SET_SYMBOL_VALUE_ADDRESS (sym,
+ BMSYMBOL_VALUE_ADDRESS (msym));
}
}
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
@@ -1380,7 +1381,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
/* Static symbol of local scope. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC;
- SYMBOL_VALUE_ADDRESS (sym) = valu;
+ SET_SYMBOL_VALUE_ADDRESS (sym, valu);
if (gdbarch_static_transform_name_p (gdbarch)
&& gdbarch_static_transform_name (gdbarch,
SYMBOL_LINKAGE_NAME (sym))
@@ -1396,7 +1397,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
(gdbarch, SYMBOL_LINKAGE_NAME (sym));
SYMBOL_SET_LINKAGE_NAME (sym, new_name);
- SYMBOL_VALUE_ADDRESS (sym) = BMSYMBOL_VALUE_ADDRESS (msym);
+ SET_SYMBOL_VALUE_ADDRESS (sym, BMSYMBOL_VALUE_ADDRESS (msym));
}
}
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
@@ -4363,7 +4364,9 @@ fix_common_block (struct symbol *sym, CORE_ADDR valu)
int j;
for (j = next->nsyms - 1; j >= 0; j--)
- SYMBOL_VALUE_ADDRESS (next->symbol[j]) += valu;
+ SET_SYMBOL_VALUE_ADDRESS (next->symbol[j],
+ SYMBOL_VALUE_ADDRESS (next->symbol[j])
+ + valu);
}
}
@@ -4641,8 +4644,9 @@ scan_file_globals (struct objfile *objfile)
}
else
{
- SYMBOL_VALUE_ADDRESS (sym)
- = MSYMBOL_VALUE_ADDRESS (resolve_objfile, msymbol);
+ SET_SYMBOL_VALUE_ADDRESS
+ (sym, MSYMBOL_VALUE_ADDRESS (resolve_objfile,
+ msymbol));
}
SYMBOL_SECTION (sym) = MSYMBOL_SECTION (msymbol);
}
@@ -4680,7 +4684,7 @@ scan_file_globals (struct objfile *objfile)
/* Change the symbol address from the misleading chain value
to address zero. */
- SYMBOL_VALUE_ADDRESS (prev) = 0;
+ SET_SYMBOL_VALUE_ADDRESS (prev, 0);
/* Complain about unresolved common block symbols. */
if (SYMBOL_CLASS (prev) == LOC_STATIC)