From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27675 invoked by alias); 14 Nov 2008 18:55:48 -0000 Received: (qmail 27621 invoked by uid 22791); 14 Nov 2008 18:55:47 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 14 Nov 2008 18:55:12 +0000 Received: from mailhost5.vmware.com (mailhost5.vmware.com [10.16.68.131]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id C52602E007; Fri, 14 Nov 2008 10:55:10 -0800 (PST) Received: from [10.20.92.59] (promb-2s-dhcp59.eng.vmware.com [10.20.92.59]) by mailhost5.vmware.com (Postfix) with ESMTP id B8BD9DC0E0; Fri, 14 Nov 2008 10:55:10 -0800 (PST) Message-ID: <491DC976.4050506@vmware.com> Date: Sat, 15 Nov 2008 04:58:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: Vladimir Prus CC: "gdb-patches@sources.redhat.com" Subject: Re: [RFC] Implement -list-thread-groups. References: <200811122333.29218.vladimir@codesourcery.com> <200811142028.43561.vladimir@codesourcery.com> <491DB7E3.9080603@vmware.com> <200811142100.56244.vladimir@codesourcery.com> In-Reply-To: <200811142100.56244.vladimir@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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-11/txt/msg00369.txt.bz2 Vladimir Prus wrote: > 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. Even if it makes no sense in the sense that it's not required, that doesn't necessarily make it an error. Suppose somebody specifies both the pid and the thread? What's the harm? If they're inconsistent (this pid does not contain this thread), THEN we'll return an error.