mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-21 01:12:26 +08:00
Add systemtap static probe points in setjmp/longjmp on x86.
This commit is contained in:
parent
3a097cc7a1
commit
8422c9a560
@ -1,5 +1,14 @@
|
||||
2012-05-25 Roland McGrath <roland@hack.frob.com>
|
||||
|
||||
* sysdeps/x86_64/__longjmp.S: Add a static probe here.
|
||||
* sysdeps/x86_64/setjmp.S: Likewise.
|
||||
* sysdeps/i386/bsd-setjmp.S: Likewise.
|
||||
* sysdeps/i386/bsd-_setjmp.S: Likewise.
|
||||
* sysdeps/i386/setjmp.S: Likewise.
|
||||
* sysdeps/i386/__longjmp.S: Likewise.
|
||||
* sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S: Likewise.
|
||||
* sysdeps/unix/sysv/linux/i386/____longjmp_chk.S: Likewise.
|
||||
|
||||
* include/stap-probe.h: New file.
|
||||
* configure.in: Handle --enable-systemtap.
|
||||
* configure: Regenerated.
|
||||
|
@ -1,6 +1,5 @@
|
||||
/* longjmp for i386.
|
||||
Copyright (C) 1995-1998,2000,2002,2005,2006,2009
|
||||
Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2012 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -20,6 +19,7 @@
|
||||
#include <sysdep.h>
|
||||
#include <jmpbuf-offsets.h>
|
||||
#include <asm-syntax.h>
|
||||
#include <stap-probe.h>
|
||||
|
||||
.text
|
||||
ENTRY (__longjmp)
|
||||
@ -32,6 +32,7 @@ ENTRY (__longjmp)
|
||||
movl (JB_SP*4)(%eax), %ecx
|
||||
PTR_DEMANGLE (%edx)
|
||||
PTR_DEMANGLE (%ecx)
|
||||
LIBC_PROBE (longjmp, 3, 4@%eax, -4@8(%esp), 4@%edx)
|
||||
cfi_def_cfa(%eax, 0)
|
||||
cfi_register(%eip, %edx)
|
||||
cfi_register(%esp, %ecx)
|
||||
@ -49,6 +50,7 @@ ENTRY (__longjmp)
|
||||
cfi_restore(%edi)
|
||||
cfi_restore(%ebp)
|
||||
|
||||
LIBC_PROBE (longjmp_target, 3, 4@%eax, -4@8(%esp), 4@%edx)
|
||||
movl 8(%esp), %eax /* Second argument is return value. */
|
||||
movl %ecx, %esp
|
||||
#else
|
||||
@ -56,12 +58,14 @@ ENTRY (__longjmp)
|
||||
movl 8(%esp), %eax /* Second argument is return value. */
|
||||
/* Save the return address now. */
|
||||
movl (JB_PC*4)(%ecx), %edx
|
||||
LIBC_PROBE (longjmp, 3, 4@%ecx, -4@%eax, 4@%edx)
|
||||
/* Restore registers. */
|
||||
movl (JB_BX*4)(%ecx), %ebx
|
||||
movl (JB_SI*4)(%ecx), %esi
|
||||
movl (JB_DI*4)(%ecx), %edi
|
||||
movl (JB_BP*4)(%ecx), %ebp
|
||||
movl (JB_SP*4)(%ecx), %esp
|
||||
LIBC_PROBE (longjmp_target, 3, 4@%ecx, -4@%ecx, 4@%edx)
|
||||
#endif
|
||||
/* Jump to saved PC. */
|
||||
jmp *%edx
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. i386 version.
|
||||
Copyright (C) 1994-1997,2000-2002,2005, 2006 Free Software Foundation, Inc.
|
||||
Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -24,6 +24,7 @@
|
||||
#include <jmpbuf-offsets.h>
|
||||
#include "bp-sym.h"
|
||||
#include "bp-asm.h"
|
||||
#include <stap-probe.h>
|
||||
|
||||
#define PARMS LINKAGE /* no space for saved regs */
|
||||
#define JMPBUF PARMS
|
||||
@ -46,6 +47,7 @@ ENTRY (BP_SYM (_setjmp))
|
||||
#endif
|
||||
movl %ecx, (JB_SP*4)(%edx)
|
||||
movl PCOFF(%esp), %ecx /* Save PC we are returning to now. */
|
||||
LIBC_PROBE (setjmp, 3, 4@%edx, -4@$0, 4@%ecx)
|
||||
#ifdef PTR_MANGLE
|
||||
PTR_MANGLE (%ecx)
|
||||
#endif
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. i386 version.
|
||||
Copyright (C) 1994-1997,2000,2001,2005, 2006 Free Software Foundation, Inc.
|
||||
Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -24,6 +24,7 @@
|
||||
#include <jmpbuf-offsets.h>
|
||||
#include "bp-sym.h"
|
||||
#include "bp-asm.h"
|
||||
#include <stap-probe.h>
|
||||
|
||||
#define PARMS LINKAGE /* no space for saved regs */
|
||||
#define JMPBUF PARMS
|
||||
@ -48,6 +49,7 @@ ENTRY (BP_SYM (setjmp))
|
||||
#endif
|
||||
movl %ecx, (JB_SP*4)(%eax)
|
||||
movl PCOFF(%esp), %ecx /* Save PC we are returning to now. */
|
||||
LIBC_PROBE (setjmp, 3, 4@%eax, -4@$1, 4@%ecx)
|
||||
#ifdef PTR_MANGLE
|
||||
PTR_MANGLE (%ecx)
|
||||
#endif
|
||||
|
@ -1,6 +1,5 @@
|
||||
/* setjmp for i386.
|
||||
Copyright (C) 1995,1996,1997,2000,2001,2005,2006
|
||||
Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2012 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -22,6 +21,7 @@
|
||||
#include <asm-syntax.h>
|
||||
#include "bp-sym.h"
|
||||
#include "bp-asm.h"
|
||||
#include <stap-probe.h>
|
||||
|
||||
#define PARMS LINKAGE /* no space for saved regs */
|
||||
#define JMPBUF PARMS
|
||||
@ -43,6 +43,7 @@ ENTRY (BP_SYM (__sigsetjmp))
|
||||
#endif
|
||||
movl %ecx, (JB_SP*4)(%eax)
|
||||
movl PCOFF(%esp), %ecx /* Save PC we are returning to now. */
|
||||
LIBC_PROBE (setjmp, 3, 4@%eax, -4@SIGMSK(%esp), 4@%ecx)
|
||||
#ifdef PTR_MANGLE
|
||||
PTR_MANGLE (%ecx)
|
||||
#endif
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2001,2004,2005,2006,2009 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2001-2012 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -18,6 +18,7 @@
|
||||
#include <sysdep.h>
|
||||
#include <jmpbuf-offsets.h>
|
||||
#include <asm-syntax.h>
|
||||
#include <stap-probe.h>
|
||||
|
||||
|
||||
.section .rodata.str1.1,"aMS",@progbits,1
|
||||
@ -78,7 +79,9 @@ ENTRY (____longjmp_chk)
|
||||
cfi_adjust_cfa_offset(-12)
|
||||
movl 4(%esp), %ecx
|
||||
|
||||
.Lok: /* We add unwind information for the target here. */
|
||||
.Lok:
|
||||
LIBC_PROBE (longjmp, 3, 4@%ecx, -4@8(%esp), 4@%edx)
|
||||
/* We add unwind information for the target here. */
|
||||
cfi_def_cfa(%ecx, 0)
|
||||
cfi_register(%eip, %edx)
|
||||
cfi_register(%esp, %edi)
|
||||
@ -101,5 +104,6 @@ ENTRY (____longjmp_chk)
|
||||
cfi_restore(%ebp)
|
||||
|
||||
/* Jump to saved PC. */
|
||||
LIBC_PROBE (longjmp_target, 3, 4@%ecx, -4@%eax, 4@%edx)
|
||||
jmp *%edx
|
||||
END (____longjmp_chk)
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <sysdep.h>
|
||||
#include <jmpbuf-offsets.h>
|
||||
#include <asm-syntax.h>
|
||||
#include <stap-probe.h>
|
||||
|
||||
#include <sigaltstack-offsets.h>
|
||||
|
||||
@ -103,7 +104,9 @@ ENTRY(____longjmp_chk)
|
||||
movl %ebx, %esi
|
||||
cfi_restore (%rsi)
|
||||
|
||||
.Lok: /* We add unwind information for the target here. */
|
||||
.Lok:
|
||||
LIBC_PROBE (longjmp, 3, LP_SIZE@%RDI_LP, -4@%esi, LP_SIZE@%RDX_LP)
|
||||
/* We add unwind information for the target here. */
|
||||
cfi_def_cfa(%rdi, 0)
|
||||
cfi_register(%rsp,%r8)
|
||||
cfi_register(%rbp,%r9)
|
||||
@ -122,5 +125,7 @@ ENTRY(____longjmp_chk)
|
||||
movl %esi, %eax
|
||||
mov %R8_LP, %RSP_LP
|
||||
movq %r9,%rbp
|
||||
LIBC_PROBE (longjmp_target, 3,
|
||||
LP_SIZE@%RDI_LP, -4@%eax, LP_SIZE@%RDX_LP)
|
||||
jmpq *%rdx
|
||||
END (____longjmp_chk)
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <sysdep.h>
|
||||
#include <jmpbuf-offsets.h>
|
||||
#include <asm-syntax.h>
|
||||
#include <stap-probe.h>
|
||||
|
||||
/* Jump to the position specified by ENV, causing the
|
||||
setjmp call there to return VAL, or 1 if VAL is 0.
|
||||
@ -41,6 +42,7 @@ ENTRY(__longjmp)
|
||||
orq %rax, %r9
|
||||
# endif
|
||||
#endif
|
||||
LIBC_PROBE (longjmp, 3, LP_SIZE@%RDI_LP, -4@%esi, LP_SIZE@%RDX_LP)
|
||||
/* We add unwind information for the target here. */
|
||||
cfi_def_cfa(%rdi, 0)
|
||||
cfi_register(%rsp,%r8)
|
||||
@ -60,5 +62,7 @@ ENTRY(__longjmp)
|
||||
mov %esi, %eax
|
||||
mov %R8_LP,%RSP_LP
|
||||
movq %r9,%rbp
|
||||
LIBC_PROBE (longjmp_target, 3,
|
||||
LP_SIZE@%RDI_LP, -4@%eax, LP_SIZE@%RDX_LP)
|
||||
jmpq *%rdx
|
||||
END (__longjmp)
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include <sysdep.h>
|
||||
#include <jmpbuf-offsets.h>
|
||||
#include <asm-syntax.h>
|
||||
#include <stap-probe.h>
|
||||
|
||||
ENTRY (__sigsetjmp)
|
||||
/* Save registers. */
|
||||
@ -47,6 +48,7 @@ ENTRY (__sigsetjmp)
|
||||
#endif
|
||||
movq %rdx, (JB_RSP*8)(%rdi)
|
||||
mov (%rsp), %RAX_LP /* Save PC we are returning to now. */
|
||||
LIBC_PROBE (setjmp, 3, LP_SIZE@%RDI_LP, -4@%esi, LP_SIZE@%RAX_LP)
|
||||
#ifdef PTR_MANGLE
|
||||
PTR_MANGLE (%RAX_LP)
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user