volatile static int z=0;while(!z);
gdb attach <PID>
(gdb) set $pos=0 (gdb) print array[$pos++] content of array[0] (gdb) Enter content of array[1] (gdb) Enter content of array[2]
Poor man's breakpoint https://github.com/MaskRay/ccls/wiki/Debugging
the poor man loop https://agateau.com/2008/gdb-trick-the-poor-man-loop/