From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 105902 invoked by alias); 20 Feb 2017 16:18:39 -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 105836 invoked by uid 89); 20 Feb 2017 16:18:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3 autolearn=ham version=3.3.2 spammy=xy, Notify, UD:Y, XY X-HELO: sesbmg23.ericsson.net Received: from sesbmg23.ericsson.net (HELO sesbmg23.ericsson.net) (193.180.251.37) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 20 Feb 2017 16:18:33 +0000 Received: from ESESSHC012.ericsson.se (Unknown_Domain [153.88.183.54]) by (Symantec Mail Security) with SMTP id 8C.25.05944.7D61BA85; Mon, 20 Feb 2017 17:18:31 +0100 (CET) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (153.88.183.145) by oa.msg.ericsson.com (153.88.183.54) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 20 Feb 2017 17:17:55 +0100 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=simon.marchi@ericsson.com; Received: from [142.133.50.93] (192.75.88.130) by DBXPR07MB400.eurprd07.prod.outlook.com (10.141.14.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.5; Mon, 20 Feb 2017 16:17:25 +0000 Subject: Re: [PATCH] Add "thread-group id" and "id in thread-group" info to -thread-info output To: References: <20170119144130.4341-1-simon.marchi@ericsson.com> From: Simon Marchi Message-ID: <7bbd57e2-f35d-88fe-8b44-4bb5dff9b60b@ericsson.com> Date: Mon, 20 Feb 2017 16:18:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20170119144130.4341-1-simon.marchi@ericsson.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MWHPR14CA0013.namprd14.prod.outlook.com (10.173.227.23) To DBXPR07MB400.eurprd07.prod.outlook.com (10.141.14.152) X-MS-Office365-Filtering-Correlation-Id: c128131d-134c-44a0-ce5e-08d459abf5dc X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:DBXPR07MB400; X-Microsoft-Exchange-Diagnostics: 1;DBXPR07MB400;3:u24XVfYd8MDZ3hWwAPuSl4WNSbBYr15srTSjP+8eKM8X6cA7EEe69IbKDRvrMp2SOMAKu0vZ41PTnBym17yHbdGPpZcibxjYZaRRwlw/Zw9onq3wpPZeIuW06RSG1qU18hWbdNx4ecDknSww3+1cNgojsprWwkmH0iMtg3uYYvg/oEnuSAIGV+Ng9uYKEtqBnn0PC/WcZrGLx+e9DUhzOyCEKvcL5sL+9LDl/fj3mOYJuiD1KjjKAHni3dZ1CHmelDd5mq2uGLaapgwKgzedOA==;25:LNgVihCdUydOooy+CF2LEJXG20SOVkfOXShwiIIwPF+GLgb+BnTWdBq6bWU9BhPCz+sOfbg0GMryKGaY/j8AJ0RevuiFTGaWvemAuQK+FmNhPIhRq+0hJP2qoLaA9U4odtLOpbkz871exCr50byNSAEH44Tj1r/uvnKkU5EOViRlkpdsmdMjZWUb3l/hwlP35cLszXrjoMqhQr2GwvI87vn/kcw1z3OlFckX/4nz0g1MtPqIEnmMSyZ76gcv+WMFd4ZLaaGBUyY2QCSKIAXGNmEpVGTNQWhe7cHT+6zZFjsq/0bHSq3sx+jRouATd4yHyoQ++Ak6Zl+7nvPrE28Fs7Bxj2trmotM3vhbie5UfJP6VBBIu7PH/BM4G7nA8LpP9XLGf9pdI7GWWnMDQEw/QgXZ7gWq+0HJOKdGVOXkVTX0AuMq2zgzfYOGlzgisWsGvXtV01GnkHCHWxGOtJ+png== X-Microsoft-Exchange-Diagnostics: 1;DBXPR07MB400;31:HjRvFFG3fjYLV7LUmj15rMGU0TWYiKdpRXGLe3/cqlUzpH+fRX581SNZToZwYfENG9QsKEW+VaxBL//aLtzEjVA+foNadFp6gGZYi7Rny6w133MncfJGcBFamSlYu2KCNBxDbcwgyh2TJGASDcnkE5q5OqNzJbLeEu8oJzMJzXS8b1i6DeoH8pISmmLZ8rb1JVMKr1W6TexbmjdlLfIxHWQsFhzj7gMNhb4fuamo2i8So7Bdf3mcByT/S/wkqJwy;20:j7YLoiivD+JHyBluFuAGLmpD2uYptK0HgCk5zagLU7Enj7dDkjWqbNaUi3x4jZOSqzNun0dcOPtiNJBf1eL8czzy3UmgIulKFY3f/U2MzDhYdwKIyalgHMiHxTK8s94lasR2b5sYS3zGLPnQjj1bClfGUXj0E3JmEg0OgMeRCjGla5uLB9IaW1CtNmPJIFUUMsrQdU225T8PHMPvthEtegmbPg20pexx7Mj9ilmmsw+pM6AXIIlKBvIyKjd8i4LNSFa5eTis7mIkV5hjZG/m71Jk3kvoaE+CrElXw5vqyCDnuqwoEt/+1tgICKSPI2fdmUYXYx2LKTK0T9KVsEj64F+N6jrF1DjeyAFgzUx0OyKmzDhAulCGuSF36Oe7LgAbJXkNASnuyOFpQAVKMI4tV9R+W1UXwa/xa13cT0p/LfzfOfVP5K87Y1a7o0W80ZcKgxgwobypDkkRftPOEh8fsrAfeqFTv5MuRENhbXWQnqDhJr2o/Qo70nYaIiFmSbEi X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(250305191791016)(22074186197030); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(20161123558025)(6072148);SRVR:DBXPR07MB400;BCL:0;PCL:0;RULEID:;SRVR:DBXPR07MB400; X-Microsoft-Exchange-Diagnostics: 1;DBXPR07MB400;4:f+u86di9hEObKPt1b1o+n77bMaUZVq7FeLkqJMwy4fLsDRnLmmi+Fg722KwO6pfFRDcFbRlaP++ggNs7s3P4wTgWWuXrdDqE/LCMZkYclv/O6E/E6Yn4UdhCe+h9/3sQbhUpu573gepaa2wHVv49Ppb3W0A8VK2Y+8kD/F6q2KpnXzoYgM6wSNDCV5TBykrInBlgbldejDsWmBc95O/Ckp58lSnHuPV0QOsH3UnFjfO9/GQCht1l4Og73EHPWGDlVK44yXmw2on+VSmmZCAsFKrMkNyfYdL83ItiFGze7GhJR2pslySdqc0jlf9IwH2Z9lUnPVTCLeO8hpmsMqX+3kAPhiWgGn3TKmjQpiYVokqHNpa4s2JOkzZroYozjtTEkkL7mkPEnoEva+Dpl2GedwZl6v1HXRGuJ9fLcQ/6hP76nb9ej4eoUJojNkSxPWe+s/InW5Sv8iFDAI49H62dMMUAuFws0x7uGLZckoXBsm6GaAX5F/X0scAqB0bEucn/JpuSYRt+vsZJMUi26GTJIPQtwfthXpDAK7A20U+sluxZZRgVI2Nt3uWEprTErIrDyrmnUTAlCUclfqfAhSiZF5z+pUqpizV/8pFuMSjPwdsaf0N2eHVMDG0oQ6a4DLdwQYc4AXJHqCk6N1VJxSsWbLPwRVmLeasIbwFVV5CqqE5oj5VlMNNaLqasLlYuC9ax X-Forefront-PRVS: 02243C58C6 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(6049001)(7916002)(39450400003)(24454002)(54534003)(199003)(377424004)(377454003)(189002)(3846002)(65956001)(65806001)(64126003)(105586002)(101416001)(110136004)(76176999)(54356999)(2906002)(50466002)(68736007)(31696002)(106356001)(6116002)(38730400002)(189998001)(66066001)(47776003)(83506001)(50986999)(36756003)(33646002)(23746002)(97736004)(86362001)(4001350100001)(92566002)(7736002)(2351001)(81156014)(81166006)(8676002)(31686004)(6486002)(450100001)(305945005)(42186005)(6666003)(25786008)(6246003)(2950100002)(6916009)(53936002)(53546006)(6306002)(65826007)(230700001)(229853002)(90366009)(5660300001)(2004002);DIR:OUT;SFP:1101;SCL:1;SRVR:DBXPR07MB400;H:[142.133.50.93];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;DBXPR07MB400;23:ASR4i2PGQBaUulws0AAvHosCTCW9aQCO9J0n3a?= =?Windows-1252?Q?aBDvbCXPYgvBz83VVIymdN+4e9H/4XDFBFkQPJ2k4kA9MQYx+yiIMJ60?= =?Windows-1252?Q?jp+b4ZN5O8QG+dJtkTIvxyoL0wq5aQAhtdWPfVSWTFLej3mKb8UrW6pj?= =?Windows-1252?Q?Oa2HULy0pQVnrSLJ6wnPXpslvleNFjbsiFmHvVncunViOOGdwhCPZG+r?= =?Windows-1252?Q?wN+UIBeXUAf79UUx0Z5JaGnsjE9Mn1iWUVClWZvXajnZ5+LnuwXaMOPn?= =?Windows-1252?Q?LLkj/j94KvGSbmQqu1zxVF8u1Vlq59VR/SfNG/+/l550/kXxGE3nBpHP?= =?Windows-1252?Q?UqbvlPTD16a1wtPunwj9kqlCPhwQNq0mK7Cc7HTUhZ4sfK4ytFtpDtOh?= =?Windows-1252?Q?F2jlYiG/2A5FReAGqXPRDMzHy5y8jzn9f0B+ye39Fz9hqR/M817oI3Zr?= =?Windows-1252?Q?zxuX/lxCewXyojd5X2F+Gf1ttsCjV8wfGn0fL63LtDWHrMyCxFMKLo4R?= =?Windows-1252?Q?UtIFXpMgvCYCiKNR/vGkJsbBGYGWc1dbJSBdmUvSd3FOQfUpRznDw4pY?= =?Windows-1252?Q?nlYebaiscTIVcL2wZbHwafBJS+Nrz2FOYxqLVuLTDqLjwGAddSs4zSnR?= =?Windows-1252?Q?lNLolabyB02fRnjUGIF1jXGtaate6dInLs/k4FLciJoX33eLYDzEgxAA?= =?Windows-1252?Q?o5+d54gw5VMVvP5KTs0sw6EDEFIqmlhNnACvgKynwkjGwiqeV8mmxRTs?= =?Windows-1252?Q?yDT30U2XPcoyDv75MhI4EkJ9Pf2zy0RGqw7xU0OZ/mg0+DLnohcdisdR?= =?Windows-1252?Q?0ItAm/F8XweeV4TRjNCBdatqP3FmD0AtACcCa4vbIKBqmFmu3E9phIyk?= =?Windows-1252?Q?N945hcknl/+JV9LDAXoe04UxvFFRhrtudU+fCtu6oOxEVX5Hhu1SeFn7?= =?Windows-1252?Q?BBJ8eM8Dbc8sbP/5hj87OMtV1jU8u6MNC68fSpFWBdJNuIkirvvqeBRL?= =?Windows-1252?Q?jVyRKlpjsQ4MKNqvgAdAyY3nb/7zAuCpIFYNSnnddkaqwUiSO2OADEaO?= =?Windows-1252?Q?6Y0TKfEOoPpCL2ZcACeP3I4KcATG9CyjTUhrqEAfc+Q3X3+9vo0zmq51?= =?Windows-1252?Q?XEYEGbJHSTrSyI7fuAyurM9oeEp3Gh7nx0ear7QOc12BgyxBiiUfSScN?= =?Windows-1252?Q?WBlrOcCYgip3Wl995Q9xLljLsqCZfWyEksFM7uXvGIAzB24ZuUmH416N?= =?Windows-1252?Q?/4gJv1YJpeXmC8ZrgWMwnbhdkZudsFtmOGW9cbc7GOdn4Bs8y+KyHYA3?= =?Windows-1252?Q?DD8GA2SeYKdgOd6FMvnS9opVXNheKUV8RS/3WhljEH2ng7+M9DS/NVrM?= =?Windows-1252?Q?EvA6zuzmfTZlasOJ/5AvQN57giiddBONMzvvK3x08d4PPb17KDDBwgZn?= =?Windows-1252?Q?imax6iOIhMZXBenXSK/IsAdN0gtQ0skbDr2xO0dnrwlk685QgHb8bH0H?= =?Windows-1252?Q?FvyXyV4DCahfn3lyNRFUakILVduffq5nue6BS1JuEL/KeCH+yggr8sl2?= =?Windows-1252?Q?hTkRtZvjcWijN0dztgrs+T9jdO/b6bVoTwFDF+ROWfkyGCHOPfdrtcxw?= =?Windows-1252?Q?=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;DBXPR07MB400;6:GZjsKU8scWLO+p2ilOHbE77cmwMjE1kWpqqRVxaI0TF5Ch1ynSyUwy+S41JGdd8BFrxOlx/1oAg/6L1wITgeuft1ToLttecrETaWN/AquaroPZZGfW80jmQfISunmmomP7pmZwhQLGQUm7FFQ0ft3ehGSlBRPZ+Hx2snUimZH+s0m57jQ+c4DfKTSkhYUPfeQHRD/4vGkg0KHwBxWFMpdhuG3/RdozJQXEpMhub75+kfSmLX7PnPHvl+E7Dl015YRHI9lgutXJQ8KOEOxNa3Scvz7g7ks2zc4ZkDHFBLOJhFLNWXTGQ/cU5rmqPX4KCjXX3JdKkTXmshHPeC4a/IurOm/EeC8YbE3gcBgSfm5ovLf38DfKoYd0eVXbHgYptnT76LTAwLexbcwJY74U375w==;5:FxzvTqQYA5jJHjHoqt1qOotWUf01p36LOa9nYS5hA2BPLlnOmdncCH7+5Azq6pvjjR5ub4nHOAbuslMZN/RJPdHRHrcXwOdn998tJj8gBMBDKWUIhlVKOJlpH3oRPbqKl7fArIShLc+ifyidh5T3+w==;24:uqefVp/a0v/uaztKfvfGsBc3tLiGuu5GWImrOK2fUXLqI7chvvLNXf2/oQEXazju3fYwqImRz4KVG7yay200Q47FkeXfVVaLrLIeED3TduU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DBXPR07MB400;7:UJ6dP+Nd/fmdbgvBS67YYri2x1tpGzai1aErxUsT8l+eX3pyahVAYgT3C093LLxIpBoxkXQqc8/1iMPfEzqA/cUnaZxOJwnIicb9vCXC42GgBmoLmDEAJi07jR2TM/tBL2BCacSuc3k56aQi0ZDSj1symeCIfQfQA8DMApPDS/Fd6PWDhNcSvxx7A8E8XCOO2FTC0+yjBt2DeH64l0Os5sTYzSGsZo3NwyS8hRNA1UYOKsr7fgmlXvYm/3QfxiqcChYWhBcUm+KZCUMo/KzSfarMyF2T4DC00ri0jjdCjtpKKtgXXDQ+KQEVcT+Funw+MZJMkrmJmg5oKkYGcS0OiA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Feb 2017 16:17:25.9000 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBXPR07MB400 X-OriginatorOrg: ericsson.com X-IsSubscribed: yes X-SW-Source: 2017-02/txt/msg00544.txt.bz2 On 17-01-19 09:41 AM, Simon Marchi wrote: > The CLI has been showing inferior-qualified thread ids for a while, but > front-ends have no way to do the same, as only the global thread ids are > included in the MI output. In front-ends in general, but mostly in > those that include a gdb console, it would be interesting to show the > same thread id in the GUI than what "info threads" displays. The user > would then see consistent thread ids across the two UIs. > > This patch adds two extra fields to the -thread-info MI command output. > In this snippet of prettified -thread-info output, the lines marked with > a + are new: > > { > + tg-id = "2", > + id-in-tg = "1", > id = "3", > target-id = "Thread 0x2aaaaab04640 (LWP 3228)", > name = "mi-qualified-th", > ... > }, > > Here, the thread has the global id 3 (monotonously increasing across all > inferiors) and the inferior-qualified id 2.1. The global thread id is > still the one used throughout the rest of MI. The new fields are simply > intended to be presented to the user. > > We chose adding the new information as two separate fields rather than a > single field with the value "2.1". We think that it gives the front-end > more flexibility about how it want to present the info. > > Note thatt I renamed the existing CLI field "id-in-tg" to "qualified-id" > and named one of the new MI field "id-in-tg", because I found that > "id-in-tg" described better the Y in X.Y, and "qualified-id" described > better the whole thing. It's not a big deal, as the field name is never > shown in the CLI. We have to carefully choose the new names however, > since they'll be exposed in the MI. > > gdb/ChangeLog: > > * thread.c (print_thread_info_1): Rename field id-in-tg to > qualified-id. Add new fields id-in-tg and tg-id when printing > on MI. > > gdb/testsuite/ChangeLog: > > * mi-qualified-thread-id.exp: New file. > * mi-qualified-thread-id.c: New file. > --- > gdb/testsuite/gdb.mi/mi-qualified-thread-id.c | 57 +++++++++++++++++++ > gdb/testsuite/gdb.mi/mi-qualified-thread-id.exp | 76 +++++++++++++++++++++++++ > gdb/thread.c | 11 +++- > 3 files changed, 141 insertions(+), 3 deletions(-) > create mode 100644 gdb/testsuite/gdb.mi/mi-qualified-thread-id.c > create mode 100644 gdb/testsuite/gdb.mi/mi-qualified-thread-id.exp > > diff --git a/gdb/testsuite/gdb.mi/mi-qualified-thread-id.c b/gdb/testsuite/gdb.mi/mi-qualified-thread-id.c > new file mode 100644 > index 0000000000..cb50e50c32 > --- /dev/null > +++ b/gdb/testsuite/gdb.mi/mi-qualified-thread-id.c > @@ -0,0 +1,57 @@ > +/* Copyright 2017 Free Software Foundation, Inc. > + > + This file is part of GDB. > + > + This program is free software; you can redistribute it and/or modify > + it under the terms of the GNU General Public License as published by > + the Free Software Foundation; either version 3 of the License, or > + (at your option) any later version. > + > + This program is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + GNU General Public License for more details. > + > + You should have received a copy of the GNU General Public License > + along with this program. If not, see . */ > + > +#include > + > +static pthread_barrier_t barrier; > + > +static void * > +thread_func (void *arg) > +{ > + /* Notify the main thread that this thread has started. */ > + pthread_barrier_wait (&barrier); > + > + /* Wait until main gives us the signal that we can quit. */ > + pthread_barrier_wait (&barrier); > + return NULL; > +} > + > +static void > +thread_started () > +{ > +} > + > +int main () > +{ > + pthread_t thread; > + > + pthread_barrier_init (&barrier, NULL, 2); > + > + pthread_create (&thread, NULL, thread_func, NULL); > + > + /* Wait until the thread has started. */ > + pthread_barrier_wait (&barrier); > + > + thread_started (); > + > + /* Tell the thread that it can quit. */ > + pthread_barrier_wait (&barrier); > + > + pthread_join (thread, NULL); > + > + return 0; > +} > diff --git a/gdb/testsuite/gdb.mi/mi-qualified-thread-id.exp b/gdb/testsuite/gdb.mi/mi-qualified-thread-id.exp > new file mode 100644 > index 0000000000..43c1409786 > --- /dev/null > +++ b/gdb/testsuite/gdb.mi/mi-qualified-thread-id.exp > @@ -0,0 +1,76 @@ > +# Copyright 2017 Free Software Foundation, Inc. > + > +# This program is free software; you can redistribute it and/or modify > +# it under the terms of the GNU General Public License as published by > +# the Free Software Foundation; either version 3 of the License, or > +# (at your option) any later version. > +# > +# This program is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program. If not, see . > + > +load_lib mi-support.exp > +set MIFLAGS "-i=mi" > + > +standard_testfile > + > +if {[use_gdb_stub]} { > + # There is no point in testing inferior-qualified thread ids if we can't > + # have multiple inferiors. > + untested "multi-inferior not supported" > + return > +} > + > +if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { > + untested ${testfile} > + return -1 > +} > + > +# Prepare the inferiors. Start and run them until the "thread_started" function. > + > +proc setup { } { > + global binfile > + global srcdir > + global subdir > + global srcfile > + > + gdb_exit > + mi_gdb_start > + mi_gdb_reinitialize_dir $srcdir/$subdir > + mi_gdb_load ${binfile} > + > + mi_create_breakpoint "thread_started" "insert breakpoint at thread_started" > + > + # Start inferior 1 > + mi_run_cmd > + mi_expect_stop "breakpoint-hit" "thread_started" ".*" "${srcfile}" ".*" {"" "disp=\"keep\""} "inferior 1 stops" > + > + # Add and start inferior 2 > + mi_gdb_test "add-inferior -exec ${binfile}" ".*=thread-group-added,id=\"i2\".*" "add second inferior" > + mi_gdb_test "inferior 2" ".*" "switch to inferior 2" > + mi_run_cmd > + mi_expect_stop "breakpoint-hit" "thread_started" ".*" "${srcfile}" ".*" {"" "disp=\"keep\""} "inferior 2 stops" > +} > + > +proc test_thread_info_qualified_thread_id { } { > + setup > + > + set expected [join \ > + { "111\\^done,threads=.*" \ > + "tg-id=\"1\",id-in-tg=\"1\",id=\"1\".*" \ > + "tg-id=\"1\",id-in-tg=\"2\",id=\"2\".*" \ > + "tg-id=\"2\",id-in-tg=\"1\",id=\"3\".*" \ > + "tg-id=\"2\",id-in-tg=\"2\",id=\"4\".*" \ > + } ""] > + > + mi_gdb_test \ > + "111-thread-info" \ > + $expected \ > + "thread ids in -thread-info" > +} > + > +test_thread_info_qualified_thread_id > diff --git a/gdb/thread.c b/gdb/thread.c > index e45b25750e..29cfa61e13 100644 > --- a/gdb/thread.c > +++ b/gdb/thread.c > @@ -1247,7 +1247,7 @@ print_thread_info_1 (struct ui_out *uiout, char *requested_threads, > uiout->table_header (1, ui_left, "current", ""); > > if (!uiout->is_mi_like_p ()) > - uiout->table_header (4, ui_left, "id-in-tg", "Id"); > + uiout->table_header (4, ui_left, "qualified-id", "Id"); > if (show_global_ids || uiout->is_mi_like_p ()) > uiout->table_header (4, ui_left, "id", "GId"); > uiout->table_header (17, ui_left, "target-id", "Target Id"); > @@ -1282,8 +1282,13 @@ print_thread_info_1 (struct ui_out *uiout, char *requested_threads, > uiout->field_skip ("current"); > } > > - if (!uiout->is_mi_like_p ()) > - uiout->field_string ("id-in-tg", print_thread_id (tp)); > + if (uiout->is_mi_like_p ()) > + { > + uiout->field_int ("tg-id", tp->inf->num); > + uiout->field_int ("id-in-tg", tp->per_inf_num); > + } > + else > + uiout->field_string ("qualified-id", print_thread_id (tp)); > > if (show_global_ids || uiout->is_mi_like_p ()) > uiout->field_int ("id", tp->global_num); > Ping.