Gdbinit v7.4.4 – the skip command

Here is a small update to gdbinit with a new command, “skip”.
This command will skip over the current instruction, without executing it. Usually I do it manually by set $pc=newvalue but this involves copy&paste and mouse movements and gets boring after a while. It’s great to skip over calls while you are trying some stuff and analysing some program behavior.
By default it will not execute the command at the new address. You can change this by modifying the configuration variable on top of gdbinit.

This command uses a little hack that Hopper’s author told me – the $_ variable will hold the last address, so we can disassemble 2 lines and compute the difference to retrieve the instruction size. Gdb has no command to retrieve the instruction size at a given address.
I did some (incomplete) work to add a new command for this. Being an economist, I can’t avoid this dilemma – to invest or not (more) time into gdb. Gdb source is a boring mess and LLDB is improving. I am thinking to try to create an initial LLDB port of gdbinit. This should allow me to understand its true potential as reversing debugger and take a decision where to invest time & resources.

Have fun,

SHA256(gdbinit744.gz)= 2b223998571069f00edebd606d055c5b370ede5a8cb2b2fe69093c310e32c547

4 thoughts on “Gdbinit v7.4.4 – the skip command

  1. Hi, mate

    Just installed yours gdbinit and have suggestion: why don’t you add, for example, under “define n”, set $oldeax = $eax.
    In this way, registers change colors only if their value change. If the value in the next step will be the same, color change to white and remain white till change; if the value will be different from the last step color change to red but again, if in the next step will be the same, color change to white.


  2. Hi mate,

    Sorry, you’re right, my bad. For some weird reason this definition wasn’t works but now is fine.
    But, I have question, perhaps you know how to display info about reaching breakpoint, like “Breakpoint 1, 0x00001c12 in streamer (), but under context? With long context it’s sometime hard to look up and check witch break was called.


  3. Hi mate,

    I’m not sure but in hexdump definition probably line with “hexdump_aux $data_addr+$_i” should be changed to “hexdump_aux $arg0+$_i”.


Leave a Reply

Your email address will not be published. Required fields are marked *