From patchwork Wed Apr 12 18:06:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 19998 Received: (qmail 118312 invoked by alias); 12 Apr 2017 18:07:19 -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 118297 invoked by uid 89); 12 Apr 2017 18:07:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=sc, Its, Whenever, HX-Exchange-Antispam-Report-Test:131327999870524 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; Wed, 12 Apr 2017 18:07:17 +0000 Received: from ESESSHC015.ericsson.se (Unknown_Domain [153.88.183.63]) by (Symantec Mail Security) with SMTP id 94.F6.27378.3DC6EE85; Wed, 12 Apr 2017 20:07:15 +0200 (CEST) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (153.88.183.145) by oa.msg.ericsson.com (153.88.183.63) with Microsoft SMTP Server (TLS) id 14.3.339.0; Wed, 12 Apr 2017 20:06:42 +0200 Authentication-Results: sourceware.org; dkim=none (message not signed) header.d=none; sourceware.org; dmarc=none action=none header.from=ericsson.com; Received: from elxcz23q12-y4.ca.am.ericsson.se (192.75.88.130) by AM4PR07MB1713.eurprd07.prod.outlook.com (2603:10a6:200:26::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.5; Wed, 12 Apr 2017 18:06:39 +0000 From: Simon Marchi To: CC: Simon Marchi Subject: [PATCH 2/2] doc: Improve documentation about MI thread output Date: Wed, 12 Apr 2017 14:06:10 -0400 Message-ID: <20170412180610.2565-2-simon.marchi@ericsson.com> In-Reply-To: <20170412180610.2565-1-simon.marchi@ericsson.com> References: <20170412180610.2565-1-simon.marchi@ericsson.com> MIME-Version: 1.0 X-ClientProxiedBy: CY4PR19CA0030.namprd19.prod.outlook.com (2603:10b6:903:103::16) To AM4PR07MB1713.eurprd07.prod.outlook.com (2603:10a6:200:26::21) X-MS-Office365-Filtering-Correlation-Id: 0826298c-08c6-41f1-83dc-08d481ceab5c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:AM4PR07MB1713; X-Microsoft-Exchange-Diagnostics: 1; AM4PR07MB1713; 3:MSIOU7uKDQk5nVbTppbDJb51J0ZEEg7p3ObpD7HwiOj+vOG+vy7wK+5uL91N5tyy8FXq/NXIs+CEyZvmiCyvMNA5a2Or8kk5AEeoM7o29SLDHyxnJ5IwzKHC3B4kNwTAKSJb/uK04vH5PXDuxaFdIWZ630Tfju+MiGrrKXJ1nDkPndFrMsccFuQM+5cEwFIlX0Frr91NmUK5VWtB2qAP8mVjXeT7yyvoq6hGgJ0uKN50ZQH35RBK1ykpwCMjxdP+tAUfD6BieBQuKazWfWZAkFAmcnWoA69QV3Ea24we9NhMAEQ+kSm3St8HC2G7HL6TXPQGgI3vuPGLJsdSP9xoXA==; 25:55F0bY5O0/aSKGLwWRmjH8aGen8qhju4/MBEPUU8otTY7blIdfpjsX3fa1sGqkVt81sDlm8MBwz7gfnSHYj2O+rjhQ3ojsAyJdGwFLwFPWFwl0P6k+6IkPsE0ooDhqDsrM0Xea6qYLOfbWWwfPgP7HqOLMrYPipcnHuSqVlVk7p8U0TYgIiojM/1AqEZAv17wG8n05cmnyrrq/y9fKCla91H20tu/sK2SxhOOez0t/pu6UiPVAfU6zVMfLteU2h/c6Qzc2zsVlras9S0E0qDNuWsN9BMYqRWkg5rUIJ9FNij+QMTnNev8FykoZWeeWZ7QvgZneYdAJUIfdHrXhe5pmbaNAyDyqqgHLaSfro/to+7RysOfAFI4UbeecSIBInKlKP5yz3aEQL004zyRYSN1uvoXG89bjwTObi2RFy6DaQ6mc2gJngIm/DtQn1yQVRsYvXrKb0qV97qm/I1h+FvJSFxLLfjC8GKXKZXhvElIiA= X-Microsoft-Exchange-Diagnostics: 1; AM4PR07MB1713; 31:1zktd28i4rpfWz01RV6bPuaI5ij+xMxKKyE6SGx0OshzNtT0GKg38KWTJYQQhhyB5HudsPKiHwW/LJieCXwKl6QdULHFPH9WXXYyPZd6RHzy3+55KxP79Qa9I2VvixEptUjKFfz5LnJHPZ+uaqvsfljCnfF/FAMjNA1BfosLo+RBD/kLNY3sjklpQ2Zs1qUQCv53DnUVH7uXOVPaoU4Mq9Oe3/QxIm2rIdcWtVm5pgM=; 20:RRMyJlFuCtCUmzveX3Pb38lJCLi21kB2sDscyKtb4xH8MtfarZTyt1Zel/jJKGQ3fn01/TYeVdOCx2mQQQdsddXH/xyujEmpDr8f3w2gdtfrFouRLzN2G/Jk7TwBNY437g2o0WooSiutdkqA1RUBt0Qxb2ZFZVlfNMGotlM6KPA3e/NHUeHDSWvyF26REnsDJMyzB2JZRGxWt7TyxRJQLp10d6a2i2JH9fk+hee9lqJDTTISmCfJB/Ae78y6b1daHFR6USONGm8xCendC+wh/17FFjhFXBN6fycQjKtxh2M88tt4xbISblp033V1gV8+7GTpFWmkbS5loGOIxlyl6fMSWJYnjf+XbdLNMWQ5X5BFKvzoumGK6diy4nC4jOB/L8fIXsyTSAFeYKuIvRGroBPkJdEUjuJ4BgfOKcQG2svUu2BQtQWdYbj0he2gD2wp8XM0Dihe79tyX+/9j13SMOn8oQNJjX/XXrRACdfjcQQ7M4sM9dqylQiii4wW2y3+ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(131327999870524)(788757137089); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(20161123560025)(20161123555025)(20161123562025)(6072148); SRVR:AM4PR07MB1713; BCL:0; PCL:0; RULEID:; SRVR:AM4PR07MB1713; X-Microsoft-Exchange-Diagnostics: 1; AM4PR07MB1713; 4:SVF5lBOn3s2jBIDziqvXjQscAAXGx42b+PmHp0IpjQBHQ//qKO4PZevfqa0RzJKpL3BEQNjsw65lgIYE2XQgdtByjUbDslDeT/1gi/7zGFRc9BNloTjvkbohysx9XVyFYTcfiI4xJm8JBb8rrs67tma7S2gmGHbjypIq/vewGlM+RI9HDefEebrHthsD0zt8+0fnbXdTTJ+rOj7hmezm9/4N7rNf7WCZIgx7an/yv0Fe1OOb4UjPojOqtEP/FSBTOYsp3w3liDAVVa8RwWUJuluzpiLQb+n4STu4s3Y5hDsonj0zw3jjS9fKC4vodaDDlDrYGfoe2/w5hQF8qp8Z5RQUqdZjqq/+1xeC3X4mxp/w8b2gH5GffSslH6iwEUi84wIhHPnNKs7SEXi5twkkIMhMnri4FwRCr1k4YmkWarBkFcRcv+pXC95tjlaNsAfh+Cvibkeq3EmRU9BDBuu192AZVndiZH5SNZBAbyZdzaukBkTOaWbzj6W8itsbeDjzAROnqjJ8h5BO66LOOVbieqfKXMHex+q67+hbtfo9ApHKJsXq1Inm+nrb7r+xQC95M0rSDdVCghvUV0viigggX9UY9h8WVXaTA2uWY7RPmAewNIAGC187ANrkVmQEChnnXoL8rGMzfjz9dni+gnZuinSdmcbqf0x5ieq6l9nTxApk27hAj4i2TdtPufBdJjIXPqxIWOHvUa/BCdlnZ7xaJoq49y6U9lcRhG1EVh/cRV73EP8SpTvxScetgq+BQVI1oiz+s6La6JchkfVXiU7/Ng+7d294AfIPd04EKaOgHYs= X-Forefront-PRVS: 027578BB13 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39410400002)(39450400003)(39840400002)(39400400002)(39860400002)(39850400002)(54534003)(53234004)(5003940100001)(2906002)(76176999)(50986999)(5660300001)(107886003)(110136004)(7736002)(50466002)(50226002)(38730400002)(189998001)(36756003)(8676002)(81166006)(42186005)(2351001)(2950100002)(6666003)(6916009)(48376002)(33646002)(4326008)(305945005)(1076002)(53936002)(86362001)(6512007)(25786009)(6486002)(6506006)(3846002)(6116002)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR07MB1713; H:elxcz23q12-y4.ca.am.ericsson.se; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM4PR07MB1713; 23:nRnUZTQ0RymKYukWx3a1NE++dyGYdILxzIUr6hh6f?= =?us-ascii?Q?Q+WNmhtPGMj5e3OKE2l7YpwLGaAwS/5yTqfVZrRiATltR0im5VKN40wsYZ8A?= =?us-ascii?Q?hvKLgtMnQ51oL+DyzCWm2DD5qjjCxWIJ5egXhmj5XME4o6UbKJfKOCbaHaZ9?= =?us-ascii?Q?uukCs6E1CWz5uqFZTZG3nfNckPq/+Xhn9ihRuYwFko2UPnBw9H6cHsLVWcrK?= =?us-ascii?Q?PxEpUsHdGHEo2C4SKREcc1CQWRlyPdEQElfrdVNJp2d9lcJcy946B2ez/0px?= =?us-ascii?Q?O8L/8OeF5EE7i7M98sQjLq4nN8mTKBnEV1beYSGk46O9odRgoMmw7Iw/SMUd?= =?us-ascii?Q?xQxTf9plp7EthnsQMY8QJ5jTvssQN8rtQjj0dtb3+5IUiIjmRN1DgrByLot4?= =?us-ascii?Q?SkPycEueF9KsydXfn6Bu2Vyr8C/ME/L4xXAQG2XU98FOJ4PstAnTvubBJq6K?= =?us-ascii?Q?4KbVY6dpHyNokM/EsR3/dbIRqtKvlamGRFi5dironP59u0oJJA326rhysvj8?= =?us-ascii?Q?Y1TsxZbJPiK0K/ewTtrQUUIZgj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Ogb/GUjD4zy4oi9s4jiiWV2g38hoAgKe7KphxGAo4WGfqGubK6Bqu99jpm4qKWG8iCXrXYRyeK+t1xHQXZvuT4V3OI9qZkGF7NxrfMZ9BFoITrzolXBvXl0+YDmIKOXpH/Mhwcy5BUlJA3IFuWn6lPloRbCcVQjJng==; 5:z1My9nxrKBrHH3buqyT53oioV0v0/9/E5/8kSzCwsfrHKJeGmbkHG+hym/dl47IKuw38vqFPIXDWfyXTpqYO3N4VtC1isVGhb0ABR1XTX4cSCQuwgHKuLv8DYfeeNSzxi2w2DfspZQGwRs7KMkT77vwar94xxZyym/h1F0tJz8k=; 24:1pLC/r0EjbrLkQnpn8LfCCtGaqLbWTxNDtNNcI2bN16Z5whruVGQR+aZnKCCxPCpT6ssCxvGMrFWoCHIhOnuYnOKqz1JZfqJeZUwzYchk+4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM4PR07MB1713; 7:rRskpFUTPSqQxuh59CsLgyUr6QwIKWjw4sWHkL8s+KBncL8P7fn/7a8g4ocwI8TW42a8RGX0pS2lGScYOuFqHj8WnCYQjYPJ8U6BKc1D2GNdiTurAsfWB5GAjCcekCcnxePEoTEr3HHqQEw77Nzdovx8/uDFv2k/ApgL2E9TOXGcoF8Uk8XKIUFkw61r+Xr0y+yPCBN0t/23G09RVS5TAChpxOEyc3+OqLS0dmAQDiE7fIO0VTD4YByezMVYiF9kGrQyNKswAlJW3Ezo+e7nauU7UlIeZUsTE7COkTFq5osXRTlRjamE6JCA1RWaf4aw1L+J/XDRhu/vbuGl1Wtvpg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2017 18:06:39.6619 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR07MB1713 X-OriginatorOrg: ericsson.com X-IsSubscribed: yes I noticed that the documentation on how the info about threads is output in MI is duplicated and not up to date. The duplication is between the "GDB/MI Thread Information" page and the -thread-info result description. I improved the "GDB/MI Thread Information" page a bit and referred to it in the -thread-info doc. This way, the -thread-info doc is more precise (it did not mention the "threads" and "current-thread-id" attributes) and concise. gdb/doc/ChangeLog: * gdb.texinfo (GDB/MI Thread Information): Add missing fields, re-word some things. (GDB/MI Thread Commands): Describe fields found in the output of -thread-info, remove description of fields in the thread output tuple, replace with a cross-reference to "GDB/MI Thread Information". --- gdb/doc/gdb.texinfo | 71 ++++++++++++++++++++--------------------------------- 1 file changed, 26 insertions(+), 45 deletions(-) diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 9e872763b2..b7a5d1bea7 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -26852,24 +26852,36 @@ corresponds to the frame's code address. This field may be absent. @subsection @sc{gdb/mi} Thread Information Whenever @value{GDBN} has to report an information about a thread, it -uses a tuple with the following fields: +uses a tuple with the following fields. The fields are always present unless +stated otherwise. @table @code @item id -The global numeric id assigned to the thread by @value{GDBN}. This field is -always present. +The global numeric id assigned to the thread by @value{GDBN}. @item target-id -Target-specific string identifying the thread. This field is always present. +The target-specific string identifying the thread. @item details Additional information about the thread provided by the target. It is supposed to be human-readable and not interpreted by the frontend. This field is optional. +@item name +The name of the thread. If the user specified a name using the +@code{thread name} command, then this name is given. Otherwise, if +@value{GDBN} can extract the thread name from the target, then that +name is given. If @value{GDBN} cannot find the thread name, then this +field is omitted. + @item state -Either @samp{stopped} or @samp{running}, depending on whether the -thread is presently running. This field is always present. +The execution state of the thread, either @samp{stopped} or @samp{running}, +depending on whether the thread is presently running. + +@item frame +The stack frame currently executing in the thread. This field is only present +if the thread is stopped. Its format is documented in +@ref{GDB/MI Frame Information}. @item core The value of this field is an integer number of the processor core the @@ -28084,48 +28096,17 @@ about all threads. @subsubheading Result -The result is a list of threads. The following attributes are -defined for a given thread: +The result contains the following attributes: @table @samp -@item id -The global identifier that @value{GDBN} uses to refer to the thread. - -@item target-id -The identifier that the target uses to refer to the thread. - -@item details -Extra information about the thread, in a target-specific format. This -field is optional. - -@item name -The name of the thread. If the user specified a name using the -@code{thread name} command, then this name is given. Otherwise, if -@value{GDBN} can extract the thread name from the target, then that -name is given. If @value{GDBN} cannot find the thread name, then this -field is omitted. - -@item frame -The stack frame currently executing in the thread. - -@item state -The thread's state. The @samp{state} field may have the following -values: - -@table @code -@item stopped -The thread is stopped. Frame information is available for stopped -threads. - -@item running -The thread is running. There's no frame information for running -threads. - -@end table +@item threads +A list of threads. The format of the elements of the list is described in +@ref{GDB/MI Thread Information}. -@item core -If @value{GDBN} can find the CPU core on which this thread is running, -then this field is the core identifier. This field is optional. +@item current-thread-id +The global id of the current selected thread. This field is only present if +there is a selected thread and no @var{thread-id} argument was passed to the +command.. @end table