You were close enough
print (var1, var2, ...)
Incidentally, you can use p
as a shorthand for print
:
p (var1, var2, ...)
If you simply want to monitor those variables for changes, then you need to watch them:
watch var1
watch var2
This way, any time the value of var1
etc. changes, GDB will notify you and print old and new value.