If you want to execute another command after doing ds
you can simply use ;
to add a new command. So for example, the command ds; pd 1 @ rip
will step one instruction and disassemble the instruction at rip
.
You can also define a macro (an alias) for a set of commands. Let's define for example the macro foo
to do the following things:
- Single step
- Print hexdump of 16 bytes at
rip
- Disassemble 1 instruction at
rip
To do this you can simply run:
[0x7f46fea5ee00]> (foo, ds, px 16 @ rip, pd 1 @ rip)
And then use it with .(foo)
:
[0x7f46fea5ee00]> .(foo)
- offset - 0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
0x7f46fea5ee1a 89c0 48c1 e220 4809 c248 8b05 0e70 0200 ..H.. H..H...p..
;-- rip:
0x7f46fea5ee1a 89c0 mov eax, eax
[0x7f46fea5ee00]> .(foo)
- offset - 0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
0x7f46fea5ee1c 48c1 e220 4809 c248 8b05 0e70 0200 4889 H.. H..H...p..H.
;-- rip:
0x7f46fea5ee1c 48c1e220 shl rdx, 0x20
[0x7f46fea5ee00]> .(foo)
- offset - 0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
0x7f46fea5ee20 4809 c248 8b05 0e70 0200 4889 156f 6802 H..H...p..H..oh.
;-- rip:
0x7f46fea5ee20 4809c2 or rdx, rax
Visual Modes
Now, after all this was said, I want to add that in my opinion, interactive debugging using ds
, dso
, dc
and similar are the wrong approach. For a debugging session, it is preferred to use the Visual Modes of radare2. Visual Panels mode is ideal for debugging session but you can also enjoy from a good experience while using the regular Visual and Visual Graph modes.
The following GIF shows the Visual Panels mode (V!
) as well as the regular Visual mode. You can also see that by pressing :
I can execute radare2 commands (in the gif I executed px
). Visual Panels mode is very configurable and you can tweak it as you see fit. Simply use the ?
key to see the help and the available commands.

Read more: