This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

mn10300: wrong debugging info


The range used for AM33 extended registers doesn't match the ranges
used by GDB.  This patch fixes this problem, by fixing GCC.  I had
raised backward-compatibility concerns, suggesting that we could fix
GDB and SIM instead, but Jeff Law convinced me that, since it has
always been broken, there's not much point in trying to retain
compatibility with it, and the numbering used by GDB is very sane, so
we've decided to keep it unchanged, and adjust GCC.  I'm checking this
in.

Index: gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* config/mn10300/mn10300.h (DBX_REGISTER_NUMBER): Remap register
	numbers to the ranges used by GDB.

Index: gcc/config/mn10300/mn10300.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/mn10300/mn10300.h,v
retrieving revision 1.39
diff -u -p -r1.39 mn10300.h
--- gcc/config/mn10300/mn10300.h	2000/08/11 01:31:14	1.39
+++ gcc/config/mn10300/mn10300.h	2000/08/26 21:38:29
@@ gcc/config/mn10300/mn10300.h					\
 
 #define DWARF2_ASM_LINE_DEBUG_INFO 1
 
-#define DBX_REGISTER_NUMBER(REGNO) REGNO
+#define DBX_REGISTER_NUMBER(REGNO) \
+  (REGNO_DATA_P ((REGNO)) ? (0 + (REGNO) - FIRST_DATA_REGNUM) \
+   : REGNO_ADDRESS_P ((REGNO)) ? (4 + (REGNO) - FIRST_ADDRESS_REGNUM) \
+   : REGNO_SP_P ((REGNO)) ? 8 \
+   : REGNO_EXTENDED_P ((REGNO)) ? (15 + (REGNO) - FIRST_EXTENDED_REGNUM) \
+   : -1)
 
 /* GDB always assumes the current function's frame begins at the value
    of the stack pointer upon entry to the current function.  Accessing

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]