1

my GDB output for the stack looks like this

0xffffd688:     0x98    0xd6    0xff    0xff    0x75    0x84    0x04    0x08

I'd like it to look more like this

0xbffff3b0: 0xbffff620 0xbffff3c9 0×00000006 0xbffff3d8

is there an option? am I missing something trivial here?

2
  • try x/4xw $esp perhaps? Commented Mar 8, 2013 at 4:57
  • Can you provide more information - what command, what OS etc? Commented Mar 8, 2013 at 10:06

1 Answer 1

1

You indeed want (gdb) x/4xw $sp:

(gdb) help x
Examine memory: x/FMT ADDRESS.
ADDRESS is an expression for the memory address to examine.
FMT is a repeat count followed by a format letter and a size letter.
Format letters are o(octal), x(hex), d(decimal), u(unsigned decimal),
  t(binary), f(float), a(address), i(instruction), c(char) and s(string).
Size letters are b(byte), h(halfword), w(word), g(giant, 8 bytes).
The specified number of objects of the specified size are printed
according to the format.

In this case, the repeat count is 4, the format letter is x(hex) and the size letter is w(word, 4 bytes).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.