From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4791 invoked by alias); 28 Aug 2007 17:12:10 -0000 Received: (qmail 4018 invoked by uid 22791); 28 Aug 2007 17:12:06 -0000 X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 28 Aug 2007 17:11:53 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IQ4bO-0000ko-Vw for gdb-patches@sources.redhat.com; Tue, 28 Aug 2007 19:11:42 +0200 Received: from 241-246.umostel.ru ([77.246.241.246]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 28 Aug 2007 19:11:42 +0200 Received: from ghost by 241-246.umostel.ru with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 28 Aug 2007 19:11:42 +0200 To: gdb-patches@sources.redhat.com From: Vladimir Prus Subject: [mi] -list-features Date: Tue, 28 Aug 2007 17:12:00 -0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart1636403.ZaXPijBxZ4" Content-Transfer-Encoding: 7Bit User-Agent: KNode/0.10.4 X-IsSubscribed: yes 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-08/txt/msg00493.txt.bz2 --nextPart1636403.ZaXPijBxZ4 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8Bit Content-length: 244 Some time ago I've proposed to add MI command that will list "supported features", to enable frontends to conditionalize their behaviour easily. It was generally supported, so here there patch. So far, no features are reported. OK? - Volodya --nextPart1636403.ZaXPijBxZ4 Content-Type: text/plain; name="list_features.ChangeLog" Content-Transfer-Encoding: 8Bit Content-Disposition: attachment; filename="list_features.ChangeLog" Content-length: 142 * mi/mi-cmds.c (mi_cmds): Register -list-features. * mi/mi-cmds.h (mi_cmd_list_features): New. * mi/mi-main.c (mi_cmd_list_features): New. --nextPart1636403.ZaXPijBxZ4 Content-Type: text/x-diff; name="list_features.diff" Content-Transfer-Encoding: 8Bit Content-Disposition: attachment; filename="list_features.diff" Content-length: 1825 --- gdb/mi/mi-cmds.c (/mirrors/gdb_mainline) (revision 4644) +++ gdb/mi/mi-cmds.c (/patches/gdb/list_features) (local) @@ -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 }, --- gdb/mi/mi-cmds.h (/mirrors/gdb_mainline) (revision 4644) +++ gdb/mi/mi-cmds.h (/patches/gdb/list_features) (local) @@ -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 4644) +++ gdb/mi/mi-main.c (/patches/gdb/list_features) (local) @@ -1075,6 +1075,23 @@ 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"); + + 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. --nextPart1636403.ZaXPijBxZ4--