unwind-dw2.c: Include sys/sdt.h if it exists.

* unwind-dw2.c: Include sys/sdt.h if it exists.
	(_Unwind_DebugHook): Use STAP_PROBE2.
	* config.in, configure: Rebuild.
	* configure.ac: Check for sys/sdt.h.

From-SVN: r170954
This commit is contained in:
Tom Tromey 2011-03-14 19:47:58 +00:00 committed by Tom Tromey
parent d34abfd271
commit f4e749b498
5 changed files with 44 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2011-01-14 Tom Tromey <tromey@redhat.com>
* unwind-dw2.c: Include sys/sdt.h if it exists.
(_Unwind_DebugHook): Use STAP_PROBE2.
* config.in, configure: Rebuild.
* configure.ac: Check for sys/sdt.h.
2011-03-14 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.md (ROUND_FLOOR): New constant.

View File

@ -1408,6 +1408,9 @@
#endif
/* Define if your target C library provides sys/sdt.h */
#undef HAVE_SYS_SDT_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#ifndef USED_FOR_TARGET
#undef HAVE_SYS_STAT_H

13
gcc/configure vendored
View File

@ -25792,6 +25792,19 @@ $as_echo "#define TARGET_LIBC_PROVIDES_SSP 1" >>confdefs.h
fi
# Test for <sys/sdt.h> on the target.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5
$as_echo_n "checking sys/sdt.h in the target C library... " >&6; }
have_sys_sdt_h=no
if test -f $target_header_dir/sys/sdt.h; then
$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5
$as_echo "$have_sys_sdt_h" >&6; }
# Check if TFmode long double should be used by default or not.
# Some glibc targets used DFmode long double, but with glibc 2.4
# and later they can use TFmode.

View File

@ -4381,6 +4381,16 @@ if test x$gcc_cv_libc_provides_ssp = xyes; then
[Define if your target C library provides stack protector support])
fi
# Test for <sys/sdt.h> on the target.
GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H])
AC_MSG_CHECKING(sys/sdt.h in the target C library)
have_sys_sdt_h=no
if test -f $target_header_dir/sys/sdt.h; then
AC_DEFINE(HAVE_SYS_SDT_H, 1,
[Define if your target C library provides sys/sdt.h])
fi
AC_MSG_RESULT($have_sys_sdt_h)
# Check if TFmode long double should be used by default or not.
# Some glibc targets used DFmode long double, but with glibc 2.4
# and later they can use TFmode.

View File

@ -1,6 +1,6 @@
/* DWARF2 exception handling and frame unwind runtime interface routines.
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
2008, 2009, 2010 Free Software Foundation, Inc.
2008, 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of GCC.
@ -37,6 +37,10 @@
#include "gthr.h"
#include "unwind-dw2.h"
#ifdef HAVE_SYS_SDT_H
#include <sys/sdt.h>
#endif
#ifndef __USING_SJLJ_EXCEPTIONS__
#ifndef STACK_GROWS_DOWNWARD
@ -1493,7 +1497,13 @@ static void
_Unwind_DebugHook (void *cfa __attribute__ ((__unused__)),
void *handler __attribute__ ((__unused__)))
{
/* We only want to use stap probes starting with v3. Earlier
versions added too much startup cost. */
#if defined (HAVE_SYS_SDT_H) && defined (STAP_PROBE2) && _SDT_NOTE_TYPE >= 3
STAP_PROBE2 (libgcc, unwind, cfa, handler);
#else
asm ("");
#endif
}
/* Install TARGET into CURRENT so that we can return to it. This is a