From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:36183) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rw12v-00053h-EH for qemu-devel@nongnu.org; Fri, 10 Feb 2012 19:42:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rw12t-0006cT-Fv for qemu-devel@nongnu.org; Fri, 10 Feb 2012 19:42:33 -0500 Received: from cantor2.suse.de ([195.135.220.15]:41976 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rw12t-0006cL-BJ for qemu-devel@nongnu.org; Fri, 10 Feb 2012 19:42:31 -0500 Message-ID: <4F35B974.40300@suse.de> Date: Sat, 11 Feb 2012 01:42:28 +0100 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <20120209103316.GA94562@cs.nctu.edu.tw> <20120210081441.GA17878@stefanha-thinkpad.localdomain> <20120210102604.GA9791@cs.nctu.edu.tw> In-Reply-To: <20120210102604.GA9791@cs.nctu.edu.tw> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: =?UTF-8?B?6Zmz6Z+L5Lu7?= Cc: Stefan Hajnoczi , qemu-devel@nongnu.org Am 10.02.2012 11:26, schrieb =E9=99=B3=E9=9F=8B=E4=BB=BB: > On Fri, Feb 10, 2012 at 08:14:41AM +0000, Stefan Hajnoczi wrote: >> On Thu, Feb 09, 2012 at 06:33:16PM +0800, =E9=99=B3=E9=9F=8B=E4=BB=BB = wrote: >>> I am running a tiny OS on QEMU and debugging it with gdbstub. The tin= y 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 */ >=20 > sti(); > move_to_user_mode(); > if (!fork()) { /* we count on this going ok */ > init(); // task 1 > } >=20 > for(;;) pause(); // task 0 > }=20 > ------------------------------------------------------------ >=20 > 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 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 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg