Ok, I\'m looking to define a set of memory addresses as constants in a .h file that\'s used by a bunch of .c files (we\'re in C, not C++). I want to be able to see the name<
If you're compiling with gcc, you can add the -ggdb3
switch, which will tell gcc to store macro information (i.e. #define
s) so that they can be used inside gdb.
Declare the constants in the header file using extern
:
extern const short int SOME_ADDRESS;
then in any, but only one, .c
file provide the definition:
const short int SOME_ADDRESS = 0x0010;