2

When I try to see what's inside stack space, I use the following command:

x/100x $sp

However, sometimes output is formatted like this, grouping by 4 bytes:

0xbffff0ac: 0x00000000  0xb7fbc000  0xb7fbc000  0xbffff4e8
...

While sometimes I get this:

0xbffff0ac: 00 00 00 00 00 c0 fb b7 00 c0 fb b7 e8 f4 ff bf

But I can't determine how to switch between these formats and how gdb desides which format to use for output. Any suggestions?

1

1 Answer 1

5

sometimes output is formatted like this
However, sometimes output is formatted like this

This is because the x command remembers the last size you used.

If you want particular size with your x, just specify it directly:

(gdb) x/100wx $sp

Documentation.

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.