public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Shared libaries and core files
@ 2011-11-04 18:02 Worley, Dale R (Dale)
  2011-11-04 18:38 ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Worley, Dale R (Dale) @ 2011-11-04 18:02 UTC (permalink / raw)
  To: gdb

I see that when I give GDB a core file, GDB loads many shared
libraries into its memory model of the process being debugged.  How
does GDB determine what these libraries are?  Does GDB know of
libraries that are loaded "dynamically" in the course of execution, or
only those that are loaded at process start time?

Naively, I would expect the dynamic loading routines in the process
would have to keep track of all the loaded libraries, and GDB could
extract from these data structures the complete list of libraries that
were loaded at the moment of the process failure.

Any information would be helpful,

Dale

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

* Re: Shared libaries and core files
  2011-11-04 18:02 Shared libaries and core files Worley, Dale R (Dale)
@ 2011-11-04 18:38 ` Pedro Alves
  2011-11-04 19:25   ` Worley, Dale R (Dale)
  0 siblings, 1 reply; 5+ messages in thread
From: Pedro Alves @ 2011-11-04 18:38 UTC (permalink / raw)
  To: gdb; +Cc: Worley, Dale R (Dale)

On Friday 04 November 2011 18:02:21, Worley, Dale R (Dale) wrote:
> I see that when I give GDB a core file, GDB loads many shared
> libraries into its memory model of the process being debugged.  How
> does GDB determine what these libraries are?  Does GDB know of
> libraries that are loaded "dynamically" in the course of execution, or
> only those that are loaded at process start time?

The former.

> Naively, I would expect the dynamic loading routines in the process
> would have to keep track of all the loaded libraries, and GDB could
> extract from these data structures the complete list of libraries that
> were loaded at the moment of the process failure.

Correct.

-- 
Pedro Alves

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

* RE: Shared libaries and core files
  2011-11-04 18:38 ` Pedro Alves
@ 2011-11-04 19:25   ` Worley, Dale R (Dale)
  2011-11-04 20:40     ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Worley, Dale R (Dale) @ 2011-11-04 19:25 UTC (permalink / raw)
  To: gdb

> From: Pedro Alves [pedro@codesourcery.com]
> 
> > Naively, I would expect the dynamic loading routines in the process
> > would have to keep track of all the loaded libraries, and GDB could
> > extract from these data structures the complete list of libraries that
> > were loaded at the moment of the process failure.
> 
> Correct.

That is good to learn.  Is there any simple way, given a core file, to
extract an explicit list of loaded libraries?

Dale

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

* Re: Shared libaries and core files
  2011-11-04 19:25   ` Worley, Dale R (Dale)
@ 2011-11-04 20:40     ` Pedro Alves
  2011-11-04 20:54       ` Worley, Dale R (Dale)
  0 siblings, 1 reply; 5+ messages in thread
From: Pedro Alves @ 2011-11-04 20:40 UTC (permalink / raw)
  To: gdb; +Cc: Worley, Dale R (Dale)

On Friday 04 November 2011 19:23:34, Worley, Dale R (Dale) wrote:

> Is there any simple way, given a core file, to extract an
> explicit list of loaded libraries?

What's "explicit"?

$ gdb /path/to/program -c /path/to/core
(gdb) info sharedlibrary

Or were you thinking of something else?

-- 
Pedro Alves

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

* RE: Shared libaries and core files
  2011-11-04 20:40     ` Pedro Alves
@ 2011-11-04 20:54       ` Worley, Dale R (Dale)
  0 siblings, 0 replies; 5+ messages in thread
From: Worley, Dale R (Dale) @ 2011-11-04 20:54 UTC (permalink / raw)
  To: Pedro Alves, gdb

i> From: Pedro Alves [pedro@codesourcery.com]
> 
> $ gdb /path/to/program -c /path/to/core
> (gdb) info sharedlibrary
> 
> Or were you thinking of something else?

I wasn't aware of "info sharedlibrary".

What I want is something that can be done from the command line.  It
looks like

gdb [executable] -c [core] -silent -ex 'info sharedlibrary' -ex quit

will suffice.  The output from that can be postprocessed to make a
list of the libraries.

Thanks!

Dale

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

end of thread, other threads:[~2011-11-04 20:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-04 18:02 Shared libaries and core files Worley, Dale R (Dale)
2011-11-04 18:38 ` Pedro Alves
2011-11-04 19:25   ` Worley, Dale R (Dale)
2011-11-04 20:40     ` Pedro Alves
2011-11-04 20:54       ` 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).