Re: How to display instructions around the current instuction?

Peng Yu via Gdb
2021-01-28T17:45:16Z

Hi Christo,

> Another possibility could be: set disassemble-next-line on

This does not correctly answer the question. It just show the current
line but not the context.

Also, how to just show the disassembled code but the hex numbers.

I know the doc is here. But is there is a way to check its helpage
withing gdb command line? Thanks.

https://visualgdb.com/gdbreference/commands/set_disassemble-next-line

Temporary breakpoint 1, 0x0000000000401134 in main ()
=> 0x0000000000401134 <main+4>: 48 83 ec 10 sub rsp,0x10
(gdb) 0x0000000000401138 in main ()
=> 0x0000000000401138 <main+8>: c7 45 fc 00 00 00 00 mov DWORD PTR
[rbp-0x4],0x0
(gdb) 0x000000000040113f in main ()
=> 0x000000000040113f <main+15>: 48 bf 04 20 40 00 00 00 00 00 movabs
rdi,0x402004

--
Regards,
Peng