This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
[ARM] dlopen and remote debugging
- From: "karthikeyan.s" <informkarthik at gmail dot com>
- To: gdb at sourceware dot org
- Date: Thu, 24 Jun 2010 23:42:06 +0530
- Subject: [ARM] dlopen and remote debugging
Hi,
We recently encountered an issue with gdb wherein it does not get the
symbols from a shared library when loaded with dlopen. The following
steps does not give us the shared library's symbols. The binary is
Xorg.
1)
<target> gdbserver :10000 /usr/bin/X -ac
<host gdb> set sysroot <targetfs_path>
<host gdb> target remote 10.0.0.3:10000
<host gdb> continue
<host> cntrl-C
We do not get the library's symbols here. But with cat
/proc/{x_pid}/maps we can see the library is loaded in memory.
2) But with the following steps, the libraries get loaded
<target> /usr/bin/X -ac &
<target> gdbserver :10000 --attach <X_pid>
<host gdb> set sysroot <targetfs_path>
<host gdb> target remote 10.0.0.3:10000
We can see the library's symbols and hit breakpoint, debug etc. etc.
Architecture - ARM cortex-a9
toolchain - codesourcery arm-none-linux-gnueabi
gdb version - 7.1.50 (almost the latest!)
The library built with -g2 -ggdb and is not stripped.
Any reason for the first method to not load the symbols? What part of
gdb code should I dig into for this?
Regards,
Karthik