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?


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! Aug 4 '18 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
    – MARS
    Aug 4 '18 at 18:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .