LLDB - 评估寄存器中的地址

Scr*_*ers 14 c debugging gdb lldb

要在LLDB中查看我的堆栈,我目前使用以下内容:

(lldb) register read rbp --format hex
rbp = 0x00007fff5fbff820
Run Code Online (Sandbox Code Playgroud)

然后查看前面的64个字节:

(lldb) memory read --size 4 --format x --count 16 `0x00007fff5fbff820-64`
0x7fff5fbff7e0: 0x5fbff900 0x00007fff 0x00000000 0x00000000
0x7fff5fbff7f0: 0x00000000 0x00000000 0x00000000 0x00000000
0x7fff5fbff800: 0x00000000 0x00000000 0x00000000 0x00000000
0x7fff5fbff810: 0x5fbff838 0x00000006 0x00000008 0x00000000
Run Code Online (Sandbox Code Playgroud)

我一直无法找到怎么做,但有没有办法替换表达式:

`0x00007fff5fbff820-64`
Run Code Online (Sandbox Code Playgroud)

更像是:

`%rbp-64`
Run Code Online (Sandbox Code Playgroud)

谢谢!

小智 14

`$ RBP-64`

还有用于内存读取和打印的快捷格式化程序,其作用类似于gdb.例如

x/16x` $ rbp`

有关x /和p /的接受格式化程序字符的详细信息,请参阅"help gdb-format".这些只是命令别名到内存读取-G和expr -G.