From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4016 invoked by alias); 22 Aug 2006 06:26:58 -0000 Received: (qmail 3934 invoked from network); 22 Aug 2006 06:26:35 -0000 Received: from unknown (72.22.69.69) by sourceware.org with QMTP; 22 Aug 2006 06:26:35 -0000 Received: (qmail 87041 invoked by uid 3521); 22 Aug 2006 06:25:31 -0000 Received: from 127.0.0.1 by rs384.securehostserver.com (envelope-from , uid 1002) with qmail-scanner-1.25st (clamdscan: 0.88/1245. spamassassin: 3.1.0. perlscan: 1.25st. Clear:RC:1(127.0.0.1):SA:0(-2.0/5.0):. Processed in 0.23703 secs); 22 Aug 2006 06:25:31 -0000 Received: from unknown (HELO rs384.securehostserver.com.com) (127.0.0.1) by rs384.securehostserver.com with SMTP; 22 Aug 2006 06:25:31 -0000 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 From: Anupama Chandwani To: Michael.Snyder@palmsource.com, cjia@cse.unl.edu Subject: Re: Virtual Machine and GDB Reply-To: anupama.chandwani@celunite.com X-Origin: 220.225.33.101 Date: Tue, 22 Aug 2006 06:26:00 -0000 Cc: gdb@sourceware.org X-Uidl: 1156227930870212120 X-Mailer: AtMail 4.03 X-Qmail-Scanner-Message-ID: <115622793192287032@rs384.securehostserver.com> 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/msg00178.txt.bz2 Message-ID: <20060822062600.zd3TtKwZjFG6gTG40LL0r9JidZi1ES4vCZMrz93Fwzo@z> =0D Hi..=0D =0D >> 2) You need to teach gdb to understand the architecture of=0D >>your virtual machine -- the word size, the instruction language,=0D >> the register set, and so forth. That doesn't mean porting gdb=0D >> to RUN on the VM -- it just means teaching gdb how to DEBUG=0D >> the VM (meaning, debug something that is running in the VM).=0D >>=0D >=0D >How can I achieve this part? At the moment, after received a packet=0D >from remote GDB, I am trying to parse the packet first, and then send=0D >the right response to GDB. For example, if VM received a "info=0D >registers" command at the debug socket, it will try to collect=0D >register information, and then generate a right RSP message back. Or,=0D >if it received "next", I can set a flag in VM to indicate to only=0D >execute one instruction. Is that a right way to do?=0D =0D >>Qian=0D =0D =0D Since you already have a communicating mechanism up, its good, u wont take = much=0D time for including ur target in gdb. Your on right track, but after parsing= wat=0D the packet wants just call the callback functions in gdb. Instead of settin= g a=0D flag in VM to indicate the next command, just call the function of "next" i= n gdb.=0D It will take care of the required.=0D Read how targets are supported by gdb, ull get a gud view of exactly= wat u=0D have to implement.=0D =0D =0D