From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10085 invoked by alias); 7 May 2003 19:40:35 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 10072 invoked from network); 7 May 2003 19:40:35 -0000 Received: from unknown (HELO localhost.redhat.com) (207.219.125.105) by sources.redhat.com with SMTP; 7 May 2003 19:40:35 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 3B1182B2F; Wed, 7 May 2003 15:13:15 -0400 (EDT) Message-ID: <3EB95ACB.2050807@redhat.com> Date: Wed, 07 May 2003 19:40:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Alain Magloire Cc: gdb-patches@sources.redhat.com Subject: Re: [RFC] -mi-level command References: <200305071834.OAA22796@node1.ott.qnx.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-05/txt/msg00094.txt.bz2 > Bonjour > > Maybe there is a better way to do this, most clients of GDB/MI > need a way to know the level to adjust the parsing or go around bugs in > previous(or current version). > > One problem with the code below is that mi_version() is returning ..."3" Should it also include the gdb version string? Should it indicate the range of supported MI versions? (what ever is useful). 'gdb -i=mi2' should get you back to something that was released in 5.3. "mi3" won't become official until GDB 6 is released, however, for it it return "2" would be wrong. It will need documentation and a testcase. Andrew There is a problem here though > I'll be happy to provide docs etc .. after. > 8<---8<--------------------------------------- > Index: mi-cmds.c > =================================================================== > RCS file: /cvs/src/src/gdb/mi/mi-cmds.c,v > retrieving revision 1.12 > diff -u -r1.12 mi-cmds.c > --- mi-cmds.c 4 May 2003 03:50:13 -0000 1.12 > +++ mi-cmds.c 7 May 2003 18:24:34 -0000 > @@ -96,6 +96,7 @@ > {"kod-list", 0, 0}, > {"kod-list-object-types", 0, 0}, > {"kod-show", 0, 0}, > + {"mi-level", 0, 0, mi_cmd_mi_level}, > {"overlay-auto", 0, 0}, > {"overlay-list-mapping-state", 0, 0}, > {"overlay-list-overlays", 0, 0}, > Index: mi-cmds.h > =================================================================== > RCS file: /cvs/src/src/gdb/mi/mi-cmds.h,v > retrieving revision 1.9 > diff -u -r1.9 mi-cmds.h > --- mi-cmds.h 4 May 2003 03:50:13 -0000 1.9 > +++ mi-cmds.h 7 May 2003 18:24:34 -0000 > @@ -81,6 +81,7 @@ > extern mi_cmd_args_ftype mi_cmd_exec_until; > extern mi_cmd_args_ftype mi_cmd_exec_interrupt; > extern mi_cmd_argv_ftype mi_cmd_file_list_exec_source_file; > +extern mi_cmd_argv_ftype mi_cmd_mi_level; > extern mi_cmd_argv_ftype mi_cmd_gdb_exit; > extern mi_cmd_argv_ftype mi_cmd_interpreter_exec; > extern mi_cmd_argv_ftype mi_cmd_stack_info_depth; > Index: mi-main.c > =================================================================== > RCS file: /cvs/src/src/gdb/mi/mi-main.c,v > retrieving revision 1.43 > diff -u -r1.43 mi-main.c > --- mi-main.c 5 May 2003 17:56:57 -0000 1.43 > +++ mi-main.c 7 May 2003 18:24:34 -0000 > @@ -109,6 +109,13 @@ > formalized. */ > > enum mi_cmd_result > +mi_cmd_mi_level (char *command, char **argv, int argc) > +{ > + ui_out_field_int (uiout, "level", mi_version(uiout)); Indentation, space before the lparen. > + return MI_CMD_DONE; > +} > + > +enum mi_cmd_result > mi_cmd_gdb_exit (char *command, char **argv, int argc) > { > /* We have to print everything right here because we never return */ > > Andrew