Difference between -g and -gfull in Clang

Viewed 741

The title says it all. I looked everywhere on Clang's docs, but the option -gfull hasn't got any description. The documentation also lacks information about all of the various debug levels (like -g2), and it would be cool if someone could explain that as well.

1 Answers

Apparently, options -g0, -g1, -g2, -g3 and -gfull in Clang are equivalent to GCC's. I could not find their documentation in Clang, but I found some info about their use in GCC (and they should behave the same in Clang, but I'm not 100% sure):

  • -gfull is used on Darwin/macOS. Using -gfull is equivalent to -g -fno-eliminate-unused-debug-symbols. Sources: link1 link2.

  • -g0 to -g3 are debug levels. They specify how much debugging information to include (note that -g0 means no debugging info at all). See here for a more detailed explanation (you find them under the paragraph -glevel).

EDIT:

All these command line options are listed in the Clang manual as GCC-compatible options (source). Therefore, the behavior described in the GCC manual should be the same in Clang.

P.S.: I've already said that in the original answer, but now I added a link to the Clang manual as source.

Related