Recommendations for building OpenWrt debug kernel for use in QEMU?

Hi everyone,

I've been running OpenWrt under QEMU 2.9.1, using the ImageBuilder to create the rootfs, and using the zImage which I found on this downloads page. I have been running them with the following QEMU options:

qemu-system-arm \
    -M virt\
    -m 64\
    -kernel openwrt-armvirt-32-zImage\
    -drive if=virtio,file=./openwrt-armvirt-32-rootfs-ext4.img,format=raw \
    -append "root=/dev/vda"

This works well, but I would like to be able to use a debug kernel in this same configuration. So far, I have tried using the debug kernel from the downloads page linked above, but I get this error when I try to use it:

qemu-system-arm: Trying to execute code outside RAM or ROM at 0xc0008000
This usually means one of the following happened:

(1) You told QEMU to execute a kernel for the wrong machine type, and it crashed on startup (eg trying to run a raspberry pi kernel on a versatilepb QEMU machine)
(2) You didn't give QEMU a kernel or BIOS filename at all, and QEMU executed a ROM full of no-op instructions until it fell off the end
(3) Your guest kernel has a bug and crashed by jumping off into nowhere

I have also tried building my own kernel using the OpenWrt build system with the default config for the armvirt machine, but I've had no success with this. When I try starting it, QEMU hangs with no error message.

I suspect I need to change something in the kernel's configuration before building it, but the absence of any errors leaves me with no indication to what might be causing the failure.

Have you all ever tried to do something similar, or have any recommendations on how to approach this problem?