All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: 陳韋任 <chenwj@iis.sinica.edu.tw>
Cc: Stefan Hajnoczi <stefanha@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] How to follow a child process created in the guest OS?
Date: Sat, 11 Feb 2012 01:42:28 +0100	[thread overview]
Message-ID: <4F35B974.40300@suse.de> (raw)
In-Reply-To: <20120210102604.GA9791@cs.nctu.edu.tw>

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
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

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  parent reply	other threads:[~2012-02-11  0:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-09 10:33 [Qemu-devel] How to follow a child process created in the guest OS? 陳韋任
2012-02-10  8:14 ` Stefan Hajnoczi
2012-02-10 10:26   ` 陳韋任
2012-02-10 23:48     ` Paul Brook
2012-02-10 23:54       ` 陳韋任
2012-02-11  0:42     ` Andreas Färber [this message]
2012-02-11  0:50       ` malc
2012-02-12  3:00         ` Wei Yang
2012-02-13 10:49           ` Stefan Hajnoczi
2012-02-10  9:24 ` Max Filippov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F35B974.40300@suse.de \
    --to=afaerber@suse.de \
    --cc=chenwj@iis.sinica.edu.tw \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.