From patchwork Thu Jan 19 14:41:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 18955 Received: (qmail 10472 invoked by alias); 19 Jan 2017 14:42:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 10416 invoked by uid 89); 19 Jan 2017 14:42:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 spammy=H*r:sk:EUR01-H, gid X-HELO: sesbmg22.ericsson.net Received: from sesbmg22.ericsson.net (HELO sesbmg22.ericsson.net) (193.180.251.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 19 Jan 2017 14:41:51 +0000 Received: from ESESSHC002.ericsson.se (Unknown_Domain [153.88.183.24]) by (Symantec Mail Security) with SMTP id 67.3F.15498.C20D0885; Thu, 19 Jan 2017 15:41:49 +0100 (CET) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (153.88.183.145) by oa.msg.ericsson.com (153.88.183.24) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 19 Jan 2017 15:42:41 +0100 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=simon.marchi@ericsson.com; Received: from elxcz23q12-y4.ca.am.ericsson.se (192.75.88.130) by DBXPR07MB397.eurprd07.prod.outlook.com (10.141.14.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.6; Thu, 19 Jan 2017 14:41:46 +0000 From: Simon Marchi To: CC: Simon Marchi Subject: [PATCH] Add "thread-group id" and "id in thread-group" info to -thread-info output Date: Thu, 19 Jan 2017 09:41:30 -0500 Message-ID: <20170119144130.4341-1-simon.marchi@ericsson.com> MIME-Version: 1.0 X-ClientProxiedBy: MWHPR21CA0008.namprd21.prod.outlook.com (10.173.47.18) To DBXPR07MB397.eurprd07.prod.outlook.com (10.141.14.146) X-MS-Office365-Filtering-Correlation-Id: 38350029-6899-40cb-a54f-08d440794bc9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DBXPR07MB397; X-Microsoft-Exchange-Diagnostics: 1; DBXPR07MB397; 3:N0PMks+0dDOju1LbOyrnepDkjEPKJkHCJw1LNnudlv0DSTxBZVvYLkwruVklODF+loZuGDxIHZg1A9qSjSDczQvjjpjhiRdMfHgKMKGJNtYPAFIRY9Uo/cxoHuOMaFme37lunFYTX8PRvNmwj+mIvNyR7bgYwVEVDIb0AWJwWP/5UvE44ngDRHBJ9kXoQHl/Pa/8WPTrIgQsgkElb28R1k0/xrNAY79Goxn8rDvAOIsRok3zWfzkWfCJnkzXwDwzCk7dmiKe2w40cxzpxTAp3A== X-Microsoft-Exchange-Diagnostics: 1; DBXPR07MB397; 25:wOCpZAEmOfh76uryli6ssvO6/puIo2wsUa9cxLHOC2zDX+uFcep7KFMJB04/rchX1bagu+nUGjOtphqrFkwQqYYywTtw5lbPtA8/J6TKnBy77Eaf4pVH34ATzFM6BWed7Sy2LzyELFGlYTQIsqJYh8ccY9fhfSySiKtMIZfD7csAPpoYrC3JikpGbdEhSO2hQpynUJZ6/tGbnvoKdCmQsUj80X8hOQMY80NfE+lo9nBIvZ6feBJg4hCIy5VhBUgijAs3HcFEGrcz4XvbD2lnibB/fGxidcVK5inJQ1fL8rW714A2ifrdCTY6vIBoY6G+3sHShpj7TS/UNiMNFuTUax/cVm8tar3d8jYmdvHYF/I/2PmocGlDCWIQqCTq4XKJ004XL5yxy4N8RLSfgZxIW5GArFVjeYdNAZ+oUdWfaj9pFkqipr+B/olM3Fqzzc1uHAaVEmLueRD78/yMawJ6mt4bWyeY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DIAqaKCZvb4yAOFQCGf+H735c0WAATJL7955hXb8tH4VVSGKwBSJKOyhHrR10b1BsabH7fzmQRPaaxa4riKjRrj0UyAYZEI3Q4gL080ZIwOqSzo8gs32D+X9nYytPWES8+C6XoYzwWXV5ywaLFTMfDhG 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)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123555025)(20161123562025)(20161123560025)(20161123564025)(6072148); SRVR:DBXPR07MB397; BCL:0; PCL:0; RULEID:; SRVR:DBXPR07MB397; X-Microsoft-Exchange-Diagnostics: 1; DBXPR07MB397; 4:i30/3euQix7bLUKa4q2YdmK/tt8Uk4e7STgKi3+IIaKBW6hCSFcpnHsFNqZ9R0878wO4L+vhdKwNWWZyItb4jkhB/221BGiJ/qjjw3uvu9JWjbpdMoUwL2+THEnD7e11DPM/B5npCuW/N9ABNQ35HEFBoDi+QhC0C5YhCjhjHqzdXWJG/6TfWvHhxv9pT2XHuVrcPZ5cuJFIpC28nGYKegjuoS059R/rXEHIe7LKKPid9ol4Nt1Bb16POEKdzv9FWe3lSHcify81CJN9EqRWqaiK6WpViTrduQbG+vLGhJbsl40FHRkU7wRHecxwQ8I+wXOgTFXPdmYU3NfmCUR5s/t+BSc27oLBVe5vSwS+7gxeVJ7F1Yx0qUNwAXzZepFYBk707V6mwiesEbz1Cw5xNzx94JrM77eX7OP8OFMbPKDaAmTedngywxoZew3RhH/RdL0phYSbvs1CZlfTvE2YlpUExd5bhQ9whhr2A38uabRSdl4thVkM+y5OeJeBQ+M2O1RU6AMEqfxVmFrXkDq/E5+KO721HN6FthwpiGTRAai3q6mwrWMELgas+TWS7lFrCVpGCS0qke+74zNNJgEb+osF9spw67CBUfFYW1qGouQ95cItcQ72otI2vfvSmnkkrydjDg0trGAiAlx2F4jVjA== X-Forefront-PRVS: 0192E812EC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(189002)(199003)(54534003)(48376002)(189998001)(6306002)(305945005)(6512007)(38730400001)(7736002)(92566002)(6506006)(5003940100001)(6116002)(81156014)(8676002)(47776003)(25786008)(33646002)(50226002)(50986999)(68736007)(6916009)(50466002)(6486002)(81166006)(5660300001)(4001430100002)(4326007)(1076002)(110136003)(450100001)(3846002)(6666003)(101416001)(2906002)(97736004)(86362001)(107886002)(36756003)(42186005)(106356001)(105586002)(2351001)(53936002)(66066001)(2004002); DIR:OUT; SFP:1101; SCL:1; SRVR:DBXPR07MB397; H:elxcz23q12-y4.ca.am.ericsson.se; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DBXPR07MB397; 23:REeO+zaP2aGE2LGgugaq22HbQbcGoWuCNH9oOgMzWd?= =?us-ascii?Q?eA6D6u42LRGlGhn8Mxf1zmWt5ExTqy1cwnZIteOtLAUlw8RkyLCrMOLm/TuE?= =?us-ascii?Q?1PmSJ4K+f+DA185ysvrP54ffevhW80cLlEgEzZCYE6RnkaDRocHGwntEUKQu?= =?us-ascii?Q?NbB8k8GKH/BUzVZj7sxY5UcZwZRQ4Y1lfri0Q7MEyBUjfeXAER1tDl22pSpL?= =?us-ascii?Q?5JHSp36QORx7G7mAgowjs9oxJ22PSEhnNa5ArM75AE0xp1sfPfJY1IgFYqGI?= =?us-ascii?Q?DEe2kFh6h7np+Hdp+ahu88pUA1LFufJ67mK0JzMTb6AHLbUzTra+vEAaDfBF?= =?us-ascii?Q?ayB9oA/haLsHdt7nrc9F9Tzzlz1f+oF2Ei/S36e41XJcvdARPlAET70GWI99?= =?us-ascii?Q?bcH1rSOCzo0wF9IBSTT6yOpS/zkFswfykkGpbsOF9+o+5ubMiBfaRc0NOOzM?= =?us-ascii?Q?A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EWPKOYCymmLpLEnwAvOh26ADJ7ESqQpIuRU3iXHb04bLy3fpV3XFMfIno/xf3QPVx6YYC6IigI4OShIWabhdS/o6tcsH9VdVMAuQMyGYQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2017 14:41:46.4342 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBXPR07MB397 X-OriginatorOrg: ericsson.com X-IsSubscribed: yes 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);