2022-04-14 22:16:19 +02:00
|
|
|
--- a/libmcount/wrap.c 2022-04-15 17:55:05.279817913 +0000
|
|
|
|
+++ b/libmcount/wrap.c 2022-04-15 19:45:32.879129081 +0000
|
|
|
|
@@ -227,7 +227,6 @@
|
2019-09-03 19:47:58 +02:00
|
|
|
/*
|
|
|
|
* 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);
|
2022-04-14 22:16:19 +02:00
|
|
|
@@ -252,7 +251,6 @@
|
2019-09-03 19:47:58 +02:00
|
|
|
|
|
|
|
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");
|
2022-04-14 22:16:19 +02:00
|
|
|
@@ -269,23 +267,7 @@
|
2019-09-03 19:47:58 +02:00
|
|
|
|
|
|
|
__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);
|
|
|
|
-
|
2022-04-14 22:16:19 +02:00
|
|
|
- pr_dbg("%s is called from [%d]\n", __func__, mtdp->idx);
|
2019-09-03 19:47:58 +02:00
|
|
|
- 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)
|
2022-04-14 22:16:19 +02:00
|
|
|
@@ -338,7 +320,8 @@
|
2019-08-28 14:06:58 +02:00
|
|
|
real_cxa_rethrow();
|
|
|
|
}
|
|
|
|
|
|
|
|
-__visible_default void _Unwind_Resume(void *exception)
|
|
|
|
+void __real__Unwind_Resume(void *exception);
|
|
|
|
+__visible_default void __wrap__Unwind_Resume(void *exception)
|
|
|
|
{
|
|
|
|
struct mcount_thread_data *mtdp;
|
|
|
|
|
2022-04-14 22:16:19 +02:00
|
|
|
@@ -360,7 +343,7 @@
|
2019-08-28 14:06:58 +02:00
|
|
|
mcount_rstack_restore(mtdp);
|
|
|
|
}
|
|
|
|
|
|
|
|
- real_unwind_resume(exception);
|
|
|
|
+ __real__Unwind_Resume(exception);
|
|
|
|
}
|
|
|
|
|
|
|
|
__visible_default void * __cxa_begin_catch(void *exception)
|