This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Stepping over shared library call


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]