I want to use breakpoint in the UPtest function to stop at 0x000000000040124c.
run 111 222 333 I need to display the 32 records at the top of the stack.
x / 32wx $ esp, but show Cannot access memory at address 0xffffffffffffe0a0.
I want to find the return address of the main program, how do I change it to display it?Like the picture below.
The problem you're having is that the $esp
register is 32-bit, but addresses on your target are 64-bit. When you do x/32wx $esp
GDB is reading the $rsp
register, which has the value 0x7fffffffffffe0a0
and masking this to 32-bits, so 0xffffe0a0
, then it is sign extending this to 64-bit, giving 0xffffffffffffe0a0
.
Try x/32wx $rsp
and you should have more luck.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.