From owner-freebsd-hackers@FreeBSD.ORG Wed Jun 8 18:55:12 2005 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 131D916A44F for ; Wed, 8 Jun 2005 18:55:12 +0000 (GMT) (envelope-from bakul@bitblocks.com) Received: from gate.bitblocks.com (bitblocks.com [209.204.185.216]) by mx1.FreeBSD.org (Postfix) with ESMTP id 56F3F43D58 for ; Wed, 8 Jun 2005 18:55:08 +0000 (GMT) (envelope-from bakul@bitblocks.com) Received: from bitblocks.com (localhost [127.0.0.1]) by gate.bitblocks.com (8.13.3/8.13.1) with ESMTP id j58It7m2087868; Wed, 8 Jun 2005 11:55:07 -0700 (PDT) (envelope-from bakul@bitblocks.com) Message-Id: <200506081855.j58It7m2087868@gate.bitblocks.com> To: Igor Shmukler In-reply-to: Your message of "Wed, 08 Jun 2005 21:39:18 +0400." Date: Wed, 08 Jun 2005 11:55:07 -0700 From: Bakul Shah Cc: hackers@freebsd.org, qemu-devel@nongnu.org Subject: Re: debugging with Qemu X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2005 18:55:12 -0000 Hmm... I've used qemu a bit to debug the kernel. Even used it to debug a loadable module. Here is what I did: # qemu -s img # cd # gdb kernel.debug (gdb) target remote localhost:1234 ... (gdb) l kldload 739 /* 740 * MPSAFE 741 */ 742 int 743 kldload(struct thread *td, struct kldload_args *uap) 744 { 745 char *kldname, *modname; 746 char *pathname = NULL; 747 linker_file_t lf; 748 int error = 0; (gdb) b 743 (gdb) c Continuing. Breakpoint 3, kldload (td=0xc1419c00, uap=0xc8105d14) at /usr/src/sys/kern/kern_linker.c:744 744 { (gdb) c Continuing. ... ^C Program received signal 0, Signal 0. cpu_idle_default () at /usr/src/sys/i386/i386/machdep.c:1113 1113 } (gdb) detach Ending remote debugging. (gdb) q I am using kqemu and qemu built from May 2 snapshot if that matters. This was a stock 5.4-RELEASE complied locallly with makeoptions DEBUG=-g added the kernel config file. The host was also running 5.4 but that should not matter. May be if you describe the exact symptoms....