summaryrefslogtreecommitdiff
path: root/libstdc++-v3/libsupc++
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/libsupc++')
-rw-r--r--libstdc++-v3/libsupc++/eh_catch.cc3
-rw-r--r--libstdc++-v3/libsupc++/eh_throw.cc9
-rw-r--r--libstdc++-v3/libsupc++/unwind-cxx.h13
3 files changed, 24 insertions, 1 deletions
diff --git a/libstdc++-v3/libsupc++/eh_catch.cc b/libstdc++-v3/libsupc++/eh_catch.cc
index 779f5a31058..43e875a95d2 100644
--- a/libstdc++-v3/libsupc++/eh_catch.cc
+++ b/libstdc++-v3/libsupc++/eh_catch.cc
@@ -80,6 +80,9 @@ __cxxabiv1::__cxa_begin_catch (void *exc_obj_in) _GLIBCXX_NOTHROW
}
objectp = __gxx_caught_object(exceptionObject);
+
+ PROBE2 (catch, objectp, header->exceptionType);
+
#ifdef __ARM_EABI_UNWINDER__
_Unwind_Complete(exceptionObject);
#endif
diff --git a/libstdc++-v3/libsupc++/eh_throw.cc b/libstdc++-v3/libsupc++/eh_throw.cc
index 297aa04df6e..a79a025af19 100644
--- a/libstdc++-v3/libsupc++/eh_throw.cc
+++ b/libstdc++-v3/libsupc++/eh_throw.cc
@@ -60,6 +60,8 @@ extern "C" void
__cxxabiv1::__cxa_throw (void *obj, std::type_info *tinfo,
void (_GLIBCXX_CDTOR_CALLABI *dest) (void *))
{
+ PROBE2 (throw, obj, tinfo);
+
// Definitely a primary.
__cxa_refcounted_exception *header
= __get_refcounted_exception_header_from_obj (obj);
@@ -97,7 +99,12 @@ __cxxabiv1::__cxa_rethrow ()
if (!__is_gxx_exception_class(header->unwindHeader.exception_class))
globals->caughtExceptions = 0;
else
- header->handlerCount = -header->handlerCount;
+ {
+ header->handlerCount = -header->handlerCount;
+ // Only notify probe for C++ exceptions.
+ PROBE2 (rethrow, __get_object_from_ambiguous_exception(header),
+ header->exceptionType);
+ }
#ifdef _GLIBCXX_SJLJ_EXCEPTIONS
_Unwind_SjLj_Resume_or_Rethrow (&header->unwindHeader);
diff --git a/libstdc++-v3/libsupc++/unwind-cxx.h b/libstdc++-v3/libsupc++/unwind-cxx.h
index e2b945d9969..ed4eea56655 100644
--- a/libstdc++-v3/libsupc++/unwind-cxx.h
+++ b/libstdc++-v3/libsupc++/unwind-cxx.h
@@ -37,6 +37,19 @@
#include <bits/atomic_word.h>
#include <cxxabi.h>
+#ifdef _GLIBCXX_HAVE_SYS_SDT_H
+#include <sys/sdt.h>
+/* We only want to use stap probes starting with v3. Earlier versions
+ added too much startup cost. */
+#if defined (STAP_PROBE2) && _SDT_NOTE_TYPE >= 3
+#define PROBE2(name, arg1, arg2) STAP_PROBE2 (libstdcxx, name, arg1, arg2)
+#endif
+#endif
+
+#ifndef PROBE2
+#define PROBE2(name, arg1, arg2)
+#endif
+
#pragma GCC visibility push(default)
namespace __cxxabiv1