I try to debug my program with gdb and the step function.
Everything works fine as long as the functions are in the same file.
But if the function is outside, gdb will jump over it.
How can I solve that?
Note:
- I compiled with
-ggdboptions - I’m using
GNU gdb Red Hat Linux (6.7-1rh)
(if that is possible, appeared in startfrequence of gdb)
Example:
#include "foo2.h" // contains function foo2
void foo(void){ printf("hello"); }
void main (void){
foo(); // debuggable -> jump into possible
foo2(); // not debuggable
}
When debugging the application with gdb, use si (stepi) instead of ni (nexti). si will step into other functions, ni stays within the current function. Check the documentation at http://sourceware.org/gdb/current/onlinedocs/gdb/Continuing-and-Stepping.html#Continuing-and-Stepping for more (^F for nexti or stepi).