gdb: how to easily show/print the stack

0

Is there a simple way to print the "stack" in gdb? What I mean by this is let's say the base pointer address is:

rbp 0x00007fffffffe330

And I'm writing values like so:

movq $22,       -8(%rbp)

And so I could do something like a "stack" command and it would print (at least) something along the lines of:

00 00 00 00 00 00 16

Without having to write something fancy with the p/x command that I need to look up to remember how to do it. Is there a straightforward way with gdb to print a readable-ish stack?


I suppose the simplest one I've found so far is:

>>> x $rbp-8
0x7fffffffe328: 0x00000016
gcc
stack
gdb
asked on Stack Overflow Aug 22, 2020 by samuelbrody1249

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0