c++ - Debugging using gdb - Best practices -


I am making a start in GDB and I had to work it correctly. However, I am wondering how it is used in big projects. I have a project that is built using MessieFile and G ++. To work with GDB, we need to compile with debug symbols. Is right (G ++ -G files)?

Question

  1. Do I need to create a new target in some mess files like "debug" so that I can create a debug < Em> debug Is this the best practice?
  2. Suppose, I only have to debug foo.cpp and is it possible to generate debug symbols only for the entire program including the main program?

Any thoughts?

  1. Not necessarily, though you may want to consider always- Constructing with (sometimes, you can also try to customize, and do not leave the debug (-O1, -O2, etc.) code; why not? For the release, you can always run a bar on the binary.

  2. Yes, just create that file -


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -