Search code examples
gdb

How to step over int with gdb?


I'm new to gdb. I've stepped to an int instruction as can be seen in the image. Is it possible to step over the int instruction? If I use ni again it just steps into the interrupt code, where as I want it to run until it returns to 0x7c47. I'm aware I can just put a breakpoint on that address, but was wondering if there is a single command that does it without a breakpoint?

gdb screenshot


Solution

  • That depends. If by "without a breakpoint" you mean you don't want to use break or tbreak commands, but you are OK if GDB uses breakpoints behind the scenes, then the until command will do what you want.

    The until command is documented here, the command can take a locspec within the current frame, so in your case you'd want:

    (gdb) until *0x7c47
    

    GDB will insert a temporary breakpoint at 0x7c47, then resume the inferior until the breakpoint is hit. The breakpoint will then be removed.

    If by "without a breakpoint" you literally mean no breakpoints can be used, then I don't think there's a solution.