Is it possible to invert the stack view when debugging in radare2 such that higher addresses are at the top?

1 Answer 1


That's not currently possible. The closest you can get is using iteration (@@), and printing the stack like this:

[0x10000b4a1]> pxw 16 @@=rsp rsp-16 rsp-32 rsp-48

(For more lines, you simply add additional rsp-? elements).

Unfortunately, this method has several disadvantages:

  1. If you need a variable amount of lines, that won't do. You can either use an external command to generate the elements (via @@c: or @@=``), or contribute to radare2's iterator code (located in r_core_cmd_foreach, in libr/core/cmd.c), which currently supports only positive direction (you'd need to add support for negative stepping).
  2. For certain hexdump formats (such as px, which is the default format used in panels view), a header is added to the output, and when using an iterator, which results in multiple command executions, the header will appear over and over again.
  3. For some reason, this kind of iteration does not work in panels view.

I'd recommend opening a feature request (or implementing it and contributing to the project), to support reverse printing direction.

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.