Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/ld.elf_so ld.elf_so: Sprinkle more debug messages on...



details:   https://anonhg.NetBSD.org/src/rev/0e5d1d5fc3f3
branches:  trunk
changeset: 376218:0e5d1d5fc3f3
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Jun 04 23:42:38 2023 +0000

description:
ld.elf_so: Sprinkle more debug messages on dlopen and error.

PR pkg/57445

diffstat:

 libexec/ld.elf_so/rtld.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (45 lines):

diff -r 3900a4a2f194 -r 0e5d1d5fc3f3 libexec/ld.elf_so/rtld.c
--- a/libexec/ld.elf_so/rtld.c  Sun Jun 04 22:57:18 2023 +0000
+++ b/libexec/ld.elf_so/rtld.c  Sun Jun 04 23:42:38 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtld.c,v 1.213 2023/04/23 11:53:00 riastradh Exp $      */
+/*     $NetBSD: rtld.c,v 1.214 2023/06/04 23:42:38 riastradh Exp $      */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: rtld.c,v 1.213 2023/04/23 11:53:00 riastradh Exp $");
+__RCSID("$NetBSD: rtld.c,v 1.214 2023/06/04 23:42:38 riastradh Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -1034,7 +1034,7 @@ dlopen(const char *name, int mode)
        sigset_t mask;
        int result;
 
-       dbg(("dlopen of %s %d", name, mode));
+       dbg(("dlopen of %s 0x%x", name, mode));
 
        _rtld_exclusive_enter(&mask);
 
@@ -1091,6 +1091,9 @@ dlopen(const char *name, int mode)
        _rtld_debug.r_state = RT_CONSISTENT;
        _rtld_debug_state();
 
+       dbg(("dlopen of %s 0x%x returned %p%s%s%s", name, mode, obj,
+           obj ? "" : " (", obj ? "" : error_message, obj ? "" : ")"));
+
        _rtld_exclusive_exit(&mask);
 
        return obj;
@@ -1565,6 +1568,7 @@ void
 
        va_start(ap, fmt);
        xvsnprintf(buf, sizeof buf, fmt, ap);
+       dbg(("%s: %s", __func__, buf));
        error_message = buf;
        va_end(ap);
 }



Home | Main Index | Thread Index | Old Index