Skip to content

Welcome

Debugging Tips

  • QEMU can host a gdb stub! Launch with -s -S, and with gdb run target remote localhost:1234
    • Protip: You can also attach to it with IDA if you're so inclined. You can then load in a database if you export it as a IDC script!
  • XQEMU can emulate a XDK serial port (which with a debug bios hosts KD, as in this and this)! Launch with something like -device lpc47m157 -serial unix:/tmp/xserial,server. With some effort you can wrestle the unix socket into a vm for with WinDbg. There's also a very barebones perl KD client in scripts/windpl
  • apitrace is useful for tracking down rendering bugs.

Debugging on macOS

If your build of Qemu is crashing, I've found it easiest to use the Xcode debugger to look at stack traces. Fire up Xcode, create a project, edit the "Scheme" to run the xqemu binary, then click the run button. Xcode has a nice GUI for analyzing the stack frame and looking at local variables to quickly track down bugs. You can also attach to running processes.