From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26362 invoked by alias); 9 Aug 2008 12:13:24 -0000 Received: (qmail 26349 invoked by uid 22791); 9 Aug 2008 12:13:22 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 09 Aug 2008 12:12:42 +0000 Received: from brahms.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by brahms.sibelius.xs4all.nl (8.14.3/8.14.3) with ESMTP id m79CBG3p023268; Sat, 9 Aug 2008 14:11:16 +0200 (CEST) Received: (from kettenis@localhost) by brahms.sibelius.xs4all.nl (8.14.3/8.14.3/Submit) id m79CBGfO008457; Sat, 9 Aug 2008 14:11:16 +0200 (CEST) Date: Sat, 09 Aug 2008 12:13:00 -0000 Message-Id: <200808091211.m79CBGfO008457@brahms.sibelius.xs4all.nl> From: Mark Kettenis To: pedro@codesourcery.com CC: gdb-patches@sourceware.org In-reply-to: <200808091227.35031.pedro@codesourcery.com> (message from Pedro Alves on Sat, 9 Aug 2008 12:27:34 +0100) Subject: Re: bsd-kvm target, always a thread References: <200808080420.05897.pedro@codesourcery.com> <200808090832.m798Wvbc001860@brahms.sibelius.xs4all.nl> <200808091227.35031.pedro@codesourcery.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-08/txt/msg00233.txt.bz2 > From: Pedro Alves > Date: Sat, 9 Aug 2008 12:27:34 +0100 > > On Saturday 09 August 2008 09:32:57, Mark Kettenis wrote: > > > From: Pedro Alves > > > 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?