aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2021-01-05 15:36:10 +0000
committerRoss Burton <ross.burton@arm.com>2021-01-08 13:55:40 +0000
commit60b3740789f724a11396a02eb30d0ace1e768147 (patch)
treeab4638d3831f46d1fce93a9e0c20f68385d338e3
parentad069f2d4610041f8c3cbd51cb7d4146c7e03d23 (diff)
downloadpseudo-ross/debug.tar.gz
pseudo-ross/debug.tar.bz2
pseudo-ross/debug.zip
XXX wrapper debugross/debug
Signed-off-by: Ross Burton <ross.burton@arm.com>
-rw-r--r--pseudo_wrappers.c3
-rw-r--r--templates/wrapfuncs.c1
2 files changed, 4 insertions, 0 deletions
diff --git a/pseudo_wrappers.c b/pseudo_wrappers.c
index 99aabff..cd661b3 100644
--- a/pseudo_wrappers.c
+++ b/pseudo_wrappers.c
@@ -125,6 +125,7 @@ pseudo_reinit_libpseudo(void) {
static void
pseudo_init_one_wrapper(pseudo_function *func) {
int (*f)(void) = (int (*)(void)) NULL;
+ Dl_info info;
if (*func->real != NULL) {
/* already initialized */
@@ -146,6 +147,8 @@ pseudo_init_one_wrapper(pseudo_function *func) {
* errors if a function is missing, and that printing output
* for these seems unhelpful. so we no longer do that.
*/
+ dladdr(f, &info);
+ pseudo_debug(PDBGF_WRAPPER, "dlsym(%s, %s) from %s\n", func->name, func->version, info.dli_fname);
}
void
diff --git a/templates/wrapfuncs.c b/templates/wrapfuncs.c
index 93bb671..7648da8 100644
--- a/templates/wrapfuncs.c
+++ b/templates/wrapfuncs.c
@@ -36,6 +36,7 @@ ${maybe_async_skip}
${variadic_start}
if (pseudo_disabled) {
+ pseudo_debug(PDBGF_SYSCALL, "pseudo disabled, ${name} calling real syscall.\n");
${rc_assign} (*real_${name})(${call_args});
${variadic_end}
PROFILE_DONE;