aboutsummaryrefslogtreecommitdiff
path: root/gdb/findvar.c
diff options
context:
space:
mode:
authorNicholas Duffek <nsd@redhat.com>2001-07-16 22:57:50 +0000
committerNicholas Duffek <nsd@redhat.com>2001-07-16 22:57:50 +0000
commit9ed10b085173a0bd46b57430c9c9af6036f2d740 (patch)
tree6426b82eb0b5d7700ce4f1f1ae6cc3dc326d0ca6 /gdb/findvar.c
parent75fd9bc1ec6f7c44cea2dce02c996c07ab826af8 (diff)
downloadgdb-9ed10b085173a0bd46b57430c9c9af6036f2d740.zip
gdb-9ed10b085173a0bd46b57430c9c9af6036f2d740.tar.gz
gdb-9ed10b085173a0bd46b57430c9c9af6036f2d740.tar.bz2
* findvar.c (read_var_value): Apply value_as_pointer() to
addresses retrieved from the target for LOC_BASEREG and LOC_BASEREG_ARG variables.
Diffstat (limited to 'gdb/findvar.c')
-rw-r--r--gdb/findvar.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/gdb/findvar.c b/gdb/findvar.c
index 8faf2f1..28a8ce0 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -610,22 +610,15 @@ addresses have not been bound by the dynamic loader. Try again when executable i
case LOC_BASEREG:
case LOC_BASEREG_ARG:
- {
- char *buf = (char*) alloca (MAX_REGISTER_RAW_SIZE);
- get_saved_register (buf, NULL, NULL, frame, SYMBOL_BASEREG (var),
- NULL);
- addr = extract_address (buf, REGISTER_RAW_SIZE (SYMBOL_BASEREG (var)));
- addr += SYMBOL_VALUE (var);
- break;
- }
-
case LOC_THREAD_LOCAL_STATIC:
{
- char *buf = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ value_ptr regval;
- get_saved_register (buf, NULL, NULL, frame, SYMBOL_BASEREG (var),
- NULL);
- addr = extract_address (buf, REGISTER_RAW_SIZE (SYMBOL_BASEREG (var)));
+ regval = value_from_register (lookup_pointer_type (type),
+ SYMBOL_BASEREG (var), frame);
+ if (regval == NULL)
+ error ("Value of base register not available.");
+ addr = value_as_pointer (regval);
addr += SYMBOL_VALUE (var);
break;
}