From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28882 invoked by alias); 13 Oct 2011 15:52:46 -0000 Received: (qmail 28855 invoked by uid 22791); 13 Oct 2011 15:52:43 -0000 X-SWARE-Spam-Status: No, hits=0.8 required=5.0 tests=AWL,BAYES_40,FROM_12LTRDOM X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 13 Oct 2011 15:52:08 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1RENZo-0003ad-1a from Kwok_Yeung@mentor.com for gdb-patches@sourceware.org; Thu, 13 Oct 2011 08:52:08 -0700 Received: from [0.0.0.0] ([172.16.63.104]) by EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 13 Oct 2011 16:52:04 +0100 Message-ID: <4E970915.8000207@codesourcery.com> Date: Thu, 13 Oct 2011 15:52:00 -0000 From: Kwok Cheung Yeung User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: [PATCH] Add the "-info-os" command to MI Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 2011-10/txt/msg00400.txt.bz2 This patch adds the "-info-os" command to MI as the counterpart to the GDB "info os" command. It behaves in the same way as "info os", only the output is formatted according to MI conventions. I've also added an entry in the documentation. Kwok ChangeLog: gdb/ * mi/mi-cmds.c (mi_cmds): Add -info-os MI command. gdb/doc/ * gdb.texinfo (Operating System Auxilliary Information): Change the name of the information types anchor to be more readable. (Miscellaneous gdb/mi Commands): Document the -info-os MI command. --- src_old/gdb/mi/mi-cmds.c 2011-10-13 16:32:52.504656252 +0100 +++ src/gdb/mi/mi-cmds.c 2011-10-11 15:45:18.578784000 +0100 @@ -90,6 +90,7 @@ struct mi_cmd mi_cmds[] = { "gdb-version", { "show version", 0 }, 0 }, { "inferior-tty-set", { NULL, 0 }, mi_cmd_inferior_tty_set}, { "inferior-tty-show", { NULL, 0 }, mi_cmd_inferior_tty_show}, + { "info-os", { "info os", 1 }, NULL }, { "interpreter-exec", { NULL, 0 }, mi_cmd_interpreter_exec}, { "list-features", { NULL, 0 }, mi_cmd_list_features}, { "list-target-features", { NULL, 0 }, mi_cmd_list_target_features}, --- src_old/gdb/doc/gdb.texinfo 2011-10-13 16:31:49.537274871 +0100 +++ src/gdb/doc/gdb.texinfo 2011-10-13 16:30:07.534783331 +0100 @@ -8931,7 +8931,7 @@ Display OS information of the requested On @sc{gnu}/Linux, the following values of INFOTYPE are valid: -@anchor{linux info os infotypes} +@anchor{Linux OS information types} @table @code @kindex info os processes @item processes @@ -30882,6 +30882,54 @@ default shows this information when you (gdb) @end smallexample +@subheading The @code{-info-os} Command +@findex -info-os + +@subsubheading Synopsis + +@smallexample + -info-os [ @var{type} ] +@end smallexample + +Returns a table of supported OS-specific information types if no +argument is supplied. If an argument is supplied, then a table of +the requested information type is returned. + +The types of information available depend on the target operating +system. The available types for @sc{gnu}/Linux are listed in +@ref{Linux OS information types}. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{info os}. + +@subsubheading Example + +@smallexample +(gdb) +-info-os +^done,OSDataTable=@{nr_rows="9",nr_cols="2",hdr=[@{width="10",alignment= +"-1",col_name="col0",colhdr="Type"@},@{width="10",alignment="-1",col_nam +e="col1",colhdr="Description"@}],body=[item=@{col0="processes",col1="Lis +ting of all processes"@},item=@{col0="procgroups",col1="Listing of all p +rocess groups"@},item=@{col0="threads",col1="Listing of all threads"@},i +tem=@{col0="files",col1="Listing of all file descriptors"@},item=@{col0= +"sockets",col1="Listing of all internet-domain sockets"@},item=@{col0="s +hm",col1="Listing of all shared-memory regions"@},item=@{col0="semaphore +s",col1="Listing of all semaphores"@},item=@{col0="msg",col1="Listing of + all message queues"@},item=@{col0="modules",col1="Listing of all loaded + kernel modules"@}]@} +(gdb) +-info-os processes +^done,OSDataTable=@{nr_rows="137",nr_cols="4",hdr=[@{width="10",alignmen +t="-1",col_name="col0",colhdr="pid"@},@{width="10",alignment="-1",col_na +me="col1",colhdr="user"@},@{width="10",alignment="-1",col_name="col2",co +lhdr="command"@},@{width="10",alignment="-1",col_name="col3",colhdr="cor +es"@}],body=[item=@{col0="1",col1="root",col2="/sbin/init",col3="0"@},it +em=@{col0="2",col1="root",col2="[kthreadd]",col3="0"@}, ... ]@} +(gdb) +@end smallexample + @subheading The @code{-list-features} Command @findex -list-features