As stated in previous answers, instead of the "VARIABLES" subview, use the "WATCH" subview, press the "+" button, and type the name of the global variable you want to watch. Ex. my_global_variable
, or if there are any namespaces involved, my_top_level_namespace::my_inner_namespace::my_global_variable
.
If there are any unnamed namespaces involved, you might need to find out the mangled name of the variable and use that instead (not sure what else you would/could do, actually). One way if you're using gcc to find it is to dig through nm -nC path/to/my_executable_filename | less
.
In the latest version of the C/C++ extension, editing global variables from that subview should also be supported (right click the variable and click "Set Value"), though at some point in the past it was broken, which could be worked around by writing the expression for the address of that variable (Ex. &my_variable
), and then expanding that item in the subview to get to the value of the variable, and then right click and do "Set Value" there.