rizin
rizin copied to clipboard
Unable to connect to a GDB server
Work environment
Questions | Answers |
---|---|
OS/arch/bits (mandatory) | Arch Linux x64 |
File format of the file you reverse (mandatory) | ELF |
Architecture/bits of the file (mandatory) | x86/64 |
rizin -v full output, not truncated (mandatory) |
rizin 0.2.0-git @ linux-x86-64, package: 0.2.0.r25701.639fe1170-git (AUR) commit: 639fe1170b33ec361f204c0a914fcd7a71c240c9, build: 2021-02-11__15:55:00 |
Expected behavior
Connecting to a gdb server using Rizin works.
Actual behavior
Connecting to a gdb server using Rizin doesn't work.
Steps to reproduce the behavior
Using the built-in gdb server
- Server:
rz -q -c '=g 9090 /bin/rizin' -
- Client:
rz gdb://localhost:9090/
- 💔 - The client disconnects right after connecting and the server enters in a loop printing:
read_packet: read failed
Using gdbserver
- Server:
gdbserver localhost:9090 /bin/rizin
- Client:
rz gdb://localhost:9090/
- 💔 - The client disconnects with error:
gdbr: Failed to attach to PID 0
This issue is also present in the 0.1.0 static build and radare2.
Forgot to say that it also doesn't work when trying to connect to the Rizin's gdb server from gdb
:
- Server:
rz -q -c '=g 9090 /bin/rizin' -
- Client:
gdb -ex 'target remote localhost:9090'
- 💔
Whereas gdb
connects to the gdbserver
without issues:
- Server:
gdbserver localhost:9090 /bin/rizin
- Client:
gdb -ex 'target remote localhost:9090'
- 🎉
cc @yossizap
The code in shlr/gdb/gdbserver
isn't really maintained and the gdb protocol implementation there lacks a lot of features, it will need more work to actually work with gdb/rizin. If you're interested in fixing it I can point you to documentation / other examples.
Honestly, I can't remember of ever using the built-in gdb server.
I'd propose to follow the same course of action that was done with the Projects feature (before the full rework): Remove the built-in gdb server (or just remove the =g
command option), until a re-implementation is performed (if ever).
This issue has been automatically marked as stale because it has not had recent activity. Considering a lot has probably changed since its creation, we kindly ask you to check again if the issue you reported is still relevant in the current version of rizin. If it is, update this issue with a comment, otherwise it will be automatically closed if no further activity occurs. Thank you for your contributions.
Still an issue
This issue has been automatically marked as stale because it has not had recent activity. Considering a lot has probably changed since its creation, we kindly ask you to check again if the issue you reported is still relevant in the current version of rizin. If it is, update this issue with a comment, otherwise it will be automatically closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because marked as stale and it has not been updated since then. If the issue is still relevant, feel free to re-open it or open a new one.