How to display instructions around the current instuction?

Stefan Puiu stefan.puiu@gmail.com
Thu Jan 28 09:19:37 GMT 2021


Hi,

On Thu, Jan 28, 2021 at 1:31 AM Peng Yu via Gdb <gdb@sourceware.org> wrote:
>
> Hi,
>
> The following command will disply instructions below the current
> instructions. Is there a way to display around the current instruction
> (e.g., 5 instructions above and 5 instructions below)?
>
> display/10i $rip

Have you tried something using '$rip-10' in your command?

display/10i $rip-10

I don't think x86-64 instructions have fixed width, so that won't
always print the same number of instructions before the current one,
but it's probably a good approximation.


More information about the Gdb mailing list