|
@ -1,5 +1,47 @@ |
|
|
+++ ./libmcount/wrap.c 2019-08-26 04:38:48.830364663 +0300
|
|
|
diff -uNr uftrace-0.9.3/libmcount/wrap.c uftrace-0.9.3.mod/libmcount/wrap.c
|
|
|
@@ -324,7 +324,8 @@
|
|
|
--- uftrace-0.9.3/libmcount/wrap.c 2019-07-13 17:25:47.000000000 +0300
|
|
|
|
|
|
+++ uftrace-0.9.3.mod/libmcount/wrap.c 2019-09-03 20:46:52.430226391 +0300
|
|
|
|
|
|
@@ -216,7 +216,6 @@
|
|
|
|
|
|
/* |
|
|
|
|
|
* hooking functions |
|
|
|
|
|
*/ |
|
|
|
|
|
-static int (*real_backtrace)(void **buffer, int sz);
|
|
|
|
|
|
static void (*real_cxa_throw)(void *exc, void *type, void *dest); |
|
|
|
|
|
static void (*real_cxa_rethrow)(void); |
|
|
|
|
|
static void * (*real_cxa_begin_catch)(void *exc); |
|
|
|
|
|
@@ -241,7 +240,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
void mcount_hook_functions(void) |
|
|
|
|
|
{ |
|
|
|
|
|
- real_backtrace = dlsym(RTLD_NEXT, "backtrace");
|
|
|
|
|
|
real_cxa_throw = dlsym(RTLD_NEXT, "__cxa_throw"); |
|
|
|
|
|
real_cxa_rethrow = dlsym(RTLD_NEXT, "__cxa_rethrow"); |
|
|
|
|
|
real_cxa_begin_catch = dlsym(RTLD_NEXT, "__cxa_begin_catch"); |
|
|
|
|
|
@@ -258,22 +256,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
__visible_default int backtrace(void **buffer, int sz) |
|
|
|
|
|
{ |
|
|
|
|
|
- int ret;
|
|
|
|
|
|
- struct mcount_thread_data *mtdp;
|
|
|
|
|
|
-
|
|
|
|
|
|
- if (unlikely(real_backtrace == NULL))
|
|
|
|
|
|
- mcount_hook_functions();
|
|
|
|
|
|
-
|
|
|
|
|
|
- mtdp = get_thread_data();
|
|
|
|
|
|
- if (!check_thread_data(mtdp))
|
|
|
|
|
|
- mcount_rstack_restore(mtdp);
|
|
|
|
|
|
-
|
|
|
|
|
|
- ret = real_backtrace(buffer, sz);
|
|
|
|
|
|
-
|
|
|
|
|
|
- if (!check_thread_data(mtdp))
|
|
|
|
|
|
- mcount_rstack_reset(mtdp);
|
|
|
|
|
|
-
|
|
|
|
|
|
- return ret;
|
|
|
|
|
|
+ return 0;
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
__visible_default void __cxa_throw(void *exception, void *type, void *dest) |
|
|
|
|
|
@@ -324,7 +307,8 @@
|
|
|
real_cxa_rethrow(); |
|
|
real_cxa_rethrow(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -9,7 +51,7 @@ |
|
|
{ |
|
|
{ |
|
|
struct mcount_thread_data *mtdp; |
|
|
struct mcount_thread_data *mtdp; |
|
|
|
|
|
|
|
|
@@ -345,7 +346,7 @@
|
|
|
@@ -345,7 +329,7 @@
|
|
|
mcount_rstack_restore(mtdp); |
|
|
mcount_rstack_restore(mtdp); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|