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?
The @entry form refers to the value of the parameter when the function was entered. This isn't always available, but sometimes it is -- there is a DWARF extension for it, and GCC emits this when possible. There's some information here: https://sourceware.org/gdb/onlinedocs/gdb/Variables.html.
The usual way to examine data in your program is with the print command (abbreviated p ), or its synonym inspect . It evaluates and prints the value of an expression of the language your program is written in (see section Using GDB with Different Languages).
You can see these breakpoints with the GDB maintenance command `maint info breakpoints' . Using the same format as `info breakpoints' , display both the breakpoints you've set explicitly, and those GDB is using for internal purposes. Internal breakpoints are shown with negative breakpoint numbers.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With