You can print multiple values ββusing the printf command in gdb.
printf "%d,%d\n", a, b
To use it in the future, you can define the gdb function or use the gdb-history function.
To define the gdb function, create / modify the $HOME/.gdbinit with the following content,
define print_all printf "%d,%d\n", a, b end document print_all Prints all my variables. end
Then you can use print_all as a command.
For the story trick, create / modify the $HOME/.gdbinit with the following contents:
set history filename ~/.gdb_history set history save
and use it ctrl+r , as in bash. The actual answer of gdb-history is here .
source share