2002-11-08 Jeff Johnston <jjohnstn@redhat.com>
[deliverable/binutils-gdb.git] / gdb / testsuite / lib / mi-support.exp
index 0395afab890211c155e92d8f2616ef91c25ee590..de775b6c423087d5b761eaf5ecf357f1daac97c5 100644 (file)
@@ -123,7 +123,26 @@ proc mi_gdb_start { } {
        return 1;
     }
     gdb_expect {
-       -re ".*$mi_gdb_prompt$" {
+       -re "~\"GNU.*\r\n~\".*$mi_gdb_prompt$" {
+           # We have a new format mi startup prompt.  If we are
+           # running mi1, then this is an error as we should be
+           # using the old-style prompt.
+           if { $MIFLAGS == "-i=mi1" } {
+               perror "(mi startup) Got unexpected new mi prompt."
+               remote_close host;
+               return -1;
+           }
+           verbose "GDB initialized."
+       }
+       -re "\[^~\].*$mi_gdb_prompt$" {
+           # We have an old format mi startup prompt.  If we are
+           # not running mi1, then this is an error as we should be
+           # using the new-style prompt.
+           if { $MIFLAGS != "-i=mi1" } {
+               perror "(mi startup) Got unexpected old mi prompt."
+               remote_close host;
+               return -1;
+           }
            verbose "GDB initialized."
        }
        -re ".*$gdb_prompt $" {
This page took 0.024467 seconds and 4 git commands to generate.