-
Notifications
You must be signed in to change notification settings - Fork 584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement gdb query "qGetTLSAddr" #146
Comments
Tentatively setting for 1.1 because it's a likely annoyance for devs. Though the valgrind example is encouraging (though may no longer be true). |
Took a more serious look at doing this. The first thing we'd need to do is implement the thread_db interface for the debug server. This would be a lot of work. http://timetobleed.com/notes-about-an-odd-esoteric-yet-incredibly-useful-library-libthread_db/ The next step would be to call the right thread_db interface to get the TLS addr per the gdb query. From my reading of the gdb source code, the one we want is This is too much work for a 1.1. The workaround for users is to save the TLS addr they're interested in into a local, and then read the local in gdb. (Indeed, I've used this workaround in rr's preload load several times.) |
Also, part of the interface that thread_db wants is writing process memory. I don't know what the writes are required for, but if we can't use thread_db without it writing to tracee memory, then we're hosed. (Or the project becomes extremely difficult.) |
FWIW I'm debugging an implementation of this. |
Excellent! |
I have it working, but I'm having some trouble getting the test suite to work properly. I'll ask on irc tomorrow or so. There's one issue I want to raise as well. This work relies on the On my current branch I've just copied this header into the rr source tree. This is what gdb does as well (with extra hacks, haha.) But, maybe that's not really what you want, considering that the file has the LGPL on it. Another option might be to duplicate the needed stuff. There are a few function types and an enum. |
What does it mean to honor the LGPL for this file, if (say) someone wanted to ship rr without honoring the LGPL terms for all of rr? |
If we're just using this file as the interface to a dynamically linked glibc library, that we're not shipping, then they wouldn't have to do anything to comply with the LGPL? Except they'd have to make available the source for that one file, I suppose. |
Fixes rr-debugger#146. This adds support for the qGetTLSAddr and qSymbol packets from gdb, which lets gdb access TLS in a replay.
It seems like a reasonable interpretation to me. |
Fixes rr-debugger#146. This adds support for the qGetTLSAddr and qSymbol packets from gdb, which lets gdb access TLS in a replay.
Fixes rr-debugger#146. This adds support for the qGetTLSAddr and qSymbol packets from gdb, which lets gdb access TLS in a replay.
Fixes rr-debugger#146. This adds support for the qGetTLSAddr and qSymbol packets from gdb, which lets gdb access TLS in a replay.
Fixes rr-debugger#146. This adds support for the qGetTLSAddr and qSymbol packets from gdb, which lets gdb access TLS in a replay.
I'm debugging an issue right now where that query is needed to resolve a symbol. (Why, I dunno, since the symbol isn't TLS, but oh well.) Unfortunately this looks quite tricky to implement. It appears that valgrind punted it.
The text was updated successfully, but these errors were encountered: