From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35153) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8N8z-0004uC-WD for qemu-devel@nongnu.org; Thu, 15 Mar 2012 22:43:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8N8g-0004Yl-2p for qemu-devel@nongnu.org; Thu, 15 Mar 2012 22:43:53 -0400 Received: from mail-yw0-f45.google.com ([209.85.213.45]:36545) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8N8f-0004YF-Sj for qemu-devel@nongnu.org; Thu, 15 Mar 2012 22:43:34 -0400 Received: by yhoo21 with SMTP id o21so4370090yho.4 for ; Thu, 15 Mar 2012 19:43:31 -0700 (PDT) MIME-Version: 1.0 Date: Fri, 16 Mar 2012 10:43:31 +0800 Message-ID: From: Wei Yang Content-Type: text/plain; charset=ISO-8859-1 Subject: [Qemu-devel] Failed to set a breakpoint on start_kernel List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org All I like qemu very much and know it could debug the kernel. I tried what I searched on web but couldn't stop at the break point. Below is what I did. 1. Both host and guest installed the same OS, Fedora16 x86_64. 2. Compile the qemu with ./configure --target-list=x86_64-softmmu --enable-kvm --enable-debug-tcg --enable-debug --enable-trace-backend=simple 3. With this command I can boot up my guest. ./../qemu/x86_64-softmmu/qemu-system-x86_64 -enable-kvm -smp 4 -m 1024 -boot dc fedora16.img -monitor stdio 4. I git clone the kernel source in the guest and make a new kernel and initrd. I start the guest with this new kernel successfully 5. I copy out the initrd.img and the .config of kernel to host. compile the kernel on host. the kernel source code is identical on host and gueset, 6. I start the guest with the kernel and initrd on host ./../qemu/x86_64-softmmu/qemu-system-x86_64 -enable-kvm -smp 4 -m 1024 -boot dc fedora16.img -monitor stdio -kernel ~/git/linux-yinghai/arch/x86_64/boot/bzImage -initrd ~/git/debug/initramfs-3.0.0.img -append "root=/dev/mapper/vg_wizard-lv_root ro rd.lvm.lv=vg_wizard/lv_root rd.md=0 rd.lvm.lv=vg_wizard/lv_swap" This works fine. 7. Then I start the guest with gdbstub option ./../qemu/x86_64-softmmu/qemu-system-x86_64 -enable-kvm -smp 4 -m 1024 -boot dc fedora16.img -monitor stdio -kernel /home/ywywyang/git/linux-yinghai/arch/x86_64/boot/bzImage -initrd /home/ywywyang/git/debug/initramfs-3.0.0.img -append "root=/dev/mapper/vg_wizard-lv_root ro rd.lvm.lv=vg_wizard/lv_root rd.md=0 rd.lvm.lv=vg_wizard/lv_swap" -S -gdb tcp::4321 Then the guest stop at the beginning. 8. Attach the gdb in the kernel source directory gdb file vmlinux target remote localhost:4321 b start_kernel c Then the guest will run very happily.... Also use the "info b " could show the break point is set. Which step I made a mistake? -- Wei Yang Help You, Help Me