diff mbox

[05/28] mn10300: Fix debug offsets into the stack frame

Message ID 1294691517-19580-6-git-send-email-rth@redhat.com
State New
Headers show

Commit Message

Richard Henderson Jan. 10, 2011, 8:31 p.m. UTC
From: Richard Henderson <rth@twiddle.net>

We were using debugging hooks to semi-correct a mistake
in the lack of ARG_POINTER_CFA_OFFSET.
---
 gcc/config/mn10300/mn10300.h |   29 +++--------------------------
 1 files changed, 3 insertions(+), 26 deletions(-)

Comments

Jeff Law Jan. 11, 2011, 2:48 p.m. UTC | #1
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/10/11 13:31, Richard Henderson wrote:
> From: Richard Henderson <rth@twiddle.net>
> 
> We were using debugging hooks to semi-correct a mistake
> in the lack of ARG_POINTER_CFA_OFFSET.
OK.
Jeff
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNLG3BAAoJEBRtltQi2kC7ZW8IAKcmLj1OVH7pnyZmVCrGHkGC
lMNpOq98uZoVo0ng1DtoPKXeZ+qG2Q2wpxwmEYmcVoVWyDa2PNAO2Il/tBIILkvS
iD7FT+mcb6zVW+gSglU0hxMhsyD9dVifnm/kd4vcaKr1d026ZHu3rILxQ6zP2lb7
WAtz92KBZEzyKAF/UOFrS8+hPIOTteDhviXO+Xui4+ZC5U6Tz7FcEW/r0Ep2I9kv
0uDe1NFCfWws9dIugC/G2xuZWs6quXG7EMRHjyjCM4f0AzG7D5w/2knYJ8JDZEsW
XiY0lv/jv+fBDEDFfxkGSr7mEhn5nyd8cmbbzgjl4iCyEOXR3G6oUc44uRrPYLc=
=Z2gx
-----END PGP SIGNATURE-----
diff mbox

Patch

diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h
index 468c031..60d7d43 100644
--- a/gcc/config/mn10300/mn10300.h
+++ b/gcc/config/mn10300/mn10300.h
@@ -463,6 +463,9 @@  enum reg_class
 
 #define FIRST_PARM_OFFSET(FNDECL) 4
 
+/* But the CFA is at the arg pointer directly, not at the first argument.  */
+#define ARG_POINTER_CFA_OFFSET(FNDECL) 0
+
 #define ELIMINABLE_REGS				\
 {{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM},	\
  { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM},	\
@@ -731,34 +734,8 @@  struct cum_arg
 #undef  PREFERRED_DEBUGGING_TYPE
 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
 #define DWARF2_DEBUGGING_INFO 1
-
 #define DWARF2_ASM_LINE_DEBUG_INFO 1
 
-/* GDB always assumes the current function's frame begins at the value
-   of the stack pointer upon entry to the current function.  Accessing
-   local variables and parameters passed on the stack is done using the
-   base of the frame + an offset provided by GCC.
-
-   For functions which have frame pointers this method works fine;
-   the (frame pointer) == (stack pointer at function entry) and GCC provides
-   an offset relative to the frame pointer.
-
-   This loses for functions without a frame pointer; GCC provides an offset
-   which is relative to the stack pointer after adjusting for the function's
-   frame size.  GDB would prefer the offset to be relative to the value of
-   the stack pointer at the function's entry.  Yuk!  */
-#define DEBUGGER_AUTO_OFFSET(X) \
-  ((GET_CODE (X) == PLUS ? INTVAL (XEXP (X, 1)) : 0) \
-    + (frame_pointer_needed \
-       ? 0 : - mn10300_initial_offset (FRAME_POINTER_REGNUM, \
-				       STACK_POINTER_REGNUM)))
-
-#define DEBUGGER_ARG_OFFSET(OFFSET, X) \
-  ((GET_CODE (X) == PLUS ? OFFSET : 0) \
-    + (frame_pointer_needed \
-       ? 0 : - mn10300_initial_offset (ARG_POINTER_REGNUM, \
-				       STACK_POINTER_REGNUM)))
-
 /* Specify the machine mode that this machine uses
    for the index in the tablejump instruction.  */
 #define CASE_VECTOR_MODE Pmode