0

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 1

1

Type the variable name in the Watch Expressions section at the top.

2
  • 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
    – MARS
    Commented Aug 4, 2018 at 18:34

You must log in to answer this question.

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