From 9ed10b085173a0bd46b57430c9c9af6036f2d740 Mon Sep 17 00:00:00 2001 From: Nicholas Duffek Date: Mon, 16 Jul 2001 22:57:50 +0000 Subject: [PATCH] * findvar.c (read_var_value): Apply value_as_pointer() to addresses retrieved from the target for LOC_BASEREG and LOC_BASEREG_ARG variables. --- gdb/ChangeLog | 6 ++++++ gdb/findvar.c | 19 ++++++------------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 79732eae463..a4277c53d1a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2001-07-16 Nick Duffek + + * 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 * NEWS: New target CRIS. diff --git a/gdb/findvar.c b/gdb/findvar.c index 8faf2f18dda..28a8ce05a99 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; } -- 2.30.2