Printing all global variables/local variables?

cpuer picture cpuer · Jun 7, 2011 · Viewed 282.3k times · Source

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

Answer

kennytm picture kennytm · Jun 7, 2011

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