Okay, so basically I'm wondering how to print the value of a memory address that is offset from the address stored in the register in GDB. For example, take this assembly line:
mov 0x34(%esp),%edx
In my understanding, this takes the value 52 bytes after the address pointed to by the stack pointer and stores that value inside the edx register. In this case, the value is a string, so it will store char *. When using the validation command inside GDB in the edx register:
x/s $edx
It prints the line as intended. However, when I try to print the line directly by examining the location, it was copied from this command:
x/s $esp + 0x34
He prints trash. Why is this? Am I misunderstood the syntax of the GDB command, or is it something else?
c assembly x86 memory gdb
Chris frretz
source share