Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: pedro@codesourcery.com
Cc: gdb-patches@sourceware.org
Subject: Re: bsd-kvm target, always a thread
Date: Sat, 09 Aug 2008 12:13:00 -0000	[thread overview]
Message-ID: <200808091211.m79CBGfO008457@brahms.sibelius.xs4all.nl> (raw)
In-Reply-To: <200808091227.35031.pedro@codesourcery.com> (message from Pedro 	Alves on Sat, 9 Aug 2008 12:27:34 +0100)

> From: Pedro Alves <pedro@codesourcery.com>
> Date: Sat, 9 Aug 2008 12:27:34 +0100
> 
> On Saturday 09 August 2008 09:32:57, Mark Kettenis wrote:
> > > From: Pedro Alves <pedro@codesourcery.com>
> 
> > Hmm, it is unfortunate that a process ID of 0 is "verboten", since
> > that's what you are really looking at with "target kvm".  And it
> > should be possible for me to actually make all the running processes
> > visible as kernel "threads".
> >
> 
> > I guess your diff is right, although I'd prefer a less arbitrary ptid
> > to be used.  Would something like ptid_build(0, 1, 0) work?
> 
> I'd prefer to get away without pid == 0.  I'm going to
> introduce later a "struct inferior" which holds an "int pid", and
> we will match a ptid to a struct inferior by its ptid.pid.
> I'd rather avoid having an inferior with pid == 0.
> 
> Does something like this work for you?
> 
>     ptid(42000, 0, 0)    ->  for use when we pass around a      
>                              ptid representing the whole inferior.
> 
>     ptid(42000, 1, 0)    ->  in kernel
> 
>     ptid(42000, 1, 1)  ->  process 1.
>     ptid(42000, 1, 2)  ->  process 2
>     ptid(42000, 1, 3)  ->  process 3
>     ...

Something like that'd work fine for the OpenBSD kernel.

> These are internal ids, of course.  We only show them what we
> want in target_pid_to_str and target_extra_thread_info.  The user
> doesn't need to know anything about these ids.

Sure, I'd just think you should use something that's a bit less
arbitrary than 42000 (which could be confused with a real process ID)
here.  I see that remote.c uses negative numbers for special cases.
Would using -1 or -2 work for you?


  reply	other threads:[~2008-08-09 12:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-08  3:20 Pedro Alves
2008-08-09  8:17 ` Mark Kettenis
2008-08-09  8:34 ` Mark Kettenis
2008-08-09 11:28   ` Pedro Alves
2008-08-09 12:13     ` Mark Kettenis [this message]
2008-08-09 14:31       ` Pedro Alves
2008-08-10 15:56         ` Mark Kettenis
2008-08-10 17:34           ` Pedro Alves

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=200808091211.m79CBGfO008457@brahms.sibelius.xs4all.nl \
    --to=mark.kettenis@xs4all.nl \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox