6

I have this address, 0x8002bf20, and I need to see what's inside there. I know GDB does nice things like "print x" and I'll see something like struct ex {x: 1, y: 2}

I need to see that kind of print output for this address I need to examine.

Thanks.

1 Answer 1

14

If you know the type of the structure at that address, you can coerce GDB to print it with:

(gdb) print *(struct mystruct *) 0x8002bf20

If you do not know the type of the structure, then the best you can do is the x command which you already mentioned -- although do be aware that there's no harm in casting to the 'wrong' type, so you can try various structures with print *(struct mystruct *) until the output looks plausible.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.