From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29388 invoked by alias); 7 Sep 2007 20:26:25 -0000 Received: (qmail 29380 invoked by uid 22791); 7 Sep 2007 20:26:24 -0000 X-Spam-Check-By: sourceware.org Received: from zigzag.lvk.cs.msu.su (HELO zigzag.lvk.cs.msu.su) (158.250.17.23) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 07 Sep 2007 20:26:20 +0000 Received: from Debian-exim by zigzag.lvk.cs.msu.su with spam-scanned (Exim 4.50) id 1ITkP8-00054M-C1 for gdb-patches@sources.redhat.com; Sat, 08 Sep 2007 00:26:14 +0400 Received: from localhost ([127.0.0.1] helo=ip6-localhost) by zigzag.lvk.cs.msu.su with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.50) id 1ITkOy-00053c-AF; Sat, 08 Sep 2007 00:26:04 +0400 From: Vladimir Prus To: Eli Zaretskii Subject: Re: [mi] -list-features Date: Fri, 07 Sep 2007 20:26:00 -0000 User-Agent: KMail/1.9.6 Cc: drow@false.org, gdb-patches@sources.redhat.com References: <200708311300.36546.ghost@cs.msu.su> In-Reply-To: MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_ZPb4GnJt4krphE8" Message-Id: <200709080026.01470.ghost@cs.msu.su> 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: 2007-09/txt/msg00090.txt.bz2 --Boundary-00=_ZPb4GnJt4krphE8 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 953 On Friday 31 August 2007 13:18:17 Eli Zaretskii wrote: > > From: Vladimir Prus > > Date: Fri, 31 Aug 2007 13:00:36 +0400 > > Cc: drow@false.org, > > gdb-patches@sources.redhat.com > > > > > It is still ambiguous, because "a list of string" does not tell the > > > whole story. Is it > > > > > > foo bar baz > > > or > > > "foo" "bar" "baz" > > > or > > > foo,bar,baz > > > or > > > {foo,bar,baz} > > > > Well, in MI, "list of strings" is quite well defined. > > I don't see such a definition. I see a definition of "list", but if > you want to rely on that, please add a cross-reference to that > section, because the reader shouldn't be required to remember the > syntax by heart. > > > Example output: > > > > ^done,result=["feature1","feature2"] > > This is much better, IMO; now it's perfectly clear what front ends > should expect. Here's the updated patch, including texinfo docs. OK? - Volodya --Boundary-00=_ZPb4GnJt4krphE8 Content-Type: text/x-diff; charset="iso-8859-15"; name="list_features.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="list_features.diff" Content-length: 3391 --- gdb/doc/gdb.texinfo (/mirrors/gdb_mainline) (revision 4740) +++ gdb/doc/gdb.texinfo (/patches/gdb/list_features) (revision 4740) @@ -21236,6 +21236,37 @@ default shows this information when you (gdb) @end smallexample +@subheading The @code{-list-features} Command +@findex -list-features + +Returns a list of particular features of the MI protocol that +this version of gdb implements. A feature can be a command, +or a new field in an output of some command, or even an +important bugfix. While a frontend can sometimes detect presence +of a feature at runtime, it is easier to perform detection at debugger +startup. + +The command returns a list of strings, with each string naming an +available feature. Each returned string is just a name, it does not +have any internal structure. The list of possible feature names +is given below. + +Example output: + +@smallexample +(gdb) -list-features +^done,result=["feature1","feature2"] +@end smallexample + +The current list of features is: + +@itemize @minus +@item +@samp{frozen-varobjs}---indicates presence of the +@code{-var-set-frozen} command, as well as possible presense of the +@code{frozen} field in the output of @code{-varobj-create}. +@end itemize + @subheading The @code{-interpreter-exec} Command @findex -interpreter-exec --- gdb/mi/mi-cmds.h (/mirrors/gdb_mainline) (revision 4740) +++ gdb/mi/mi-cmds.h (/patches/gdb/list_features) (revision 4740) @@ -91,6 +91,7 @@ extern mi_cmd_argv_ftype mi_cmd_gdb_exit extern mi_cmd_argv_ftype mi_cmd_inferior_tty_set; extern mi_cmd_argv_ftype mi_cmd_inferior_tty_show; extern mi_cmd_argv_ftype mi_cmd_interpreter_exec; +extern mi_cmd_argv_ftype mi_cmd_list_features; extern mi_cmd_argv_ftype mi_cmd_stack_info_depth; extern mi_cmd_argv_ftype mi_cmd_stack_info_frame; extern mi_cmd_argv_ftype mi_cmd_stack_list_args; --- gdb/mi/mi-main.c (/mirrors/gdb_mainline) (revision 4740) +++ gdb/mi/mi-main.c (/patches/gdb/list_features) (revision 4740) @@ -1075,6 +1075,25 @@ mi_cmd_enable_timings (char *command, ch return MI_CMD_ERROR; } +enum mi_cmd_result +mi_cmd_list_features (char *command, char **argv, int argc) +{ + if (argc == 0) + { + struct cleanup *cleanup = NULL; + cleanup = make_cleanup_ui_out_list_begin_end (uiout, "features"); + + ui_out_field_string (uiout, NULL, "frozen-varobjs"); + + do_cleanups (cleanup); + + return MI_CMD_DONE; + } + + error ("-list-features should be passed no arguments"); + return MI_CMD_ERROR; +} + /* Execute a command within a safe environment. Return <0 for error; >=0 for ok. --- gdb/mi/mi-cmds.c (/mirrors/gdb_mainline) (revision 4740) +++ gdb/mi/mi-cmds.c (/patches/gdb/list_features) (revision 4740) @@ -88,6 +88,7 @@ struct mi_cmd mi_cmds[] = { "inferior-tty-set", { NULL, 0 }, NULL, mi_cmd_inferior_tty_set}, { "inferior-tty-show", { NULL, 0 }, NULL, mi_cmd_inferior_tty_show}, { "interpreter-exec", { NULL, 0 }, 0, mi_cmd_interpreter_exec}, + { "list-features", { NULL, 0 }, 0, mi_cmd_list_features}, { "overlay-auto", { NULL, 0 }, NULL, NULL }, { "overlay-list-mapping-state", { NULL, 0 }, NULL, NULL }, { "overlay-list-overlays", { NULL, 0 }, NULL, NULL }, Property changes on: ___________________________________________________________________ Name: svk:merge +e7755896-6108-0410-9592-8049d3e74e28:/mirrors/gdb/trunk:181223 --Boundary-00=_ZPb4GnJt4krphE8--