rizinorg / cutter

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

Qemu - Remote debugging loop #3373

Open SecT0uch opened 2 months ago

SecT0uch commented 2 months 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 2 months 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 2 months ago

Here is what I have:

$ qemu-arm --version
qemu-arm version 9.0.2
$ gdb --version
GNU gdb (GDB) 15.1
XVilka commented 2 months ago

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

wargio commented 2 months ago

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

SecT0uch commented 2 months 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.