Shaw Ankush
Shaw Ankush

Reputation: 113

Going inside the function from main

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

Answers (1)

Employed Russian
Employed Russian

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

Related Questions