From owner-freebsd-hackers@FreeBSD.ORG Sun Mar 9 03:07:22 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82FB9106566C for ; Sun, 9 Mar 2008 03:07:22 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from mail.asahi-net.or.jp (mail1.asahi-net.or.jp [202.224.39.197]) by mx1.freebsd.org (Postfix) with ESMTP id 4FC1E8FC23 for ; Sun, 9 Mar 2008 03:07:22 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from localhost (pool-151-197-33-119.phil.east.verizon.net [151.197.33.119]) by mail.asahi-net.or.jp (Postfix) with ESMTP id 617E351F1B; Sun, 9 Mar 2008 12:07:20 +0900 (JST) Date: Sat, 8 Mar 2008 22:07:11 -0500 From: Yoshihiro Ota To: Kostik Belousov , freebsd-hackers@freebsd.org Message-Id: <20080308220711.1f43614d.ota@j.email.ne.jp> In-Reply-To: <20080308201832.GA10374@deviant.kiev.zoral.com.ua> References: <20080308144505.9c72e484.ota@j.email.ne.jp> <20080308201832.GA10374@deviant.kiev.zoral.com.ua> X-Mailer: Sylpheed 2.4.8 (GTK+ 2.12.8; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Subject: Re: Remote Kernel Debugging over 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: Sun, 09 Mar 2008 03:07:22 -0000 On Sat, 8 Mar 2008 22:18:32 +0200 Kostik Belousov wrote: > On Sat, Mar 08, 2008 at 02:45:05PM -0500, Yoshihiro Ota wrote: > > Hello, folks, > > > > Has anyone tried to remote-debugging of a system running on Qemu? > > > > I thought if I could attach kgdb from Qemu host to a guest FreeBSD > > running on Qemu, it would be very helpful for many reasons, i.e. > > no hardware requirements, avoid fscking all disks, and so on. > > > > Has anyone ever attempted? I spent a half day but due to lack of > > remote debugging experience and some other knowledge, it wasn't > > successful. > > I do it often, with the stock gdb built from FSF sources. > > Simply run the qemu with the "-s" switch, then start gdb with kernel.debug > argument, and, in the gdb, do "target remote localhost:1234". > > I use latest gdb since it much better handles debugging information > generated by the 4.2 gcc. > > Also, this setup allows me to use both convenience of ddb specific > commands (inside QEMU) and gdb data inspection facilities (almost) > simultaneously. > Thank you for all replies. This one was the simplest one, indeed. My attempt was like how Robert described but I haven't understood to do that way enough. Regards, Hiro