This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[RFA] findvar.c: support LOC_BASEREG[_ARG] on Harvard archs
- To: jimb at cygnus dot com, ezannoni at cygnus dot com
- Subject: [RFA] findvar.c: support LOC_BASEREG[_ARG] on Harvard archs
- From: Nick Duffek <nsd at redhat dot com>
- Date: Mon, 16 Jul 2001 13:13:23 -0400
- CC: gdb-patches at sources dot redhat dot com
Hi,
At the moment, GDB doesn't apply the necessary POINTER_TO_ADDRESS
translation to the base register value used for finding LOC_BASEREG and
LOC_BASEREG_ARG variables.
This patch applies that translation. Okay to apply?
ChangeLog:
* findvar.c (read_var_value): Filter LOC_BASEREG and
LOC_BASEREG_ARG register values through POINTER_TO_ADDRESS.
Nick Duffek
<nsd@redhat.com>
[patch follows]
Index: gdb/findvar.c
===================================================================
diff -up gdb/findvar.c gdb/findvar.c
--- gdb/findvar.c Mon Jul 16 12:41:21 2001
+++ gdb/findvar.c Mon Jul 16 12:39:40 2001
@@ -612,9 +612,10 @@ addresses have not been bound by the dyn
case LOC_BASEREG_ARG:
{
char *buf = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ memset (buf, 0, 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 = POINTER_TO_ADDRESS (builtin_type_void_data_ptr, buf);
addr += SYMBOL_VALUE (var);
break;
}