Differences between revisions 8 and 9
Revision 8 as of 2014-03-31 13:21:14
Size: 368
Editor: 50
Comment:
Revision 9 as of 2014-03-31 19:03:25
Size: 3425
Editor: StanShebs
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
55 year-old Mining Engineer (Excluding Oil ) Monte Lanphere from La Canada Flintridge, enjoys mountain biking, internet marketing and wood working. Preceding year just completed a trip Historic Centre of Camagüey.<<BR>>
<<BR>>
Feel free to visit my homepage search engine optimization pricing ([[http://www.gayarkadaslik.com/ta68k|http://www.gayarkadaslik.com/]])
= Run-time linker interface =

As part of its basic operation GDB interfaces with the run-time linker to follow shared library events. glibc has two possible interfaces a debugger can use to do this: the ''standard interface'' (present on most System V systems) and the ''probes-based interface'' (specific to glibc as of October 2013). The probes-based interface is approximately an order of magnitude faster when debugging applications with large numbers of shared libraries (greater than 1000). Using the probes-based interface also fixes a long-standing bug ([[https://sourceware.org/bugzilla/show_bug.cgi?id=2328|PR gdb/2328]]). The two interfaces are described in the file {{{elf/rtld-debugger-interface.txt}}} in the glibc sources. There is a brief history of the standard interface at http://gbenson.net/?p=407.

GDB >= 7.5 will use the probes-based interface if it is available. This requires glibc >= 2.17 configured with {{{--enable-systemtap}}}, and GDB itself built with the SystemTap headers present. Use the following command to check whether your glibc contains the required probes:

{{{
gdb -nx /lib64/ld-linux-x86-64.so.2 -ex "info probes" -ex quit
}}}

GDB must list all these probes for incremental transfers to work:

{{{
Provider Name
rtld init_complete
rtld init_start
rtld map_complete
rtld map_start
rtld reloc_complete
rtld reloc_start
rtld unmap_complete
rtld unmap_start
}}}

There should also be a {{{map_failed}}} probe, but its presence is not required. Note that some versions of Fedora and RHEL contain probes called {{{rtld_init_complete}}}, {{{rtld_init_start}}}. This is an older version of the probes code that does not give the speed benefits of the newer code.

== Remote debugging ==

For remote debugging both GDB and the remote must support the newer interface. You can check if the remote supports the probes interface by entering {{{set debug remote 1}}} before the {{{target remote}}} command. If the remote sends {{{augmented-libraries-svr4-read+}}} in response to GDB's {{{qSupported}}} packet as shown below then the remote supports the probes interface.

{{{#!html
<pre>
(gdb) <b>set debug remote 1</b>
(gdb) <b>target remote :9999</b>
Remote debugging using :9999
Sending packet: <b>$qSupported</b>:multiprocess+;xmlRegisters=i386;qRelocInsn+#b5...Ack
Packet received: PacketSize=3fff;QPassSignals+;QProgramSignals+;qXfer:libraries-svr4:read+;<b>augmented-libraries-svr4-read+</b>;qXfer:auxv:read+;qXfer:spu:read+;qXfer:spu:write+;qXfer:siginfo:read+;qXfer:siginfo:write+;qXfer:features:read+;QStartNoAckMode+;qXfer:osdata:read+;multiprocess+;QNonStop+;QDisableRandomization+;qXfer:threads:read+;ConditionalTracepoints+;TraceStateVariables+;TracepointSource+;DisconnectedTracing+;FastTracepoints+;StaticTracepoints+;InstallInTrace+;qXfer:statictrace:read+;qXfer:traceframe-info:read+;EnableDisableTracepoints+;QTBuffer:size+;tracenz+;ConditionalBreakpoints+;BreakpointCommands+;QAgent+
...
</pre>
}}}

== Lack of dlmopen support ==

Neither the standard interface nor the probes interface can presently handle shared libraries loaded using {{{dlmopen}}}. There are bugs filed against GDB and glibc to track this. See [[https://sourceware.org/bugzilla/show_bug.cgi?id=11839|PR gdb/11839]] and [[https://sourceware.org/bugzilla/show_bug.cgi?id=15971|PR glibc/15971]].

Run-time linker interface

As part of its basic operation GDB interfaces with the run-time linker to follow shared library events. glibc has two possible interfaces a debugger can use to do this: the standard interface (present on most System V systems) and the probes-based interface (specific to glibc as of October 2013). The probes-based interface is approximately an order of magnitude faster when debugging applications with large numbers of shared libraries (greater than 1000). Using the probes-based interface also fixes a long-standing bug (PR gdb/2328). The two interfaces are described in the file elf/rtld-debugger-interface.txt in the glibc sources. There is a brief history of the standard interface at http://gbenson.net/?p=407.

GDB >= 7.5 will use the probes-based interface if it is available. This requires glibc >= 2.17 configured with --enable-systemtap, and GDB itself built with the SystemTap headers present. Use the following command to check whether your glibc contains the required probes:

gdb -nx /lib64/ld-linux-x86-64.so.2  -ex "info probes" -ex quit

GDB must list all these probes for incremental transfers to work:

Provider   Name
rtld       init_complete
rtld       init_start
rtld       map_complete
rtld       map_start
rtld       reloc_complete
rtld       reloc_start
rtld       unmap_complete
rtld       unmap_start

There should also be a map_failed probe, but its presence is not required. Note that some versions of Fedora and RHEL contain probes called rtld_init_complete, rtld_init_start. This is an older version of the probes code that does not give the speed benefits of the newer code.

Remote debugging

For remote debugging both GDB and the remote must support the newer interface. You can check if the remote supports the probes interface by entering set debug remote 1 before the target remote command. If the remote sends augmented-libraries-svr4-read+ in response to GDB's qSupported packet as shown below then the remote supports the probes interface.

(gdb) set debug remote 1
(gdb) target remote :9999
Remote debugging using :9999
Sending packet: $qSupported:multiprocess+;xmlRegisters=i386;qRelocInsn+#b5...Ack
Packet received: PacketSize=3fff;QPassSignals+;QProgramSignals+;qXfer:libraries-svr4:read+;augmented-libraries-svr4-read+;qXfer:auxv:read+;qXfer:spu:read+;qXfer:spu:write+;qXfer:siginfo:read+;qXfer:siginfo:write+;qXfer:features:read+;QStartNoAckMode+;qXfer:osdata:read+;multiprocess+;QNonStop+;QDisableRandomization+;qXfer:threads:read+;ConditionalTracepoints+;TraceStateVariables+;TracepointSource+;DisconnectedTracing+;FastTracepoints+;StaticTracepoints+;InstallInTrace+;qXfer:statictrace:read+;qXfer:traceframe-info:read+;EnableDisableTracepoints+;QTBuffer:size+;tracenz+;ConditionalBreakpoints+;BreakpointCommands+;QAgent+
...

Lack of dlmopen support

Neither the standard interface nor the probes interface can presently handle shared libraries loaded using dlmopen. There are bugs filed against GDB and glibc to track this. See PR gdb/11839 and PR glibc/15971.

None: LinkerInterface (last edited 2014-03-31 19:03:25 by StanShebs)

All content (C) 2008 Free Software Foundation. For terms of use, redistribution, and modification, please see the WikiLicense page.