Debugger help
gdbserver
gdbserver commands from r2 shell
=g port file [args]
listen on 'port' debugging 'file' using gdbserver=g! port file [args]
same as above, but debug protocol messages (like gdbserver --remote-debug)- Additional details regarding gdb and gdbserver can be found here
Directly using gdbserver steps
- Set up and attach gdbserver to a process/binary. Example:
gdbserver localhost:8000 /bin/ls
- ๐ Connect to gdbserver using r2.
radare2 -d gdb://localhost:8000
asciinema - Use radare2 commands normally
-
Note that gdbserver implemented this way will die once the r2 session exits
-
gdbserver subhelp
Usage: =!cmd args
=!pid - show targeted pid
=!pkt s - send packet 's'
=!monitor cmd - hex-encode monitor command and pass to target interpreter
=!detach [pid] - detach from remote/detach specific pid
=!inv.reg - invalidate reg cache
=!pktsz - get max packet size used
=!pktsz bytes - set max. packet size as 'bytes' bytes
=!exec_file [pid] - get file which was executed for current/specified pid