How to print the next N executed lines automatically in GDB?

This is easy, actually. I’ll give you the bare bones, and you can modify to suit.

(gdb) define nstep
> set $foo = $arg0
> while ($foo--)
>  step
>  end
> end
(gdb) nstep 100

I’ve done this many times. Hope this helps!

Leave a Comment