Search code examples
cvariablesgdbglobal-variables

Printing all global variables/local variables?


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


Solution

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

    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).