From: Nicholas Duffek Date: Mon, 16 Jul 2001 22:57:50 +0000 (+0000) Subject: * findvar.c (read_var_value): Apply value_as_pointer() to X-Git-Tag: gdb_5_1-2001-07-29-branchpoint~143 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9ed10b085173a0bd46b57430c9c9af6036f2d740;p=external%2Fbinutils.git * findvar.c (read_var_value): Apply value_as_pointer() to addresses retrieved from the target for LOC_BASEREG and LOC_BASEREG_ARG variables. --- 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 + + * 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 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; }