diff options
author | Adhemerval Zanella <azanella@linux.vnet.ibm.com> | 2013-11-22 06:36:54 -0600 |
---|---|---|
committer | Adhemerval Zanella <azanella@linux.vnet.ibm.com> | 2013-12-05 07:44:07 -0600 |
commit | eb5ad6b9bcf579f1cb5c67ca4650ee4a0cf1b4b1 (patch) | |
tree | b82b8fbfb23fb60cc69d4bd06bf8ef13c471c9eb /sysdeps/powerpc/powerpc64 | |
parent | 76a4a26979e58132d500e700ac1637a09c6d9cef (diff) | |
download | glibc-eb5ad6b9bcf579f1cb5c67ca4650ee4a0cf1b4b1.tar.gz glibc-eb5ad6b9bcf579f1cb5c67ca4650ee4a0cf1b4b1.tar.xz glibc-eb5ad6b9bcf579f1cb5c67ca4650ee4a0cf1b4b1.zip |
PowerPC: Add systemtap static probe points in setjmp/longjmp
This patch add static probes for setjmp/longjmp in the way gdb expects,fixing the gdb.base/longjmp.exp gdb testcases. It changes the symbol_name and use macros to to avoid change the probe names and ending up adding more logic on GDB (since with the expected name GDB work seamlessly).
Diffstat (limited to 'sysdeps/powerpc/powerpc64')
-rw-r--r-- | sysdeps/powerpc/powerpc64/__longjmp-common.S | 9 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc64/setjmp-common.S | 30 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc64/setjmp.S | 28 |
3 files changed, 40 insertions, 27 deletions
diff --git a/sysdeps/powerpc/powerpc64/__longjmp-common.S b/sysdeps/powerpc/powerpc64/__longjmp-common.S index ce5a018e37..3c792b495e 100644 --- a/sysdeps/powerpc/powerpc64/__longjmp-common.S +++ b/sysdeps/powerpc/powerpc64/__longjmp-common.S @@ -17,6 +17,7 @@ <http://www.gnu.org/licenses/>. */ #include <sysdep.h> +#include <stap-probe.h> #define _ASM #define _SETJMP_H #ifdef __NO_VMX__ @@ -147,20 +148,23 @@ L(no_vmx): #ifdef PTR_DEMANGLE PTR_DEMANGLE2 (r0, r25) #endif + /* longjmp/longjmp_target probe expects longjmp first argument (8@3), + second argument (-4@4), and target address (8@0), respectively. */ + LIBC_PROBE (longjmp, 3, 8@3, -4@4, 8@0) mtlr r0 /* std r2,FRAME_TOC_SAVE(r1) Restore the TOC save area. */ ld r21,((JB_GPRS+7)*8)(r3) lfd fp21,((JB_FPRS+7)*8)(r3) ld r22,((JB_GPRS+8)*8)(r3) lfd fp22,((JB_FPRS+8)*8)(r3) - lwz r0,((JB_CR*8)+4)(r3) /* 32-bit CR. */ + lwz r5,((JB_CR*8)+4)(r3) /* 32-bit CR. */ ld r23,((JB_GPRS+9)*8)(r3) lfd fp23,((JB_FPRS+9)*8)(r3) ld r24,((JB_GPRS+10)*8)(r3) lfd fp24,((JB_FPRS+10)*8)(r3) ld r25,((JB_GPRS+11)*8)(r3) lfd fp25,((JB_FPRS+11)*8)(r3) - mtcrf 0xFF,r0 + mtcrf 0xFF,r5 ld r26,((JB_GPRS+12)*8)(r3) lfd fp26,((JB_FPRS+12)*8)(r3) ld r27,((JB_GPRS+13)*8)(r3) @@ -173,6 +177,7 @@ L(no_vmx): lfd fp30,((JB_FPRS+16)*8)(r3) ld r31,((JB_GPRS+17)*8)(r3) lfd fp31,((JB_FPRS+17)*8)(r3) + LIBC_PROBE (longjmp_target, 3, 8@3, -4@4, 8@0) mr r3,r4 blr END (__longjmp) diff --git a/sysdeps/powerpc/powerpc64/setjmp-common.S b/sysdeps/powerpc/powerpc64/setjmp-common.S index 9e4fb02779..6ab44d63ed 100644 --- a/sysdeps/powerpc/powerpc64/setjmp-common.S +++ b/sysdeps/powerpc/powerpc64/setjmp-common.S @@ -17,6 +17,7 @@ <http://www.gnu.org/licenses/>. */ #include <sysdep.h> +#include <stap-probe.h> #define _ASM #ifdef __NO_VMX__ #include <novmxsetjmp.h> @@ -42,11 +43,11 @@ #endif .machine "altivec" -ENTRY (setjmp) +ENTRY (setjmp_symbol) CALL_MCOUNT 1 li r4,1 /* Set second argument to 1. */ - b JUMPTARGET (GLUE(__sigsetjmp,_ent)) -END (setjmp) + b JUMPTARGET (GLUE(__sigsetjmp_symbol,_ent)) +END (setjmp_symbol) #if defined SHARED && !defined IS_IN_rtld && !defined __NO_VMX__ /* When called from within libc we need a special version of _setjmp @@ -57,20 +58,20 @@ ENTRY (__GI__setjmp) std r2,FRAME_TOC_SAVE(r1) /* Save the callers TOC in the save area. */ CALL_MCOUNT 1 li r4,0 /* Set second argument to 0. */ - b JUMPTARGET (GLUE(__sigsetjmp,_ent)) + b JUMPTARGET (GLUE(__sigsetjmp_symbol,_ent)) END (__GI__setjmp) #endif -ENTRY (_setjmp) +ENTRY (_setjmp_symbol) CALL_MCOUNT 1 li r4,0 /* Set second argument to 0. */ - b JUMPTARGET (GLUE(__sigsetjmp,_ent)) -END (_setjmp) -libc_hidden_def (_setjmp) + b JUMPTARGET (GLUE(__sigsetjmp_symbol,_ent)) +END (_setjmp_symbol) +libc_hidden_def (_setjmp_symbol) -ENTRY (__sigsetjmp) +ENTRY (__sigsetjmp_symbol) CALL_MCOUNT 2 -JUMPTARGET(GLUE(__sigsetjmp,_ent)): +JUMPTARGET(GLUE(__sigsetjmp_symbol,_ent)): #ifdef PTR_MANGLE mr r5, r1 PTR_MANGLE (r5, r6) @@ -85,6 +86,9 @@ JUMPTARGET(GLUE(__sigsetjmp,_ent)): #else std r2,(JB_GPR2*8)(3) #endif + /* setjmp probe expects longjmp first argument (8@3), second argument + (-4@4), and target address (8@0), respectively. */ + LIBC_PROBE (setjmp, 3, 8@3, -4@4, 8@0) std r14,((JB_GPRS+0)*8)(3) stfd fp14,((JB_FPRS+0)*8)(3) #ifdef PTR_MANGLE @@ -213,18 +217,18 @@ L(no_vmx): li r3,0 blr #elif defined SHARED - b JUMPTARGET (__sigjmp_save) + b JUMPTARGET (__sigjmp_save_symbol) #else mflr r0 std r0,FRAME_LR_SAVE(r1) stdu r1,-FRAME_MIN_SIZE(r1) cfi_adjust_cfa_offset(FRAME_MIN_SIZE) cfi_offset(lr,FRAME_LR_SAVE) - bl JUMPTARGET (__sigjmp_save) + bl JUMPTARGET (__sigjmp_save_symbol) nop ld r0,FRAME_MIN_SIZE+FRAME_LR_SAVE(r1) addi r1,r1,FRAME_MIN_SIZE mtlr r0 blr #endif -END (__sigsetjmp) +END (__sigsetjmp_symbol) diff --git a/sysdeps/powerpc/powerpc64/setjmp.S b/sysdeps/powerpc/powerpc64/setjmp.S index 0a3b2fc022..5c6baf52df 100644 --- a/sysdeps/powerpc/powerpc64/setjmp.S +++ b/sysdeps/powerpc/powerpc64/setjmp.S @@ -22,6 +22,10 @@ #if defined NOT_IN_libc /* Build a non-versioned object for rtld-*. */ +# define setjmp_symbol setjmp +# define _setjmp_symbol _setjmp +# define __sigsetjmp_symbol __sigsetjmp +# define __sigjmp_save_symbol __sigjmp_save # include "setjmp-common.S" #else /* !NOT_IN_libc */ @@ -29,28 +33,28 @@ versioned_symbol (libc, __vmxsetjmp, setjmp, GLIBC_2_3_4) versioned_symbol (libc, __vmx_setjmp, _setjmp, GLIBC_2_3_4) versioned_symbol (libc, __vmx__sigsetjmp, __sigsetjmp, GLIBC_2_3_4) -# define setjmp __vmxsetjmp -# define _setjmp __vmx_setjmp -# define __sigsetjmp __vmx__sigsetjmp -# define __sigjmp_save __vmx__sigjmp_save +# define setjmp_symbol __vmxsetjmp +# define _setjmp_symbol __vmx_setjmp +# define __sigsetjmp_symbol __vmx__sigsetjmp +# define __sigjmp_save_symbol __vmx__sigjmp_save # include "setjmp-common.S" strong_alias (__vmxsetjmp, __vmx__setjmp) strong_alias (__vmx__sigsetjmp, __setjmp) # if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4) -# undef setjmp -# undef _setjmp -# undef __sigsetjmp -# undef __sigjmp_save +# undef setjmp_symbol +# undef _setjmp_symbol +# undef __sigsetjmp_symbol +# undef __sigjmp_save_symbol # undef JB_SIZE # define __NO_VMX__ compat_symbol (libc, __novmxsetjmp, setjmp, GLIBC_2_3) compat_symbol (libc, __novmx_setjmp,_setjmp, GLIBC_2_3); compat_symbol (libc, __novmx__sigsetjmp,__sigsetjmp, GLIBC_2_3) -# define setjmp __novmxsetjmp -# define _setjmp __novmx_setjmp -# define __sigsetjmp __novmx__sigsetjmp -# define __sigjmp_save __novmx__sigjmp_save +# define setjmp_symbol __novmxsetjmp +# define _setjmp_symbol __novmx_setjmp +# define __sigsetjmp_symbol __novmx__sigsetjmp +# define __sigjmp_save_symbol __novmx__sigjmp_save # include "setjmp-common.S" strong_alias (__novmxsetjmp, __novmx__setjmp) # endif |