AR# 45131


13.3 EDK - What are the differences in the debugging levels in SDK?


What are the differences in the Debug Levels in SDK? The options available to me are:

  • None
  • -g1
  • -g (default)
  • -g3


The -g option in mb-gcc allows you to perform debugging at the source level. The debugger mb-gcc adds appropriate information to the executable file, which helps in debugging the code. The debugger mb-gdb provides debugging at source, assembly, and mixed source and assembly.

While initially verifying the functional correctness of a C program, do not use any mb-gcc optimization option like -O2 or -O3, as mb-gcc does aggressive code motion optimizations which might make debugging difficult to follow.

The default level is -g (sometimes known as -g2).

Level 1 produces minimal information, enough for making backtraces in parts of the program that you do not plan to debug. This includes descriptions of functions and external variables, but no information about local variables and no line numbers.

Level 3 includes extra information, such as all the macro definitions present in the program. Some debuggers support macro expansion when you use -g3.
AR# 45131
Date 12/15/2012
Status Active
Type General Article
Tools More Less
People Also Viewed