This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch rfa:doco rfc:NEWS] mi1 -> mi2; rm mi0


Hello,

The attached patch updates things so that "mi2" is the default MI syntax. I need to add a mechanism so that the MI code can query the version but I'll post that separatly.

It modifies NEWS (comments?).
It updates the doco (ok?).

Andrew
Index: ChangeLog
2002-09-29  Andrew Cagney  <ac131313@redhat.com>

	* NEWS: Mention that MI syntax changed to "mi2" and that "mi0"
	syntax has been removed.

Index: doc/ChangeLog
2002-09-29  Andrew Cagney  <ac131313@redhat.com>

	* gdb.texinfo (Mode Options): Update --interpreter option.  "mi2"
	and "mi1" instead of "mi1" and "mi0".

Index: mi/ChangeLog
2002-09-29  Andrew Cagney  <ac131313@redhat.com>

	* mi-main.c (mi2_command_loop): New function.
	(mi0_command_loop): Delete function.
	(_initialize_mi_main): Recognize, and default to, "mi2".  Do not
	recognize "mi0".
	* mi-out.c (mi_table_begin): Remove mi0 code.
	(mi_table_body, mi_table_end): Ditto.
	(mi_table_header, mi_open, mi_close): Ditto.

Index: NEWS
===================================================================
RCS file: /cvs/src/src/gdb/NEWS,v
retrieving revision 1.93
diff -u -r1.93 NEWS
--- NEWS	21 Sep 2002 11:55:17 -0000	1.93
+++ NEWS	29 Sep 2002 18:08:05 -0000
@@ -3,6 +3,15 @@
 
 *** Changes since GDB 5.3:
 
+* Default MI syntax changed to "mi2".
+
+The default MI (machine interface) syntax, selected with the command
+line option "-i=mi", has been changed to "mi2".  The previous MI
+syntax can still be selected using "-i=mi1".
+
+Support for the original "mi0" syntax (included in GDB 5.0) has been
+removed.
+
 * REMOVED configurations and files
 
 V850EA ISA				
Index: doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.127
diff -u -r1.127 gdb.texinfo
--- doc/gdb.texinfo	25 Sep 2002 22:55:30 -0000	1.127
+++ doc/gdb.texinfo	29 Sep 2002 18:08:19 -0000
@@ -1127,10 +1127,10 @@
 program or device.  This option is meant to be set by programs which
 communicate with @value{GDBN} using it as a back end.
 
-@samp{--interpreter=mi} (or @samp{--interpreter=mi1}) causes
+@samp{--interpreter=mi} (or @samp{--interpreter=mi2}) causes
 @value{GDBN} to use the @dfn{gdb/mi interface} (@pxref{GDB/MI, , The
 @sc{gdb/mi} Interface}). The older @sc{gdb/mi} interface, included in
-@value{GDBN} version 5.0 can be selected with @samp{--interpreter=mi0}.
+@value{GDBN} version 5.3 can be selected with @samp{--interpreter=mi1}.
 
 @item -write
 @cindex @code{--write}
Index: mi/mi-main.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-main.c,v
retrieving revision 1.31
diff -u -r1.31 mi-main.c
--- mi/mi-main.c	11 Sep 2002 21:49:04 -0000	1.31
+++ mi/mi-main.c	29 Sep 2002 18:08:23 -0000
@@ -1514,15 +1514,15 @@
 }
 
 static void
-mi0_command_loop (void)
+mi1_command_loop (void)
 {
-  mi_command_loop (0);
+  mi_command_loop (1);
 }
 
 static void
-mi1_command_loop (void)
+mi2_command_loop (void)
 {
-  mi_command_loop (1);
+  mi_command_loop (2);
 }
 
 static void
@@ -1547,11 +1547,11 @@
     return;
 
   /* If we're _the_ interpreter, take control. */
-  if (strcmp (interpreter_p, "mi0") == 0)
-    command_loop_hook = mi0_command_loop;
-  else if (strcmp (interpreter_p, "mi") == 0
-	   || strcmp (interpreter_p, "mi1") == 0)
+  if (strcmp (interpreter_p, "mi1") == 0)
     command_loop_hook = mi1_command_loop;
+  else if (strcmp (interpreter_p, "mi") == 0
+	   || strcmp (interpreter_p, "mi2") == 0)
+    command_loop_hook = mi2_command_loop;
   else
     return;
 
Index: mi/mi-out.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-out.c,v
retrieving revision 1.23
diff -u -r1.23 mi-out.c
--- mi/mi-out.c	19 Mar 2002 02:51:08 -0000	1.23
+++ mi/mi-out.c	29 Sep 2002 18:08:23 -0000
@@ -109,14 +109,6 @@
 {
   struct ui_out_data *data = ui_out_data (uiout);
   mi_open (uiout, tblid, ui_out_type_tuple);
-  if (data->mi_version == 0)
-    {
-      if (nr_rows == 0)
-	data->suppress_output = 1;
-      else
-	mi_open (uiout, "hdr", ui_out_type_list);
-      return;
-    }
   mi_field_int (uiout, -1/*fldno*/, -1/*width*/, -1/*alin*/,
 		"nr_rows", nr_rows);
   mi_field_int (uiout, -1/*fldno*/, -1/*width*/, -1/*alin*/,
@@ -134,8 +126,6 @@
     return;
   /* close the table header line if there were any headers */
   mi_close (uiout, ui_out_type_list);
-  if (data->mi_version == 0)
-    return;
   mi_open (uiout, "body", ui_out_type_list);
 }
 
@@ -146,11 +136,6 @@
 {
   struct ui_out_data *data = ui_out_data (uiout);
   data->suppress_output = 0;
-  if (data->mi_version == 0)
-    {
-      mi_close (uiout, ui_out_type_tuple);
-      return;
-    }
   mi_close (uiout, ui_out_type_list); /* body */
   mi_close (uiout, ui_out_type_tuple);
 }
@@ -165,11 +150,6 @@
   struct ui_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
-  if (data->mi_version == 0)
-    {
-      mi_field_string (uiout, 0, width, alignment, 0, colhdr);
-      return;
-    }
   mi_open (uiout, NULL, ui_out_type_tuple);
   mi_field_int (uiout, 0, 0, 0, "width", width);
   mi_field_int (uiout, 0, 0, 0, "alignment", alignment);
@@ -361,10 +341,7 @@
       fputc_unfiltered ('{', data->buffer);
       break;
     case ui_out_type_list:
-      if (data->mi_version == 0)
-	fputc_unfiltered ('{', data->buffer);
-      else
-	fputc_unfiltered ('[', data->buffer);
+      fputc_unfiltered ('[', data->buffer);
       break;
     default:
       internal_error (__FILE__, __LINE__, "bad switch");
@@ -382,10 +359,7 @@
       fputc_unfiltered ('}', data->buffer);
       break;
     case ui_out_type_list:
-      if (data->mi_version == 0)
-	fputc_unfiltered ('}', data->buffer);
-      else
-	fputc_unfiltered (']', data->buffer);
+      fputc_unfiltered (']', data->buffer);
       break;
     default:
       internal_error (__FILE__, __LINE__, "bad switch");

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]