In gdb, after reaching a breakpoint, I want to list all the variables in the current context, instead of giving each variable name explicitly? Is there any way to achieve this at all?
Asked
Active
Viewed 5.3k times
51
-
1I don't think there is single command, but this should be close enough: http://stackoverflow.com/questions/6261392/in-gdb-how-can-i-print-all-global-variables-local-variables – dbrank0 Jun 03 '13 at 07:15
1 Answers
91
You want info locals. Or, if you are getting a back trace, bt full.
You can attach info locals to a breakpoint with the commands command.
spoulson
- 20,938
- 14
- 75
- 101
Tom Tromey
- 20,122
- 1
- 40
- 60