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:

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.

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:

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.

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.