aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2000-12-08 20:12:36 +0000
committerMichael Snyder <msnyder@vmware.com>2000-12-08 20:12:36 +0000
commit88496bb5c69c7702ab2016f0d1997caf1042cbdb (patch)
treea1382b4854893b1a4814dcff1191916d6f160183 /gdb/dwarf2read.c
parent0fb34c3a109e4276e48f5999a59899b15f79c42c (diff)
downloadgdb-88496bb5c69c7702ab2016f0d1997caf1042cbdb.zip
gdb-88496bb5c69c7702ab2016f0d1997caf1042cbdb.tar.gz
gdb-88496bb5c69c7702ab2016f0d1997caf1042cbdb.tar.bz2
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.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index cb123ef..8a0513d 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -43,6 +43,10 @@
#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
@@ -4201,11 +4205,13 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile,
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) = basereg;
+ SYMBOL_BASEREG (sym) = DWARF2_REG_TO_REGNUM (basereg);
}
else if (islocal)
{
@@ -4247,6 +4253,8 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile,
if (isreg)
{
SYMBOL_CLASS (sym) = LOC_REGPARM;
+ SYMBOL_VALUE (sym) =
+ DWARF2_REG_TO_REGNUM (SYMBOL_VALUE (sym));
}
else if (offreg)
{
@@ -4259,7 +4267,7 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile,
else
{
SYMBOL_CLASS (sym) = LOC_BASEREG_ARG;
- SYMBOL_BASEREG (sym) = basereg;
+ SYMBOL_BASEREG (sym) = DWARF2_REG_TO_REGNUM (basereg);
}
}
else