From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5484 invoked by alias); 11 May 2008 16:13:28 -0000 Received: (qmail 5475 invoked by uid 22791); 11 May 2008 16:13:27 -0000 X-Spam-Check-By: sourceware.org Received: from zigzag.lvk.cs.msu.su (HELO zigzag.lvk.cs.msu.su) (158.250.17.23) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 11 May 2008 16:13:10 +0000 Received: from Debian-exim by zigzag.lvk.cs.msu.su with spam-scanned (Exim 4.63) (envelope-from ) id 1JvEAZ-0005Oy-B6 for gdb-patches@sourceware.org; Sun, 11 May 2008 20:13:06 +0400 Received: from localhost ([127.0.0.1] helo=ip6-localhost) by zigzag.lvk.cs.msu.su with esmtp (Exim 4.63) (envelope-from ) id 1JvEAZ-0005Ou-6f for gdb-patches@sourceware.org; Sun, 11 May 2008 20:13:03 +0400 From: Vladimir Prus Subject: Re: [RFA] Report the main thread. To: gdb-patches@sourceware.org Date: Sun, 11 May 2008 21:10:00 -0000 References: <18469.39280.284106.858072@kahikatea.snap.net.nz> <18470.7609.400548.29643@kahikatea.snap.net.nz> <20080511155232.GH28890@adacore.com> User-Agent: KNode/0.10.5 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit Message-Id: 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-05/txt/msg00360.txt.bz2 Joel Brobecker wrote: >> > I just want threads other than the main thread to be reported, as >> > used to be the case. > [...] >> > That way I can create a threads buffer and display the thread >> > number when there is more than one thread. >> >> Cannot you just suppress display of thread list if there's just one >> thread reported, on UI side? > > I think it is important to be consistent between interpreters. > If we have the annotation for MI, we should have it in the annotate > mode as well. > > There has been a discussion earlier about the merits and drawbacks > of adding the main "thread" to the list of threads when debugging > an application that doesn't use threads. We only considered the > perspective of the user, but there is indeed the case of front-ends. > Assuming that the decision still stands, I think it is reasonable > to ask the front-ends to check that there is more than one thread > before going into "thread" mode. I understand that this is making > things a little more complicated, but it shouldn't be that hard. > > On the other hand, if there is a way to detect that the new "thread" > is from an unthreaded program, we could decide to not emit the > notification. I think we're just trading different complexities here. Using "single-threaded program has a single thread" notion simplifies for frontend the task of building the the internal representation of program. On the other hand, if the frontend wishes to display just frames, and no any thread items, for the case where the program has just a single thread, it requires some extra logic -- presumably, just using different object as the root of some treeview widget. And in my opinion, helping build accurate representation of a program is what MI is about. Representation issues is what GUI toolkits are good about. > But I would like things to be consistent - it should > be the same for both CLI, MI and annotations. Should CLI and MI be 100% consistent? They have different target audience. - Volodya