From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 38020 invoked by alias); 17 Mar 2017 15:27:42 -0000 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 Received: (qmail 38010 invoked by uid 89); 17 Mar 2017 15:27:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.0 required=5.0 tests=AWL,BAYES_40,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=threadinfo, thread-group, H*f:sk:480e785, id-in-tg X-HELO: mail-wm0-f45.google.com Received: from mail-wm0-f45.google.com (HELO mail-wm0-f45.google.com) (74.125.82.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 17 Mar 2017 15:27:40 +0000 Received: by mail-wm0-f45.google.com with SMTP id 196so9358322wmm.1 for ; Fri, 17 Mar 2017 08:27:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=0YljPxToWOtESl2iK3mAGkBfRDd+rXKTTHmT0eoXVZc=; b=R/J67tCWjGmxdxxLVLGRff9+a9iXgobq3UHrx6/Bs4QXBfe+vaIpbrF+xnoyk6HZS0 fRi8Hd0q6fNvP/WiFmj+yHcxGoc2Lywqdm935HzGFTrb42xwG8eFpRHxU2hj7C+4dLSX yrp9fXCmMfAX9CQMRaQSp8CBXp9aaUCW17BbtN3OsCsPUTLb4/UQ4lq6s7fIWNecY4vg f5qAG9s9T5w1URov6i3A4ao8yeAZNV/1uxZonOw95iR7pguoQUFnB+F13M7NKomNQgZm 2F2+4eD0pJrMSZVla1Yl3fkh2mwqPkNw/3er5zO033VhPMDgobt1NqQ6OUwQliVRIvtY eZgA== X-Gm-Message-State: AFeK/H3buN0I6Gkmqc8DndO+64mLfMNjviGwLLcseEXVMTQMxUNglgxgYv+iGkvIa0MERKNr X-Received: by 10.28.59.193 with SMTP id i184mr3586971wma.97.1489764459606; Fri, 17 Mar 2017 08:27:39 -0700 (PDT) Received: from [192.168.0.101] ([37.189.166.198]) by smtp.gmail.com with ESMTPSA id y4sm3034669wmy.5.2017.03.17.08.27.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Mar 2017 08:27:38 -0700 (PDT) Subject: Re: [PATCH] Add "thread-group id" and "id in thread-group" info to -thread-info output To: Simon Marchi References: <20170119144130.4341-1-simon.marchi@ericsson.com> <7bbd57e2-f35d-88fe-8b44-4bb5dff9b60b@ericsson.com> <2b68f0be-721b-08da-079f-9c1e05ae98b7@redhat.com> <480e785582e3631a5f693080f9855d2a@polymtl.ca> Cc: Simon Marchi , gdb-patches@sourceware.org From: Pedro Alves Message-ID: <111e1bcc-3848-3fd6-2fc5-39749582c4d3@redhat.com> Date: Fri, 17 Mar 2017 15:27:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-03/txt/msg00315.txt.bz2 On 03/15/2017 09:36 PM, Simon Marchi wrote: > On 2017-02-24 15:22, Simon Marchi wrote: >> While writing the documentation parts, these question popped to mind: >> >> - The type of the id-in-tg field (a string) assumes that a thread >> belongs to a single group. Currently, the only kind of "thread-group" >> we have is inferiors. The thread-group terminology suggests that in >> the future we might have other kinds of thread groups, like >> user-defined arbitrary groups. Otherwise, why would MI use "thread >> group" instead of "inferior"? Because of this, do you think that the >> type of the field will be limiting? For example, should we document >> right that this field can be a list, when a thread is part of multiple >> groups, for example? >> >> - The format of the id-in-tg field is "1" for inferior/thread-group 1. >> In -list-thread-groups, the id is shown as "i1". Again, if there are >> other kinds of groups later, we can assume that we'll need to >> differentiate the type, so just "1" won't work. For this reason and >> for consistency with the result of -list-thread-groups, should we show >> "i1" here as well? > > I thought about this a bit more, and I wonder if the solution is not to > just use "inferior" here. > > In MI, so far, the wording "thread-group" was used instead of inferior. > An inferior is one kind (and the only one at the moment) of > thread-group. Using "thread-group" instead of "inferior" allows to have > new kinds of thread-groups in the future, and still have commands that > make sense (e.g. -list-thread-groups, or the --thread-group switch). > > However, in this case, the information we want to convey is specifically > about inferiors, it will never be about other kinds of thread groups (if > some ever exist). Since a thread always has exactly one parent inferior > and exactly one id in this inferior, we don't have the single value vs > list problem. So I think it would make sense to use "id-in-inf" or > instead of "id-in-tg" and "inf-num"/"inf-id" instead of "tg-id". > > And I think that also takes care of the format issue, "1" vs "i1". "i1" > is the thread-group id. It is necessary to have the i in case other > kinds of thread groups appear. But if the field is "inf-num" or > "inf-id", then we no longer have the include the i. > > Thoughts? Makes sense to me. Thanks, Pedro Alves