1

Radare2 doesn't update current address, when single-step debugging using ds?

I'm debugging an ELF binary on Linux using single-step (ds). The problem is that the current address at the prompt doesn't update after each step.

The prompt:

enter image description here

How do I make Radare2 update the prompt to reflect the current value of EIP?

Furthermore, is it possible to make Radare2 automatically disassemble the next instruction after each ds, like it is possible with GDB?

0

What you can do is to use pd with the temporary seek operator @ passing rip register so that pd will work from that address.

So instead of pd just use pd@rip and you should be fine with that.

[0x00000000]> pd
    ;-- rsi:
    0x00000000      ff             invalid
    ...


[0x00000000]> pd@rip
    ;-- rip:
    ┌─> 0x10000b3bf      4c892424       mov qword [rsp], r12
    ╎   0x10000b3c3      4489ea         mov edx, r13d
    ╎   0x10000b3c6      4c89f9         mov rcx, r15

Additionally you can use the V!-mode (or any other graphical view mode for that matter) view for debugging. They get automatically updated after you step over your binary.

  • Thank you - do you think it is a bug in Radare2? Or what's the reason for not updating the prompt address? – Shuzheng Dec 11 '18 at 7:46
  • no. I think your seek position is just unrelated to the rip while debugging. You can imagine doing some stepping and investigating data at some other address. If you seek position changes every time you step it might be also frustrating. – Paweł Łukasik Dec 11 '18 at 7:48
  • But sometimes the prompt address update, e.g. after pressing ds, say, 10 times? Do you know if it is possible to make Radare2 update the prompt address after each ds? Also, do you know if it is possible to make Radare2 automatically disassembly the next instruction after each ds (GDB can do that)? – Shuzheng Dec 11 '18 at 7:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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