This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] Translate register ids in dwarf2read
- To: gdb-patches at sources dot redhat dot com
- Subject: [PATCH] Translate register ids in dwarf2read
- From: Michael Snyder <msnyder at redhat dot com>
- Date: Fri, 08 Dec 2000 12:07:35 -0800
- Organization: Red Hat
2000-12-08 Michael Snyder <msnyder@mvstp600e.cygnus.com>
* dwarf2read.c (DWARF2_REG_TO_REGNUM): New macro. Provide default
definition. Will be used to translate between the compiler's
register numbering and GDB's (for register variables etc).
(new_symbol): Use DWARF2_REG_TO_REGNUM to translate register ids.
Index: dwarf2read.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/dwarf2read.c,v
retrieving revision 2.58
diff -c -3 -p -r2.58 dwarf2read.c
*** dwarf2read.c 2000/11/14 11:00:29 2.58
--- dwarf2read.c 2000/12/08 20:02:28
***************
*** 43,48 ****
--- 43,52 ----
#include "gdb_string.h"
#include <sys/types.h>
+ #ifndef DWARF2_REG_TO_REGNUM
+ #define DWARF2_REG_TO_REGNUM(REG) (REG)
+ #endif
+
#if 0
/* .debug_info header for a compilation unit
Because of alignment constraints, this structure has padding and cannot
*************** new_symbol (struct die_info *die, struct
*** 4201,4211 ****
else if (isreg)
{
SYMBOL_CLASS (sym) = LOC_REGISTER;
}
else if (offreg)
{
SYMBOL_CLASS (sym) = LOC_BASEREG;
! SYMBOL_BASEREG (sym) = basereg;
}
else if (islocal)
{
--- 4205,4217 ----
else if (isreg)
{
SYMBOL_CLASS (sym) = LOC_REGISTER;
+ SYMBOL_VALUE (sym) =
+ DWARF2_REG_TO_REGNUM (SYMBOL_VALUE (sym));
}
else if (offreg)
{
SYMBOL_CLASS (sym) = LOC_BASEREG;
! SYMBOL_BASEREG (sym) = DWARF2_REG_TO_REGNUM (basereg);
}
else if (islocal)
{
*************** new_symbol (struct die_info *die, struct
*** 4247,4252 ****
--- 4253,4260 ----
if (isreg)
{
SYMBOL_CLASS (sym) = LOC_REGPARM;
+ SYMBOL_VALUE (sym) =
+ DWARF2_REG_TO_REGNUM (SYMBOL_VALUE (sym));
}
else if (offreg)
{
*************** new_symbol (struct die_info *die, struct
*** 4259,4265 ****
else
{
SYMBOL_CLASS (sym) = LOC_BASEREG_ARG;
! SYMBOL_BASEREG (sym) = basereg;
}
}
else
--- 4267,4273 ----
else
{
SYMBOL_CLASS (sym) = LOC_BASEREG_ARG;
! SYMBOL_BASEREG (sym) = DWARF2_REG_TO_REGNUM (basereg);
}
}
else