public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* GDB and Shared Libraries
@ 2004-01-06 22:07 Drummonds, Scott B
  2004-01-06 22:10 ` Daniel Jacobowitz
  0 siblings, 1 reply; 19+ messages in thread
From: Drummonds, Scott B @ 2004-01-06 22:07 UTC (permalink / raw)
  To: gdb

Hi, everyone,

I'm noticing a discrepancy between the way that GDB handles shared
libraries and my Linux system does during execution.  Specifically, my
program works on the command line (well, except for the actual run-time
but that I'm trying to find) but aborts in GDB for lack of shared
libraries.  Specifically:

<quote>
(gdb) run <my_args>
Starting program: <my_binary> <my_args>
<my_binary>: error while loading shared libraries: libtcl8.0.so: cannot
open shared object file: No such file or directory

Program exited with code 0177.
</quote>

Can anyone tell me why this is happening?  This is an old version of GDB
(5.2-2) but I can't imagine that the problem here is anything other than
my incorrect or incomplete understanding of GDB.

Thanks,
Scott

^ permalink raw reply	[flat|nested] 19+ messages in thread
* gdb and shared libraries
@ 2006-02-08 21:13 Patrick Alken
  2006-02-09  5:54 ` Jim Blandy
  0 siblings, 1 reply; 19+ messages in thread
From: Patrick Alken @ 2006-02-08 21:13 UTC (permalink / raw)
  To: gdb

Hello,

  I am the developer of ald (http://ald.sourceforge.net), which
is a GNU licensed debugger designed specifically for assembly
level debugging.  Right now I am trying to solve the problem of
loading in the symbol tables of shared libraries for a target
program so that breakpoints can be set at addresses in these
libraries.

  Unfortunately it has not been easy to find information on
how to best do this, and after studying the gdb source code
for a while I decided it was best to ask this list for help.

  I am looking for a big picture with perhaps some useful
details for the more complicated steps. As an example,

1. fork + ptrace(TRACE_ME) + exec (child)
2. catch SIGTRAP (parent)
3. user types "run"
4. (start singlestepping/continuing/whatever until shared libraries
    have been loaded and ?somehow? get names of all libraries
    loaded by dynamic linker)
5. mmap() that list of libraries and then load their symbol tables
   into memory so breakpoints can be set there

So it is step #4 that I am hoping someone on the list can give me
details for. How do you know when all the libraries have been loaded
so that you can stop execution of the program while you load
the libs symbol tables? How do you get the pathnames of the libraries
after they have been loaded so you can mmap them?

Thank you in advance,
Patrick Alken

^ permalink raw reply	[flat|nested] 19+ messages in thread
* gdb and shared libraries
@ 2003-07-24 21:51 wim delvaux
  0 siblings, 0 replies; 19+ messages in thread
From: wim delvaux @ 2003-07-24 21:51 UTC (permalink / raw)
  To: gdb

Hi all,

I am running the 5.3.90-2003_06_29-cvs-debian version of gdb and STILL i have 
problems with breakpoints in shared libraries...

The problem is that you can set a breakpoint in a library but if you restart 
the program all breakpoints in that library are lost (i.e. gdb knows about 
them but seems to have disabled them).

Now I know that you are going to say that the library gets unloaded and hence 
the breakpoint cannot be set ... but it seems that gdb tries to set them 
because I get messages that It cannot set a shlib breakpoint.

Now I wonder if it is really that difficult to remember over gdb restarts that 
breakpoints were set for a certain library and once that library get reloaded 
set the breakpoints again.

1. without the messages that it cannot set them
2. without appearing to forget that the breakpoints were active ..

I say STILL because the problem has existed in all 5-versions I know of but 
did not exist in the last 4-version.

W

^ permalink raw reply	[flat|nested] 19+ messages in thread
[parent not found: <3A84136A.23BAF90F@home.com>]

end of thread, other threads:[~2006-02-09 13:51 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-06 22:07 GDB and Shared Libraries Drummonds, Scott B
2004-01-06 22:10 ` Daniel Jacobowitz
  -- strict thread matches above, loose matches on Subject: below --
2006-02-08 21:13 gdb and shared libraries Patrick Alken
2006-02-09  5:54 ` Jim Blandy
2006-02-09 13:51   ` Daniel Jacobowitz
2003-07-24 21:51 wim delvaux
     [not found] <3A84136A.23BAF90F@home.com>
     [not found] ` <1010209182220.ZM4621@localhost.localdomain>
     [not found]   ` <3A845A56.5EF8F61@home.com>
     [not found]     ` <3A9AB471.5F46554@home.com>
     [not found]       ` <1010226205415.ZM30678@localhost.localdomain>
2001-02-26 14:50         ` GDB and shared libraries (was Re: Are you still with Suse) Stephen Smith
2001-02-26 15:35           ` GDB and shared libraries Kevin Buettner
2001-02-26 16:07             ` Stephen Smith
2001-02-26 16:39             ` Stephen Smith
2001-02-26 18:05               ` Kevin Buettner
2001-02-26 20:51             ` Stephen Smith
     [not found]             ` <3A9B0022.16ABBBE0@home.com>
     [not found]               ` <1010227013252.ZM13444@ocotillo.lan>
2001-02-26 21:05                 ` Stephen Smith
2001-02-26 23:10                   ` Kevin Buettner
2001-02-27  7:37                     ` Stephen Smith
2001-02-27  8:14                   ` Andrew Cagney
2001-02-27 13:14                     ` Stephen Smith
2001-02-27 13:44                       ` Kevin Buettner
2001-02-27 14:04                         ` Stephen Smith
2001-03-21 15:59                     ` Stephen Smith

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