if you are inspecting a dump, you use info registers
to look at values in registers in gdb, but can you look at the value stored in registers when the program is executing at for eg address 0x76FD6908? eg I only want the value of registers when pc is at a certain address
问问题
1385 次
2 回答
2
你有两个选择:
frame X
, 那么info registers
. 这为您提供了该堆栈帧中的所有寄存器。请注意,某些寄存器可能无法保存,在这种情况下,GDB 会在该帧中为您提供错误的值。info frame X
. 这会告诉您仅保存在该帧中的寄存器:Stack frame at 0x7fff5f400150: rip = 0x100000eed in foo; saved rip 0x100000eed called by frame at 0x7fff5f400170, caller of frame at 0x7fff5f400130 Arglist at 0x7fff5f400148, args: Locals at 0x7fff5f400148, Previous frame's sp is 0x7fff5f400150 Saved registers: rbp at 0x7fff5f400140, rip at 0x7fff5f400148
于 2013-03-26T21:37:03.393 回答
0
如果您只想在运行 gdb 时查看特定的内存区域,请使用该x
命令。此链接可能会有所帮助:
http://www.delorie.com/gnu/docs/gdb/gdb_56.html
以这种方式检查的内存不称为“寄存器”,但这是您的意思吗?
于 2013-03-26T21:28:48.607 回答