Reputation: 116373
I have lots and lots of C preprocessor #define
statements, which make my C programming much easier. However, when debugging with GDB, the preprocessor "labels" are not accounted for in the symbols list.
Is there are way to have GDB recognise the #define
d labels?
Upvotes: 6
Views: 484
Reputation: 62093
#define
symbols are not usually included as part of the debug information. const
variables (or inline functions for function-like macros) are usually a better idea, and for more reasons than this (e.g., scoping, type safety, multiple evaluations, etc.). I recommend using them in favor of preprocessor symbols whenever you can.
Upvotes: 3