GDB - $EBP 在寄存器中不存在

GDB - $EBP does not exist in register

我一直在尝试在 aarch64 上调试 C 应用程序,我想获得 $ebp 值。但是,当我尝试使用以下命令时,出现错误:

(gdb) x/xw $ebp
Value can't be converted to integer.

我也尝试用 $rbp$bp 替换 $ebp 的值,但是我仍然得到同样的错误。我试图显示我的寄存器,但 EBP 似乎不存在:

(gdb) info registers
x0             0xfffffffff603      281474976708099
x1             0xfffffffff348      281474976707400
x2             0xfffffffff360      281474976707424
x3             0xaaaaaaaaa970      187649984473456
x4             0x0                 0
x5             0xa77fd21706390403  -6377147551002852349
x6             0xfffff7fb2788      281474842175368
x7             0x4554415649        297766311497
x8             0xd7                215
x9             0x0                 0
x10            0x0                 0
x11            0x0                 0
x12            0x2740              10048
x13            0x0                 0
x14            0x0                 0
x15            0x6fffff47          1879048007
x16            0x0                 0
x17            0x0                 0
x18            0x0                 0
x19            0xaaaaaaaaa9b0      187649984473520
x20            0x0                 0
x21            0xaaaaaaaaa7f0      187649984473072
x22            0x0                 0
x23            0x0                 0
x24            0x0                 0
x25            0x0                 0
x26            0x0                 0
x27            0x0                 0
x28            0x0                 0
x29            0xffffffffca90      281474976696976
x30            0xaaaaaaaaa990      187649984473488
sp             0xffffffffca90      0xffffffffca90
pc             0xaaaaaaaaa918      0xaaaaaaaaa918 <write+20>
cpsr           0x60000000          [ EL=0 C Z ]
fpsr           0x0                 0
fpcr           0x0                 0

这是我的 gdb 版本:

# gdb -v
GNU gdb (Ubuntu 9.2-0ubuntu2) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

I have been trying to debug an C application on aarch64 and I want to get the $ebp value.

aarch64处理器上没有这样的寄存器,你的问题没有意义。

一般来说,为了在机器指令级别进行调试,您必须了解您的程序正在执行的CPU架构:可用的寄存器、指令、过程调用约定等

没有这样的理解,在指令级调试是不可能的。

要了解 aarch64 体系结构,您可以开始 here