How do I print the local variables in GDB every "next" or "step" command?
Is there a way instead of writing "info locals" every time?
How do I print the local variables in GDB every "next" or "step" command?
Is there a way instead of writing "info locals" every time?
If you can use GDB TUI mode, that's probably best. See this answer.
If you can't use TUI for some reason, this should also work:
# put this into ~/.gdbinit:
define hook-next
info locals
end
More info on hooking commands here.