G
GameboyHippo
I'm working with a library that contains many constants. These
constants are defined using the #define preprocessor directive. I'm
debugging a program. Is there a way to print out the value of the
constants? It would be much easier to print them out using DBX rather
than looking them up in various .h files.
For example, this is what I would like to do
(dbx) stop at fruit.cpp:34
(dbx) run
switch (fruit_type) {
(dbx) print fruit_type
fruit_type = 34
(dbx) print STRAWBERRY_TYPE
STRAWBERRY_TYPE = 42
Here's what really happens:
dbx: "STRAWBERRY_TYPE" is not defined in the scope
`fruit`fruit.cpp`main:34`
Now of course the names have all been changed to protect the innocent,
but the problem is that I don't want to dig through .h files and
documentation to find out what the various constants are equal to.
(And they may change from one version of the library to the next
anyway.)
constants are defined using the #define preprocessor directive. I'm
debugging a program. Is there a way to print out the value of the
constants? It would be much easier to print them out using DBX rather
than looking them up in various .h files.
For example, this is what I would like to do
(dbx) stop at fruit.cpp:34
(dbx) run
switch (fruit_type) {
(dbx) print fruit_type
fruit_type = 34
(dbx) print STRAWBERRY_TYPE
STRAWBERRY_TYPE = 42
Here's what really happens:
dbx: "STRAWBERRY_TYPE" is not defined in the scope
`fruit`fruit.cpp`main:34`
Now of course the names have all been changed to protect the innocent,
but the problem is that I don't want to dig through .h files and
documentation to find out what the various constants are equal to.
(And they may change from one version of the library to the next
anyway.)