Thursday 8 December 2016

c - Printing all global variables/local variables?



How can I print all global variables/local variables? Is that possible in gdb?


Answer




Type info variables to list "All global and static variable names".



Type info locals to list "Local variables of current stack frame" (names and values), including static variables in that function.



Type info args to list "Arguments of the current stack frame" (names and values).


No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...