From: rcombs <rcombs@rcombs.me>
To: musl@lists.openwall.com
Subject: [musl] [PATCH] ldso: notify the debugger when we're doing a dlopen
Date: Sat, 24 Oct 2020 14:31:14 -0500 [thread overview]
Message-ID: <20201024193114.16454-1-rcombs@rcombs.me> (raw)
Otherwise lldb doesn't notice the new library and stack traces containing it
get cut off unhelpfully.
---
ldso/dynlink.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/ldso/dynlink.c b/ldso/dynlink.c
index fcc8f6a6..7df92892 100644
--- a/ldso/dynlink.c
+++ b/ldso/dynlink.c
@@ -1963,7 +1963,7 @@ void __dls3(size_t *sp, size_t *auxv)
debug.bp = dl_debug_state;
debug.head = head;
debug.base = ldso.base;
- debug.state = 0;
+ debug.state = RT_CONSISTENT;
_dl_debug_state();
if (replace_argv0) argv[0] = replace_argv0;
@@ -2012,6 +2012,9 @@ void *dlopen(const char *file, int mode)
pthread_rwlock_wrlock(&lock);
__inhibit_ptc();
+ debug.state = RT_ADD;
+ _dl_debug_state();
+
p = 0;
if (shutting_down) {
error("Cannot dlopen while program is exiting.");
@@ -2104,9 +2107,10 @@ void *dlopen(const char *file, int mode)
update_tls_size();
if (tls_cnt != orig_tls_cnt)
install_new_tls();
- _dl_debug_state();
orig_tail = tail;
end:
+ debug.state = RT_CONSISTENT;
+ _dl_debug_state();
__release_ptc();
if (p) gencnt++;
pthread_rwlock_unlock(&lock);
--
2.17.1
next reply other threads:[~2020-10-24 19:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-24 19:31 rcombs [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-10-24 5:31 rcombs
2020-10-24 15:41 ` Rich Felker
2020-10-24 19:28 ` Ridley Combs
2020-10-24 19:39 ` Rich Felker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201024193114.16454-1-rcombs@rcombs.me \
--to=rcombs@rcombs.me \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).