rizinorg / cutter

Free and Open Source Reverse Engineering Platform powered by rizin
https://cutter.re
GNU General Public License v3.0
15.63k stars 1.14k forks source link

Qemu - Remote debugging loop #3373

Open SecT0uch opened 1 week ago

SecT0uch commented 1 week ago

Environment information

Describe the bug

The connection to gdb loops forever when trying to run a mips binary with Qemu. Works with rizin from package manager.

To Reproduce

Steps to reproduce the behavior:

  1. Run qemu-mipsel -L buildroot/output/target/ -g 1234 ./mipsel.bin
  2. On cutter: Connect to a remote debugger
  3. Enter 127.0.0.1:1234
  4. Connecting loop..

And rizin -a mipsel -d gdb://localhost:1234 works fine.

Expected behavior

The remote debugger connects.

Screenshots

image

Bonus: when clicking Cancel or closing, cutter starts freezing and I have to kill the process.

Am I doing anything wrong ?

XVilka commented 1 week ago

What version of the QEMU do you use? Also, @wargio is currently working on MIPS support improvement, thus relatively soon it will be heavily updated in Cutter.

SecT0uch commented 1 week ago

Here is what I have:

$ qemu-arm --version
qemu-arm version 9.0.2
$ gdb --version
GNU gdb (GDB) 15.1
XVilka commented 1 week ago

Could you try connecting using plain Rizin? It will show the exact error in the log if there's any.

wargio commented 1 week ago

i'm not sure that rizin -a mipsel is a valid arch.

SecT0uch commented 1 week ago

As said initially, rizin worked. From my history, I tried both rizin -a mips and rizin -a mipsel, so I'm not sure anymore which one worked.