Can't step into shared library function

dao_at_snakebrook.com
Date: 01/31/05


Date: 31 Jan 2005 12:42:10 -0800

This is crazy. I have done thins so many times before, on Solaris and
I'm pretty sure linux as well.

I can't step into a function contained within my shared library. I have
broken out a simple example where the .so containes just a single
function: foo() and the main.c program contains main() which calls
foo() and exits. The program works as foo() prints out a message. I
can't, however, use gdb to step into the foo() form main(). Yes, the
source for foo.c is compiled with -g. Here's the comlete output from
make:

andromeda: /home/dao/tmp > make
cc -g -c main.c
cc -g -c foo.c
cc -shared -o libfoo.so foo.o
cc -o main main.o -L. -lfoo

The versions of the OS, gcc and gdb are

gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
GNU gdb 6.2
Linux andromeda 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386
GNU/Linux

This is red hat 9.

Attempting to step into foo() from main() results in essentially the
safe thing as 'next'. I am typing 'step' to make sure I am not hitting
some alias.
I'm just baffled by this.

Any help is appreciated.

Thanks, Jack



Relevant Pages

  • Re: Cant step into shared library function
    ... I have done thins so many times before, on Solaris and ... > I'm pretty sure linux as well. ... > foo() and exits. ... > can't, however, use gdb to step into the fooform main. ...
    (comp.os.linux.development.apps)
  • Re: Cant step into shared library function
    ... > I'm pretty sure linux as well. ... > foo() and exits. ... > can't, however, use gdb to step into the fooform main. ... I've recently been having problems with breaking inside of shared libraries. ...
    (comp.os.linux.development.apps)
  • Re: Cant step into shared library function
    ... I added -g to all compile and link lines, to no efect. ... GDB just won't allow me to step into the function contained in ... Breakpoint 1 at 0x8048444: file main.c, ...
    (comp.os.linux.development.apps)
  • Re: Cant step into shared library function
    ... > thread said that they were successful in stepping into foo(). ... it works for me with gdb with no ... adding the necessary header file, a declaration of fooand a return ... I guess it must be due to another strange RedHat thing. ...
    (comp.os.linux.development.apps)
  • 2.6.24.3: unexpected SIGTRAP in gdb
    ... I sometimes get an unexpected SIGTRAP ... p foo() ... The program being debugged was signaled while in a function called from GDB. ... Evaluation of the expression containing the function will be abandoned. ...
    (Linux-Kernel)