I\'m using a gdb script to watch the changes of a variable using awatch:
gdb
awatch
#!/bin/bash # Compi