If anyone is interested gdb has a visual mode. Eg: gdb ./a.out
then while inside gdb ctrl+x, a
so press ctrl+x at the same time, let go and press button 'a'