From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2985 invoked by alias); 14 Nov 2008 18:01:35 -0000 Received: (qmail 2898 invoked by uid 22791); 14 Nov 2008 18:01:34 -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; Fri, 14 Nov 2008 18:00:59 +0000 Received: (qmail 4253 invoked from network); 14 Nov 2008 18:00:57 -0000 Received: from unknown (HELO localhost) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 14 Nov 2008 18:00:57 -0000 From: Vladimir Prus To: Michael Snyder , gdb-patches@sources.redhat.com Subject: Re: [RFC] Implement -list-thread-groups. Date: Fri, 14 Nov 2008 21:45:00 -0000 User-Agent: KMail/1.9.10 References: <200811122333.29218.vladimir@codesourcery.com> <200811142028.43561.vladimir@codesourcery.com> <491DB7E3.9080603@vmware.com> In-Reply-To: <491DB7E3.9080603@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811142100.56244.vladimir@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-11/txt/msg00361.txt.bz2 On Friday 14 November 2008 20:39:47 you wrote: > > > diff --git a/gdb/thread.c b/gdb/thread.c > > index b1e318d..a32dff4 100644 > > --- a/gdb/thread.c > > +++ b/gdb/thread.c > > @@ -636,9 +636,10 @@ set_stop_requested (ptid_t ptid, int stop) > > use from MI. > > If REQUESTED_THREAD is not -1, it's the GDB id of the thread > > that should be printed. Otherwise, all threads are > > - printed. */ > > + printed. > > + If PID is not -1, only prints threads from the process PID. */ > > For completeness and consistency, how about adding > "Otherwise, threads from all attached PIDs are printed." Ok. > > void > > -print_thread_info (struct ui_out *uiout, int requested_thread) > > +print_thread_info (struct ui_out *uiout, int requested_thread, int pid) > > { > > struct thread_info *tp; > > ptid_t current_ptid; > > @@ -646,6 +647,8 @@ print_thread_info (struct ui_out *uiout, int requested_thread) > > char *extra_info; > > int current_thread = -1; > > > > + gdb_assert (requested_thead == -1 || pid == -1); > > I'm puzzled by this assert. > You don't think we'll ever want to specify both the pid and the thread? I think that makes no sense. If a thread is specified, then there's no possible use of 'pid'. Threads are globally numbered. - Volodya