3

I have to cpp files (main and functions) and I make them to build a exe file (code) and two object files (main.o and functions.o).

How can I debug specific file "functions.cpp" from gdb command line?

1 Answer 1

2

You need to compile your files with gcc's -g3 option. After this start gdb <exename>. You can then set breakpoint in your file inside gdb by something like b functions.cpp:36 if you want the exe to break on line 36 of functions.cpp. You can set breakpoints to particular function calls as well, such as b func(). Then run the program using r <options that exename takes>.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.