Il 06/11/2013 19:36, Luiz Capitulino ha scritto: > On Wed, 06 Nov 2013 18:39:42 +0100 > Paolo Bonzini <pbonz...@redhat.com> wrote: > >> Il 06/11/2013 17:22, Luiz Capitulino ha scritto: >>> 1. Run qemu with gdb server support >>> >>> # qemu [...] -s -S >>> >>> 2. Connect gdb and try to set a breakpoint >>> >>> $ gdb /path/to/vmlinux >>> (gdb) target remote:1234 >>> (gdb) b secondary_startup_64 >> >> (Note that this doesn't make much sense until the kernel has been loaded >> into memory. You probably want hbreak instead). > > hbreak didn't work either, gdb doesn't stop at the breakpoint. I tried to > test this with another random function and got a "Remote 'g' packet > reply is too long" (which seems to be yet another different problem).
Yeah, that's very messy and it would nice to have a fix for it, but I don't know enough about gdb to say whether it's fixable. It happens when the processor switches from 32 to 64-bit under gdb's feet. The solution is typically to do "set arch i386:x86-64" before running the guest with "c" if you know the breakpoint will happen in 64-bit mode. Paolo