gdb steps into glibc functions

Daniel Jacobowitz drow@mvista.com
Tue Oct 21 12:52:00 GMT 2003


On Tue, Oct 21, 2003 at 12:48:01PM +0200, Marc Gonzalez-Sigler wrote:
> Hi all,
> 
> I have the following system:
> 
> $ uname -a
> Linux ikaria 2.4.16 #1 Wed Jan 9 15:04:38 CET 2002 i686 unknown
> 
> $ gdb -v
> GNU gdb 5.0rh-5 Red Hat Linux 7.1
> Copyright 2001 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and 
> you are
> welcome to change it and/or distribute copies of it under certain 
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for 
> details.
> This GDB was configured as "i386-redhat-linux".
> 
> When I use the step command in gdb, it seems that gdb tries to step 
> into glibc functions.
> 
> 
> 325         a2b = (strcmp (progname, "ir_a2b") == 0);
> (gdb) step
> strcmp (p1=0xbfffface "ir_b2a", p2=0x80ed99f "ir_a2b") at 
> ../sysdeps/generic/strcmp.c:33
> 33      ../sysdeps/generic/strcmp.c: No such file or directory.
>         in ../sysdeps/generic/strcmp.c
> Current language:  auto; currently c
> 
> 
> This does not happen on my home computer: even when I use the step 
> command, gdb steps over glibc calls.
> 
> Does it mean that glibc was compiled with debugging information on 
> this Redhat system? And gdb complains because it cannot find the 
> source code?

Yep.

> If this is the case, then I would obtain the behavior I am used to 
> as soon as I use a version of glibc which was compiled without 
> debugging information, no? Could I just strip the library?

Yep.  Or you could "set auto-solib-add 0" if you don't need to debug
threads or any other functions in shared libraries; that'll do it too.

> One last question: once I enter a function, say, strcmp(), is finish 
> the correct command to jump out of the function?

That's right.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer



More information about the Gdb mailing list