cutter icon indicating copy to clipboard operation
cutter copied to clipboard

Qemu - Remote debugging loop

Open SecT0uch opened this issue 1 year ago • 6 comments

Environment information

  • Operating System: Manjaro
  • Cutter version: 2.3.4
  • Obtained from:
    • [ ] Built from source
    • [x] Downloaded release from Cutter website or GitHub
    • [ ] Distribution repository
  • File format: AppImage

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 ?

SecT0uch avatar Sep 03 '24 18:09 SecT0uch

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.

XVilka avatar Sep 04 '24 00:09 XVilka

Here is what I have:

$ qemu-arm --version
qemu-arm version 9.0.2
$ gdb --version
GNU gdb (GDB) 15.1

SecT0uch avatar Sep 04 '24 10:09 SecT0uch

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

XVilka avatar Sep 04 '24 10:09 XVilka

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

wargio avatar Sep 04 '24 10:09 wargio

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.

SecT0uch avatar Sep 04 '24 15:09 SecT0uch

Seems like duplicate of #3277

I encounter the same problem. I'm using Cutter-v2.4.1-Windows-x86_64

Starting server:

> gdbserver --version
GNU gdbserver (GDB) 16.2
Copyright (C) 2024 Free Software Foundation, Inc.
gdbserver is free software, covered by the GNU General Public License.
This gdbserver was configured as "x86_64-w64-mingw32"

> gdbserver-multiarch --multi 127.0.0.1:1337

Listening on port 1337

Attaching from Cutter

Image

Image

At this point, nothing changed in gdbserver, still saying Listening on port 1337

Meanwhile, using rizin works

> rizin -d gdb://127.0.0.1:1337
 -- Use V! to enter into the visual panels mode (dwm style)
[0x00000000]>

And we can see that gdbserver accepted the connection

>gdbserver --multi 127.0.0.1:1337
Listening on port 1337
Remote debugging from host 127.0.0.1, port 22952

EvansJahja avatar May 17 '25 09:05 EvansJahja