This is the mail archive of the archer@sourceware.org mailing list for the Archer project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdb side of improved linker-debugger interface


Hi all,

A week or so ago I mailed this list a description of a new linker-
debugger interface based on SystemTap probes, along with a patch
containing the glibc side:

  http://www.cygwin.com/ml/archer/2011-q2/msg00000.html

In the meantime I've been working on the gdb side of this, which is
available in the archer-gbenson-stap-rtld branch.  I've also attached
a patch (which applies to archer-sergiodj-stap-patch-split) in case
you just want to have a look.

The deal is basically that gdb would normally set one solib event
breakpoint, on _dl_debug_state.  This patch makes it look for the two
SystemTap probes described in my previous mail, and if it finds them,
set a pair of breakpoints on those instead.  When stop-on-solib-events
is set, gdb will stop on both breakpoints, mimicing the old behaviour.
When stop-on-solib-events is not set, gdb will only stop on the post-
modification breakpoint.  This allows solib mapping and unmapping to
be tracked as before while almost halving the time taken (I did some
basic tests, eg loading 1000 simple libraries took 14s as opposed to
26s).  This helps https://bugzilla.redhat.com/show_bug.cgi?id=698001.
The post-modification breakpoint is called later than previously, to
match where Solaris libc calls _dl_debug_state, which addresses
https://bugzilla.redhat.com/show_bug.cgi?id=658851.

I've not implemented anything to do with dlmopen, but the information
required for gdb to discover the libraries' namespaces can be obtained
from the SystemTap probes.  I've also not done anything special about
STT_GNU_IFUNC functions, since if one of these is causing problems you
could simply set gdb to break on its relocator without needing any
special support in stop-on-solib-events.

I've seen mention that the RT_CONSISTENT called too early bug was the
cause of another issue where libthread_db would not be loaded if
libpthread was loaded with dlopen rather than being linked in, but I
haven't been able to discover if this really was ever the case.  If
anybody knows (or has a testcase) could you fill me in on it please.

I'm still waiting for a reply to my mail about in-process debuggers,
so I haven't changed anything on that regard yet.

Cheers,
Gary

-- 
http://gbenson.net/

Attachment: patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]