I'm only seeing local variables and their corresponding values in the GDB. Is there any way I can see the global variables as well?
1 Answer
Type the variable name in the Watch Expressions section at the top.
-
How do I format that? Should it be the expression where the global variable was declared, or something else? Thanks btw! Commented Aug 4, 2018 at 18:16
-
I certainly only use GDB from the command line, it seems more powerful, but I think it's just a matter of habit, it should be enough to write the name of the variable in question, I do not know if the debugger will be able to evaluate a complete expression– MARSCommented Aug 4, 2018 at 18:34