aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarfread.c
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1997-06-17 14:01:37 +0000
committerFred Fish <fnf@specifix.com>1997-06-17 14:01:37 +0000
commit015e113cfecf56f8ecf33b17adba765aadbb29d0 (patch)
tree693fde8597bd9d967178b8d7ef888009b7321422 /gdb/dwarfread.c
parentf781fe93a6bf9062af5770cb94af5c52b29c584b (diff)
downloadgdb-015e113cfecf56f8ecf33b17adba765aadbb29d0.zip
gdb-015e113cfecf56f8ecf33b17adba765aadbb29d0.tar.gz
gdb-015e113cfecf56f8ecf33b17adba765aadbb29d0.tar.bz2
* dwarfread.c (new_symbol): Use SYMBOL_VALUE_ADDRESS, instead of
SYMBOL_VALUE, to set the value of LOC_STATIC symbols.
Diffstat (limited to 'gdb/dwarfread.c')
-rw-r--r--gdb/dwarfread.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c
index 529f01b..3315c3a 100644
--- a/gdb/dwarfread.c
+++ b/gdb/dwarfread.c
@@ -2972,7 +2972,7 @@ new_symbol (dip, objfile)
case TAG_global_variable:
if (dip -> at_location != NULL)
{
- SYMBOL_VALUE (sym) = locval (dip -> at_location);
+ SYMBOL_VALUE_ADDRESS (sym) = locval (dip -> at_location);
add_symbol_to_list (sym, &global_symbols);
SYMBOL_CLASS (sym) = LOC_STATIC;
SYMBOL_VALUE (sym) += baseaddr;
@@ -2981,8 +2981,6 @@ new_symbol (dip, objfile)
case TAG_local_variable:
if (dip -> at_location != NULL)
{
- SYMBOL_VALUE (sym) = locval (dip -> at_location);
- add_symbol_to_list (sym, list_in_scope);
if (optimized_out)
{
SYMBOL_CLASS (sym) = LOC_OPTIMIZED_OUT;
@@ -3001,6 +2999,17 @@ new_symbol (dip, objfile)
SYMBOL_CLASS (sym) = LOC_STATIC;
SYMBOL_VALUE (sym) += baseaddr;
}
+ if (SYMBOL_CLASS (sym) == LOC_STATIC)
+ {
+ /* LOC_STATIC address class MUST use SYMBOL_VALUE_ADDRESS,
+ which may store to a bigger location than SYMBOL_VALUE. */
+ SYMBOL_VALUE_ADDRESS (sym) = locval (dip -> at_location);
+ }
+ else
+ {
+ SYMBOL_VALUE (sym) = locval (dip -> at_location);
+ }
+ add_symbol_to_list (sym, list_in_scope);
}
break;
case TAG_formal_parameter: