Monday, June 28, 2010

Compiling for Debugging in gdb

In order to debug a program effectively, you need to generate debugging information when you compile it. This debugging information is stored in the object file;
It describes the data type of each variable or function and the correspondence between source line numbers and addresses in the executable code.
To request debugging information, specify the ‘-g’ option when you run the compiler.

No comments:

Post a Comment