From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:43074) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rw1AX-0007Su-Vq for qemu-devel@nongnu.org; Fri, 10 Feb 2012 19:50:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rw1AW-0007oR-UD for qemu-devel@nongnu.org; Fri, 10 Feb 2012 19:50:25 -0500 Received: from fe02x03-cgp.akado.ru ([77.232.31.165]:53876 helo=akado.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rw1AW-0007oF-Mj for qemu-devel@nongnu.org; Fri, 10 Feb 2012 19:50:24 -0500 Date: Sat, 11 Feb 2012 04:50:22 +0400 (MSK) From: malc In-Reply-To: <4F35B974.40300@suse.de> Message-ID: References: <20120209103316.GA94562@cs.nctu.edu.tw> <20120210081441.GA17878@stefanha-thinkpad.localdomain> <20120210102604.GA9791@cs.nctu.edu.tw> <4F35B974.40300@suse.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [Qemu-devel] How to follow a child process created in the guest OS? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-15?Q?Andreas_F=E4rber?= Cc: Stefan Hajnoczi , qemu-devel@nongnu.org, =?ISO-2022-JP?Q?=1B$BDDpjG$=1B=28J?= On Sat, 11 Feb 2012, Andreas F?rber wrote: > Am 10.02.2012 11:26, schrieb ???: > > On Fri, Feb 10, 2012 at 08:14:41AM +0000, Stefan Hajnoczi wrote: > >> On Thu, Feb 09, 2012 at 06:33:16PM +0800, ??? wrote: > >>> I am running a tiny OS on QEMU and debugging it with gdbstub. The tiny OS will > >>> fork process 1, 2, ... and so on. I want to follow the child process, [...] > >>> > >>> Is there a way to do what I'm trying to do? Thanks! > > > ----------------- Tiny OS code ----------------------------- > > void main(void) /* This really IS void, no error here. */ > > { > > /* initialize enviroment */ > > > > sti(); > > move_to_user_mode(); > > if (!fork()) { /* we count on this going ok */ > > init(); // task 1 > > } > > > > for(;;) pause(); // task 0 > > } > > ------------------------------------------------------------ > > > > I am running this tiny OS on QEMU then using GDB to connect it. > > I want to follow task 1 after the forking, [...] > > Since this seems to be your code, if this were PowerPC I'd simply try to > place via inline assembler a trap instruction first thing inside the Being hardcore are we? __builtin_trap () is there for a reason. > init() function. That can easily be caught in gdbstub. > > Depending on what you really want to do, you could always try some > printf-style output to serial. ;) > > Andreas > > -- mailto:av1474@comtv.ru