Stepping over shared library call

Kris Warkentin kewarken@qnx.com
Mon Aug 11 15:15:00 GMT 2003


When I do a 'step' on a function that is in a shared library (such as
printf), what mechanisms/criteria does gdb use to determine whether to
single step all the way through it or just to stop on the next line of code?

I've observed that if the symbols are loaded for libc, gdb steps all the way
through the call but otherwise skips over it.  Is this expected behaviour?

I believe it is because one could have a situation where there is some debug
info in a shared lib (or a non-debug shared lib calls into a debug one).  If
this were the case, you'd want gdb to step until it finds some debug
information right?

Basically I'm planning on telling customers, "Use 'next' if you want to go
to the next line and only use step if you want to step into the call."  This
wouldn't be an issue if everyone just did local debugging but when you're
debugging a remote system, single stepping through a shared library call can
take a hellishly long time.

cheers,

Kris




More information about the Gdb mailing list