If no variables are actually created with the given type, then the debugging information for the corresponding characters does not end with gcc. Then, if you ask gdb about this type, it does not know what you are talking about, because there is no debugging information for this type, and it will give you the error "There is no character in the current context."
A workaround to this problem would usually be to explicitly add a dummy type-related variable somewhere in the code. Here is a simple example that you can check to find out what I'm talking about:
enum an_enum_type {
foo,
bar,
baz
};
int main (int argc, char *argv [])
{
return baz;
}
Save this program to a file called test.cpp and compile it with this command:
g++ -o test -g -O0 test.cpp
gdb "p/x baz". " baz ".
, :
enum an_enum_type {
foo,
bar,
baz
};
an_enum_type dummy;
int main (int argc, char *argv [])
{
return baz;
}
, , gdb. , "p/x baz", "0x2" , , , .
, , NSEvent.h , NSControlKeyMask - . , ( ). , . , NSControlKeyMask .