diff options
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/findvar.c | 19 |
2 files changed, 12 insertions, 13 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 79732ea..a4277c5 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2001-07-16 Nick Duffek <nsd@redhat.com> + + * findvar.c (read_var_value): Apply value_as_pointer() to + addresses retrieved from the target for LOC_BASEREG and + LOC_BASEREG_ARG variables. + 2001-07-16 Orjan Friberg <orjanf@axis.com> * NEWS: New target CRIS. 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; } |