public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Shared libraries will not load when trying to debug a cross compiled executable in gdb
@ 2021-08-26 13:34 himanshu gaur
  0 siblings, 0 replies; only message in thread
From: himanshu gaur @ 2021-08-26 13:34 UTC (permalink / raw)
  To: gdb

Hello All,

Downloaded the core dump locally(core dump was generated by
systemd-coredump on the original target and then downloaded to a different
location) and using a local copy of GDB to debug, the shared libraries will
not load.

(gdb) bt
#0  0x0000007f83148560 in ?? ()

‘info shared’ gives the following output:

(gdb) info shared
No shared libraries loaded at this time.

However, when debugging on the original target with *'coredumpctl debug'*,
all shared libraries load without any issues. The 'info shared' output
there is

(gdb) info shared
From                To                  Syms Read   Shared Object Library
0x0000007f854cb070  0x0000007f854cd748  Yes (*)     /lib/libcap.so.2
0x0000007f85474fb0  0x0000007f854a20e8  Yes (*)     /usr/lib/libdbus-1.so.3
0x0000007f85439070  0x0000007f8544aff0  Yes (*)     /lib/libpthread.so.0
                                           and so on ……

*Things tried to manually load the shared libraries*

   1.

   Tried setting the *solib-search-path* to point to the shared libraries
   using *'set solib-search-path /usr/lib/foo.so'* and setting the
*solib-absolute-prefix
   to /usr/lib*. No acknowledgement was given that foo.so was loaded.
   2.

   Tried running *objdump* on the executable, got the list .so libraries,
   and tried to link them individually by setting the path. That did not load
   the libraries as well.
   3.

   Tried running '*sharedlibrary foo*' after '*set auto-solib-add off*'.
   Sharedlibrary foo was not loaded.
   4.

   Tried changing sysroot using the *'set sysroot'* command to point to a
   directory containing the shared libraries in lib/ and usr/lib
   subdirectories.

Since not able to load the shared libraries manually, the assumption is
that the mechanism that provides a way to identify what libraries to load
might be broken somehow. Has anyone seen similar before and what can be
done to ensure that the shared libraries load? Any help is appreciated.
Thanks!

-- 
Thanks & Regards,
Himanshu Gaur.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-26 13:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-26 13:34 Shared libraries will not load when trying to debug a cross compiled executable in gdb himanshu gaur

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).