From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2496 invoked by alias); 27 Apr 2008 15:03:49 -0000 Received: (qmail 2488 invoked by uid 22791); 27 Apr 2008 15:03:48 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 27 Apr 2008 15:03:31 +0000 Received: (qmail 20294 invoked from network); 27 Apr 2008 15:03:29 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 27 Apr 2008 15:03:29 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [RFA] Report the main thread. Date: Sun, 27 Apr 2008 16:07:00 -0000 User-Agent: KMail/1.9.9 Cc: Mark Kettenis , drow@false.org, nickrob@snap.net.nz, vladimir@codesourcery.com References: <200804262005.18646.vladimir@codesourcery.com> <20080427135246.GA9333@caradoc.them.org> <200804271422.m3REMxVF009472@brahms.sibelius.xs4all.nl> In-Reply-To: <200804271422.m3REMxVF009472@brahms.sibelius.xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200804271603.27832.pedro@codesourcery.com> X-IsSubscribed: yes 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-04/txt/msg00622.txt.bz2 A Sunday 27 April 2008 15:22:59, Mark Kettenis wrote: > Seriously though, in GDB we've always only populated the threads list > if a program actually has threads. Would that be true if threads had been implemented in GDB from the ground up, instead of being an afterthought? > An MI client will have to deal > with that fact. If it insists on providing a threaded view of the > world, it needs to fake up a main thread. Since it already has to do > that for non-threaded programs, why would having a false thread create > event for the main thread help? If a command is defined to take --thread=$gdb_thread_id as a parameter, it is awkward for the frontend to have to do something different on single-threaded apps. E.g., no --thread parameter means all threads, or the main thread in ST apps? A GDB thread id is also what can be made constant even though the ptid of the main thread may change due to loading thread support. (My secret xmas wish was for GDB to consider threads a first class citizen, and get rid of the infrun.c context switching.) -- Pedro Alves