dtrace.patch   [plain text]


Doing diffs in libstdc++-v3:
--- libstdc++-v3/config/os/bsd/darwin/dtrace_cxa_runtime.d.~1~	2009-01-09 12:12:36.000000000 -0800
+++ libstdc++-v3/config/os/bsd/darwin/dtrace_cxa_runtime.d	2009-01-09 13:24:25.000000000 -0800
@@ -0,0 +1,7 @@
+/* build with: dtrace -C -h -s dtrace_cxa_runtime.d -o dtrace_cxa_runtime.h */
+
+provider cxa_runtime
+{
+    probe cxa_exception_throw(void *obj);
+    probe cxa_exception_rethrow();
+};
--- libstdc++-v3/config/os/bsd/darwin/os_defines.h.~1~	2008-12-13 12:42:50.000000000 -0800
+++ libstdc++-v3/config/os/bsd/darwin/os_defines.h	2009-01-09 13:17:57.000000000 -0800
@@ -48,6 +48,56 @@
 #define _GLIBCXX_VISIBILITY_DEFAULT /* _GLIBCXX_VISIBILITY(default) */
 #endif
 
+/* APPLE LOCAL begin dtrace 6144676 */
+/* Enable dtrace probes.  */
+/* Inline copy of dtrace_cxa_runtime.h. */
+/*
+ * Generated by dtrace(1M).
+ */
+
+#ifndef	_DTRACE_CXA_RUNTIME_H
+#define	_DTRACE_CXA_RUNTIME_H
+
+#include <unistd.h>
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+#define CXA_RUNTIME_STABILITY "___dtrace_stability$cxa_runtime$v1$1_1_0_1_1_0_1_1_0_1_1_0_1_1_0"
+
+#define CXA_RUNTIME_TYPEDEFS "___dtrace_typedefs$cxa_runtime$v2"
+
+#define	CXA_RUNTIME_CXA_EXCEPTION_RETHROW() \
+do { \
+	__asm__ volatile(".reference " CXA_RUNTIME_TYPEDEFS); \
+	__dtrace_probe$cxa_runtime$cxa_exception_rethrow$v1(); \
+	__asm__ volatile(".reference " CXA_RUNTIME_STABILITY); \
+} while (0)
+#define	CXA_RUNTIME_CXA_EXCEPTION_RETHROW_ENABLED() \
+	__dtrace_isenabled$cxa_runtime$cxa_exception_rethrow$v1()
+#define	CXA_RUNTIME_CXA_EXCEPTION_THROW(arg0) \
+do { \
+	__asm__ volatile(".reference " CXA_RUNTIME_TYPEDEFS); \
+	__dtrace_probe$cxa_runtime$cxa_exception_throw$v1$766f6964202a(arg0); \
+	__asm__ volatile(".reference " CXA_RUNTIME_STABILITY); \
+} while (0)
+#define	CXA_RUNTIME_CXA_EXCEPTION_THROW_ENABLED() \
+	__dtrace_isenabled$cxa_runtime$cxa_exception_throw$v1()
+
+
+extern void __dtrace_probe$cxa_runtime$cxa_exception_rethrow$v1(void);
+extern int __dtrace_isenabled$cxa_runtime$cxa_exception_rethrow$v1(void);
+extern void __dtrace_probe$cxa_runtime$cxa_exception_throw$v1$766f6964202a(void *);
+extern int __dtrace_isenabled$cxa_runtime$cxa_exception_throw$v1(void);
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif	/* _DTRACE_CXA_RUNTIME_H */
+/* APPLE LOCAL end dtrace 6144676 */
+
 /* APPLE LOCAL begin version */
 
 #ifndef __GNUC_LIBSTD__
--- libstdc++-v3/libsupc++/eh_throw.cc.~1~	2005-11-21 16:19:07.000000000 -0800
+++ libstdc++-v3/libsupc++/eh_throw.cc	2009-01-09 13:18:48.000000000 -0800
@@ -65,6 +65,10 @@ __cxxabiv1::__cxa_throw (void *obj, std:
   __GXX_INIT_EXCEPTION_CLASS(header->unwindHeader.exception_class);
   header->unwindHeader.exception_cleanup = __gxx_exception_cleanup;
 
+#ifdef CXA_RUNTIME_CXA_EXCEPTION_THROW
+  CXA_RUNTIME_CXA_EXCEPTION_THROW(obj);
+#endif
+
 #ifdef _GLIBCXX_SJLJ_EXCEPTIONS
   _Unwind_SjLj_RaiseException (&header->unwindHeader);
 #else
@@ -93,6 +97,10 @@ __cxxabiv1::__cxa_rethrow ()
       else
 	header->handlerCount = -header->handlerCount;
 
+#ifdef CXA_RUNTIME_CXA_EXCEPTION_RETHROW
+      CXA_RUNTIME_CXA_EXCEPTION_RETHROW();
+#endif
+
 #ifdef _GLIBCXX_SJLJ_EXCEPTIONS
       _Unwind_SjLj_Resume_or_Rethrow (&header->unwindHeader);
 #else
--------------