From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27606 invoked by alias); 21 Aug 2006 12:48:12 -0000 Received: (qmail 27593 invoked by uid 22791); 21 Aug 2006 12:48:11 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Mon, 21 Aug 2006 12:48:08 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GF9CI-0004LB-Ju; Mon, 21 Aug 2006 08:48:06 -0400 Date: Mon, 21 Aug 2006 12:48:00 -0000 From: Daniel Jacobowitz To: Cai Qian Cc: teawater , gdb@sourceware.org Subject: Re: Virtual Machine and GDB Message-ID: <20060821124806.GC16416@nevyn.them.org> Mail-Followup-To: Cai Qian , teawater , gdb@sourceware.org References: <20060821000736.GA2596@nevyn.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11+cvs20060403 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-08/txt/msg00156.txt.bz2 On Mon, Aug 21, 2006 at 01:22:34PM +0100, Cai Qian wrote: > Hi, > > On 8/21/06, teawater wrote: > >Does GDB support the ARCH of you VM? > > > > Sorry, what do you mean by GDB support the ARCH of VM? Do you mean > port GDB? Does it really necessary to port GDB to the VM? At the > moment, GDB can't run natively on my VM, nor gdbserver. I am wondering > if I can still do remote debugging. According to the document [1], it > seems I can create a remote stub for the target, and then link it to > the program I am going to run on the target, ie, to implement at least > the following functions, > > getDebugChar, putDebugChar, flush_i_cache, memset, exceptionHandler > > Although there are lots of things unclear, No no no. This is almost certainly not what you want to do. This bit of the documentation is not actually relevant. You want to debug the bare code running inside the virtual machine, right? Then what you probably want to do is a stub integrated directly with the source code of the virtual machine. Then that stub can respond to a single step packet by requesting the virtual machine execute one instruction, and so forth. The stub runs outside the VM. > 2) Can't find information on what kind of debug features I can have > when after implementing the remote stub. Breakpoint, watchpoint, > single step? See the remote protocol appendix in the GDB manual. All of those are supported. > 3) Not sure how to write a download program to download executable > from target to host in a debug session. > > [1] http://sources.redhat.com/gdb/current/onlinedocs/gdb_18.html#SEC160 You don't need one; you can either use "load", or you can load directly from the virtual machine and just have GDB connect. -- Daniel Jacobowitz CodeSourcery