From: Jeff Law Date: Fri, 17 Jun 1994 05:43:06 +0000 (-0600) Subject: pa.h (DEBUGGER_AUTO_OFFSET): Define. X-Git-Tag: misc/cutover-egcs-0~6434 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e7e71216fe7f37c93ca86f84df21216adbbb904;p=thirdparty%2Fgcc.git pa.h (DEBUGGER_AUTO_OFFSET): Define. * pa.h (DEBUGGER_AUTO_OFFSET): Define. If no frame pointer is available, then adjust the offset by the size of the current frame. From-SVN: r7509 --- diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h index 39d21bbe924f..f3280771b62a 100644 --- a/gcc/config/pa/pa.h +++ b/gcc/config/pa/pa.h @@ -138,6 +138,23 @@ extern int target_flags; #define ASM_STABS_OP "\t.stabs" #define ASM_STABN_OP "\t.stabn" +/* 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 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 : compute_frame_size (get_frame_size (), 0))) + #if (TARGET_DEFAULT & 1) == 0 #define CPP_SPEC "%{msnake:-D__hp9000s700 -D_PA_RISC1_1}\ %{mpa-risc-1-1:-D__hp9000s700 -D_PA_RISC1_1}"