This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch] Translation of mn10300 debugging symbols to gdb's internalregister numbering scheme
- To: gdb-patches at sources dot redhat dot com
- Subject: [patch] Translation of mn10300 debugging symbols to gdb's internalregister numbering scheme
- From: Matt Hiller <hiller at redhat dot com>
- Date: Tue, 27 Feb 2001 13:36:40 -0800 (PST)
At http://gcc.gnu.org/ml/gcc-patches/2001-02/msg01491.html, Alex
Oliva describes an inconsistency in the register numbering for mn10300
between gcc and the other tools. Matushita has developed debugging tools
based on the numbering gcc uses, so we are obliged to alter the behavior
of gdb instead. The following patch has gdb translate debugging register
numbers to gdb REGNUMs.
I do not have write access to this repository; my patch, if
acceptable, will have to be committed by someone else.
--
Matt Hiller
GCC Engineer, Red Hat, Inc., Sunnyvale office
hiller@redhat.com
2001-02-27 Matt Hiller <hiller@redhat.com>
* config/mn10300/tm-mn10300.h (DWARF_REG_TO_REGNUM): New macro.
(STAB_REG_TO_REGNUM): New macro.
Index: config/mn10300/tm-mn10300.h
===================================================================
RCS file: /cvs/src/src/gdb/config/mn10300/tm-mn10300.h,v
retrieving revision 1.4
diff -u -p -r1.4 tm-mn10300.h
--- config/mn10300/tm-mn10300.h 2000/08/12 03:28:42 1.4
+++ config/mn10300/tm-mn10300.h 2001/02/27 21:33:46
@@ -167,3 +167,15 @@ extern use_struct_convention_fn mn10300_
extern void mn10300_virtual_frame_pointer (CORE_ADDR, long *, long *);
#define TARGET_VIRTUAL_FRAME_POINTER(PC, REGP, OFFP) \
mn10300_virtual_frame_pointer ((PC), (REGP), (OFFP))
+
+/* Convert a DWARF register number to a gdb REGNUM. */
+#define DWARF_REG_TO_REGNUM(num) \
+ (((num) <= 7) ? (num) \
+ : (num == 8) ? (-1) /* ap, which won't appear in debugging info. */ \
+ : (num == 9) ? (SP_REGNUM) \
+ : (10 <= num && num <= 17) ? ((num - 10) + E0_REGNUM) \
+ : (-1)) /* program counter, etc., none of which appear in debugging
+ info. */
+
+/* Convert a STAB register number to a gdb REGNUM. */
+#define STAB_REG_TO_REGNUM(num) DWARF_REG_TO_REGNUM (num)