public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Shared libraries and separate debugging files
@ 2011-08-24 20:02 Worley, Dale R (Dale)
  2011-08-24 22:22 ` Baurzhan Ismagulov
  0 siblings, 1 reply; 5+ messages in thread
From: Worley, Dale R (Dale) @ 2011-08-24 20:02 UTC (permalink / raw)
  To: gdb

I'm having a devil of a time getting GDB to work properly.  Specifically, I can't get it
to find the separate debugging file for a shared library.

There is a command `set solib-absolute-prefix' that will tell GDB where to look for
shared libraries.  But a while back I looked carefully and could not find how to set where
the corresponding separate debugging files were searched for.  In particular, the
solib-absolute-prefix is applied *before* applying the rule "in a subdirectory whose
name is identical to the leading directories of the executable's absolute file name"
I managed to work around this with a deep nest of special-purpose directories and
symbolic links.

Has anyone out there gotten separate debugging files to work with shared libraries
in a clean way?

Searching again, I see the following text in the info file "Separate Debug Files":


   * For the "debug link" method, GDB looks up the named file in the
     directory of the executable file, then in a subdirectory of that
     directory named `.debug', and finally under the global debug
     directory, in a subdirectory whose name is identical to the leading
     directories of the executable's absolute file name.
[...]
   You can set the global debugging info directory's name, and view the
name GDB is currently using.


However, nothing further on the page tells how to get or set the "global debugging
info directory".  Is this idea related to the *list* of directories described for
"set debug-file-directory"?

Thanks for any help you can give me,

Dale

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Shared libraries and separate debugging files
  2011-08-24 20:02 Shared libraries and separate debugging files Worley, Dale R (Dale)
@ 2011-08-24 22:22 ` Baurzhan Ismagulov
  2011-08-25 20:12   ` Worley, Dale R (Dale)
  0 siblings, 1 reply; 5+ messages in thread
From: Baurzhan Ismagulov @ 2011-08-24 22:22 UTC (permalink / raw)
  To: gdb

On Wed, Aug 24, 2011 at 04:02:40PM -0400, Worley, Dale R (Dale) wrote:
> Has anyone out there gotten separate debugging files to work with shared libraries
> in a clean way?

Debian has it working OOTB. E.g., /lib/libc-2.11.2.so has its
corresponding /usr/lib/debug/lib/libc-2.11.2.so. FWIW, one can build a
hello, world and step into printf.

With kind regards,
Baurzhan.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Shared libraries and separate debugging files
  2011-08-24 22:22 ` Baurzhan Ismagulov
@ 2011-08-25 20:12   ` Worley, Dale R (Dale)
  2011-08-25 20:31     ` Jan Kratochvil
  0 siblings, 1 reply; 5+ messages in thread
From: Worley, Dale R (Dale) @ 2011-08-25 20:12 UTC (permalink / raw)
  To: Baurzhan Ismagulov, gdb

> From: Baurzhan Ismagulov [ibr@radix50.net]
> 
> Debian has it working OOTB. E.g., /lib/libc-2.11.2.so has its
> corresponding /usr/lib/debug/lib/libc-2.11.2.so. FWIW, one can build a
> hello, world and step into printf.

In the situation I am working within, the library files of the
execution host have been copied into a working directory of a
different host for analysis of the core file.  So /lib/libc-2.11.2.so
has been copied into /home/foo/crash1/lib/libc-2.11.2.so, and its
debug file is in /home/foo/crash1/usr/lib/debug/lib/libc-2.11.2.so.
But there does not appear to be a way to configure GDP to understand
the connection between the two files.

Dale

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Shared libraries and separate debugging files
  2011-08-25 20:12   ` Worley, Dale R (Dale)
@ 2011-08-25 20:31     ` Jan Kratochvil
  2011-08-26  3:40       ` Worley, Dale R (Dale)
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Kratochvil @ 2011-08-25 20:31 UTC (permalink / raw)
  To: Worley, Dale R (Dale); +Cc: Baurzhan Ismagulov, gdb

On Thu, 25 Aug 2011 21:20:32 +0200, Worley, Dale R (Dale) wrote:
> So /lib/libc-2.11.2.so
> has been copied into /home/foo/crash1/lib/libc-2.11.2.so, and its
> debug file is in /home/foo/crash1/usr/lib/debug/lib/libc-2.11.2.so.
> But there does not appear to be a way to configure GDP to understand
> the connection between the two files.

`set sysroot' and `set debug-file-directory' should be enough, I agree it is
not user friendly but I always used strace -o x gdb ... to easily see in `x'
where GDB tries to search for which library files.


Regards,
Jan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Shared libraries and separate debugging files
  2011-08-25 20:31     ` Jan Kratochvil
@ 2011-08-26  3:40       ` Worley, Dale R (Dale)
  0 siblings, 0 replies; 5+ messages in thread
From: Worley, Dale R (Dale) @ 2011-08-26  3:40 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: Baurzhan Ismagulov, gdb

> From: Jan Kratochvil [jan.kratochvil@redhat.com]
> 
> `set sysroot' and `set debug-file-directory' should be enough,

At this point, I can't remember whether "set debug-file-directory"
existed when I was trying to get this work, or whether I just
overlooked it.  In either case, the current documentation (in the info
file) is not good.  (At the least, some paragraphs refer to it as a
directory, others as a list of directories, and the adjective "global"
is present in some places and not others.)

What I really want is for the debug file location to be calculated
*before* the solib-absolute-prefix is applied to the shared library,
rather than after.  That would make things work very simply.

Dale

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-08-26  3:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-24 20:02 Shared libraries and separate debugging files Worley, Dale R (Dale)
2011-08-24 22:22 ` Baurzhan Ismagulov
2011-08-25 20:12   ` Worley, Dale R (Dale)
2011-08-25 20:31     ` Jan Kratochvil
2011-08-26  3:40       ` Worley, Dale R (Dale)

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).