Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

What's the difference between gcc ggdb and gcc-gggdb3?


Asked by Taylor Ware on Dec 04, 2021 FAQ



-ggdb3 produces extra debugging information, for example: including macro definitions. -ggdb by itself without specifying the level defaults to -ggdb2 (i.e., gdb for level 2). I have atleast one example where -ggdb worked better for me than another debug option which we were using :
Similarly,
g++ can compile any .c or .cpp files but they will be treated as C++ files only. gcc can compile any .c or .cpp files but they will be treated as C and C++ respectively. Using g++ to link the object files, files automatically links in the std C++ libraries.
Keeping this in consideration, The broader answer is that gcc supports four levels of debug information, from -g0 (debug information disabled) through -g3 (maximum debug information). Specifying -g is equivalent to -g2.
Indeed,
The broader answer is that gcc supports four levels of debug information, from -g0 (debug information disabled) through -g3 (maximum debug information).
Moreover,
Produce debugging information in the operating system's native format (stabs, COFF, XCOFF, or DWARF 2). GDB can work with this debugging information.