Reputation: 113
I have just started using GNU debugging tool and now I am stuck in some assignment. In this we are supposed to make three different .c files and then compile them into one program ( executable file ). My query is that is there any way we can switch .c files while debugging because the function call is in, say file1 and its definition is in file2. Can't I pass the file2 as soon as the gdb reaches that function call during analyzing code line by line.
Thank you.
Upvotes: 0
Views: 39
Reputation: 213375
is there any way we can switch .c files while debugging
You are probably looking for the GDB step
command, which will automatically switch sources for you when you step into function defined in a different source file.
Upvotes: 1