aboutsummaryrefslogtreecommitdiff
path: root/gdb/findvar.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2001-09-24 19:46:15 +0000
committerAndrew Cagney <cagney@redhat.com>2001-09-24 19:46:15 +0000
commitf76febae84836e027f5638da63871a9d136da166 (patch)
tree996f7acad52a6185fe9547d3a79b97df68d79c60 /gdb/findvar.c
parentc406afafb1db0bc5b0bcb4cf844e1632121a4c68 (diff)
downloadgdb-f76febae84836e027f5638da63871a9d136da166.zip
gdb-f76febae84836e027f5638da63871a9d136da166.tar.gz
gdb-f76febae84836e027f5638da63871a9d136da166.tar.bz2
* findvar.c (read_var_value): For LOC_INDIRECT and LOC_REF_ARG
convert the pointer into a CORE_ADDRs.
Diffstat (limited to 'gdb/findvar.c')
-rw-r--r--gdb/findvar.c43
1 files changed, 25 insertions, 18 deletions
diff --git a/gdb/findvar.c b/gdb/findvar.c
index 0ba9392..0445620 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -471,18 +471,21 @@ read_var_value (register struct symbol *var, struct frame_info *frame)
break;
case LOC_INDIRECT:
- /* The import slot does not have a real address in it from the
- dynamic loader (dld.sl on HP-UX), if the target hasn't begun
- execution yet, so check for that. */
- if (!target_has_execution)
- error ("\
+ {
+ /* The import slot does not have a real address in it from the
+ dynamic loader (dld.sl on HP-UX), if the target hasn't
+ begun execution yet, so check for that. */
+ CORE_ADDR locaddr;
+ struct value *loc;
+ if (!target_has_execution)
+ error ("\
Attempt to access variable defined in different shared object or load module when\n\
addresses have not been bound by the dynamic loader. Try again when executable is running.");
- addr = SYMBOL_VALUE_ADDRESS (var);
- addr = read_memory_unsigned_integer
- (addr, TARGET_PTR_BIT / TARGET_CHAR_BIT);
- break;
+ locaddr = SYMBOL_VALUE_ADDRESS (var);
+ loc = value_at (lookup_pointer_type (type), locaddr, NULL);
+ addr = value_as_pointer (loc);
+ }
case LOC_ARG:
if (frame == NULL)
@@ -494,15 +497,19 @@ addresses have not been bound by the dynamic loader. Try again when executable i
break;
case LOC_REF_ARG:
- if (frame == NULL)
- return 0;
- addr = FRAME_ARGS_ADDRESS (frame);
- if (!addr)
- return 0;
- addr += SYMBOL_VALUE (var);
- addr = read_memory_unsigned_integer
- (addr, TARGET_PTR_BIT / TARGET_CHAR_BIT);
- break;
+ {
+ struct value *ref;
+ CORE_ADDR argref;
+ if (frame == NULL)
+ return 0;
+ argref = FRAME_ARGS_ADDRESS (frame);
+ if (!argref)
+ return 0;
+ argref += SYMBOL_VALUE (var);
+ ref = value_at (lookup_pointer_type (type), argref, NULL);
+ addr = value_as_pointer (ref);
+ break;
+ }
case LOC_LOCAL:
case LOC_LOCAL_ARG: