This is the mail archive of the gdb@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]

Re: new MI testsuite


Is anyone interested?
Should I commit the parser, extension and the final patch to the
testsuite? or does a commit like this need to be discussed first?

Thanks,
Bob Rossi

On Mon, Feb 07, 2005 at 03:17:00PM -0500, Bob Rossi wrote:
> Hi,
> 
> I would like to take my MI testsuite research to the next level. Could I
> get any feedback on what the next best step is?
> 
> As most of you know, I'm working on a new MI testsuite. It will test the
> same commands as the current testsuite, except several things will be
> different.
> 
>    - The MI output commands will be validated against a syntax checker.
>    - The inferior will get it's own terminal to write to, instead of
>      sharing GDB's terminal. This allows the separation of GDB's output
>      with the inferior's output. I believe most front end's operate in
>      this fasion.
>    - GDB will not echo data to the terminal.
>    - Becaue of above 2 points, all output of GDB will be anchored, which 
>      will validate every byte that GDB writes.
> 
> Future use's will be,
>    - To do semantical analysis on the MI fields.
>    - To do syntax and symantical analysis of MI input commands
>    
> Either way, I need to commit the MI parser. It's written in C with
> yacc/bison and there is an extension to Tcl. These files are in a single 
> directory, and would need to be added to GDB somewhere. Or, it could be a 
> separate project and added at the GDB level. Any ideas on this?
> 
> Next, I need to change the MI testsuite. When prototyping, I modified the 
> existing tests. The patch is crude, and it's just a first pass, but it's 
> below. I've changed mi_gdb_test to capture the output from GDB and then 
> run the parser on it, to make sure that the syntax is correct. Also, I 
> call 'expect -i $inferior_spawn_id' directly in the .exp tests to get the 
> output of the inferior.
> 
> If this idea is excepted, I can change the parameter profile of mi_gdb_test 
> to have another parameter, which would be the expected inferior output. 
> This would remove the explicit calls to 'expect -i $inferior_spawn_id' 
> that has to be put in the .exp files directly. Thus, the global
> variable 'mi_inferior_spawn_id' would also be removed, since that data
> would only be used in mi_gdb_test.
> 
> The patch below passes the entire MI testsuite except for 1 case, which
> I think is not matching the expected output, but is passing anyways (by
> mistake). Either way, I'm very impressed that GDB is actually outputting
> the grammar from the GDB website (with a minor tweek). Good job!
> 
> If your interested, the case that fails is mi-disassemble.exp and the case is
> "456-data-disassemble...", the expected data is slightly wrong,
> although, I don't think it's a big deal. (or I could just be wrong
> somehow)
> 
> Thanks,
> Bob Rossi
> 
> Index: src/gdb/testsuite/gdb.mi/mi-console.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-console.exp,v
> retrieving revision 1.12
> diff -w -u -r1.12 mi-console.exp
> --- src/gdb/testsuite/gdb.mi/mi-console.exp	9 Aug 2004 16:32:44 -0000	1.12
> +++ src/gdb/testsuite/gdb.mi/mi-console.exp	7 Feb 2005 20:08:32 -0000
> @@ -34,6 +34,7 @@
>  
>  load_lib mi-support.exp
>  set MIFLAGS "-i=mi"
> +global mi_inferior_spawn_id
>  
>  gdb_exit
>  if [mi_gdb_start] {
> @@ -64,11 +65,11 @@
>      }
>  }
>  
> -gdb_expect {
> -    -re "@\"H\"\r\n.*@\"e\"\r\n.*@\"l\"\r\n.*@\"l\"\r\n.*@\"o\"\r\n.*@\" \"\r\n.*@\"\\\\\\\\\"\r\n.*@\"\\\\\"\"\r\n.*@\"!\"\r\n.*@\"\\\\r\"\r\n.*@\"\\\\n\"\r\n" {
> +expect {
> +    -i $mi_inferior_spawn_id -re "@\"H\"\r\n.*@\"e\"\r\n.*@\"l\"\r\n.*@\"l\"\r\n.*@\"o\"\r\n.*@\" \"\r\n.*@\"\\\\\\\\\"\r\n.*@\"\\\\\"\"\r\n.*@\"!\"\r\n.*@\"\\\\r\"\r\n.*@\"\\\\n\"\r\n" {
>  	pass "Hello message"
>      }
> -    -re "Hello" {
> +    -i $mi_inferior_spawn_id -re "Hello" {
>  
>  	# Probably a native system where GDB doesn't have direct
>  	# control over the inferior console.
> Index: src/gdb/testsuite/gdb.mi/mi-disassemble.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-disassemble.exp,v
> retrieving revision 1.13
> diff -w -u -r1.13 mi-disassemble.exp
> --- src/gdb/testsuite/gdb.mi/mi-disassemble.exp	15 Aug 2004 10:15:58 -0000	1.13
> +++ src/gdb/testsuite/gdb.mi/mi-disassemble.exp	7 Feb 2005 20:08:32 -0000
> @@ -163,7 +163,7 @@
>      # -data-disassembly -f basics.c -l 32 -- 9
>  
>      mi_gdb_test "123-data-disassemble -f foo -l abc -n 0 -- 0" \
> -             ".*123\\^error,msg=\"mi_cmd_disassemble: Invalid filename.\"" \
> +             "123\\^error,msg=\"mi_cmd_disassemble: Invalid filename.\"" \
>               "data-disassemble bogus filename"
>  
>      mi_gdb_test "321-data-disassemble -s foo -e bar -- 0" \
> Index: src/gdb/testsuite/gdb.mi/mi-syn-frame.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-syn-frame.exp,v
> retrieving revision 1.2
> diff -w -u -r1.2 mi-syn-frame.exp
> --- src/gdb/testsuite/gdb.mi/mi-syn-frame.exp	24 Feb 2003 20:15:47 -0000	1.2
> +++ src/gdb/testsuite/gdb.mi/mi-syn-frame.exp	7 Feb 2005 20:08:32 -0000
> @@ -27,6 +27,7 @@
>  
>  load_lib mi-support.exp
>  set MIFLAGS "-i=mi"
> +global mi_inferior_spawn_id
>  
>  set testfile "mi-syn-frame"
>  set srcfile ${testfile}.c
> @@ -61,7 +62,7 @@
>  
>  send_gdb "403-exec-continue\n"
>  gdb_expect {
> -  -re "403\\^running\[\r\n\]+${my_mi_gdb_prompt}hi in foo\[\r\n\]+403\\\*stopped\[\r\n\]+${my_mi_gdb_prompt}$" {
> +  -re "403\\^running\[\r\n\]+${my_mi_gdb_prompt}403\\\*stopped\[\r\n\]+${my_mi_gdb_prompt}$" {
>      pass "403-exec-continue"
>    }
>    timeout {
> @@ -69,6 +70,10 @@
>    }
>  }
>  
> +expect {
> +	-i $mi_inferior_spawn_id -re "hi in foo\[\r\n\]+"
> +}
> +
>  mi_gdb_test "404-stack-list-frames 0 0" "404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
>  
>  
> @@ -78,7 +83,11 @@
>  
>  mi_gdb_test "405-break-insert subroutine" "405\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"subroutine\",file=\".*mi-syn-frame.c\",line=\"$decimal\",times=\"0\"\}"
>  
> -mi_gdb_test "406-data-evaluate-expression have_a_very_merry_interrupt()" "Waiting to get a signal\[\r\n\]+\\&\"The program being debugged stopped while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"When the function \\(have_a_very_merry_interrupt\\) is done executing, GDB will silently\\\\n\"\[\r\n\]+\\&\"stop \\(instead of continuing to evaluate the expression containing\\\\n\"\[\r\n\]+\\&\"the function call\\).\\\\n\"\[\r\n\]+406\\^error,msg=\"The program being debugged stopped while in a function called from GDB.\\\\nWhen the function \\(have_a_very_merry_interrupt\\) is done executing, GDB will silently\\\\nstop \\(instead of continuing to evaluate the expression containing\\\\nthe function call\\).\""
> +mi_gdb_test "406-data-evaluate-expression have_a_very_merry_interrupt()" "\\&\"The program being debugged stopped while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"When the function \\(have_a_very_merry_interrupt\\) is done executing, GDB will silently\\\\n\"\[\r\n\]+\\&\"stop \\(instead of continuing to evaluate the expression containing\\\\n\"\[\r\n\]+\\&\"the function call\\).\\\\n\"\[\r\n\]+406\\^error,msg=\"The program being debugged stopped while in a function called from GDB.\\\\nWhen the function \\(have_a_very_merry_interrupt\\) is done executing, GDB will silently\\\\nstop \\(instead of continuing to evaluate the expression containing\\\\nthe function call\\).\""
> +
> +expect {
> +	-i $mi_inferior_spawn_id -re "Waiting to get a signal\[\r\n\]+"
> +}
>  
>  # We should have both a signal handler and a call dummy frame
>  # in this next output.
> @@ -102,7 +111,11 @@
>  # Call bar() by hand, which should get an exception while running.
>  # 
>  
> -mi_gdb_test "410-data-evaluate-expression bar()" "hi in bar\[\r\n\]+\\&\"The program being debugged was signaled while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"GDB remains in the frame where the signal was received.\\\\n\"\[\r\n\]+\\&\"To change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\n\"\[\r\n\]+\\&\"Evaluation of the expression containing the function \\(bar\\) will be abandoned.\\\\n\"\[\r\n\]+410\\^error,msg=\"The program being debugged was signaled while in a function called from GDB.\\\\nGDB remains in the frame where the signal was received.\\\\nTo change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\nEvaluation of the expression containing the function \\(bar\\) will be abandoned.\"" "call inferior function which raises exception"
> +mi_gdb_test "410-data-evaluate-expression bar()" "\\&\"The program being debugged was signaled while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"GDB remains in the frame where the signal was received.\\\\n\"\[\r\n\]+\\&\"To change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\n\"\[\r\n\]+\\&\"Evaluation of the expression containing the function \\(bar\\) will be abandoned.\\\\n\"\[\r\n\]+410\\^error,msg=\"The program being debugged was signaled while in a function called from GDB.\\\\nGDB remains in the frame where the signal was received.\\\\nTo change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\nEvaluation of the expression containing the function \\(bar\\) will be abandoned.\"" "call inferior function which raises exception"
> +
> +expect {
> +	-i $mi_inferior_spawn_id -re "hi in bar\[\r\n\]+"
> +}
>  
>  mi_gdb_test "411-stack-list-frames" "411\\^done,reason=\"signal-received\",signal-name=\".*\",signal-meaning=\".*\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"bar\",args=\\\[\\\],file=\".*mi-syn-frame.c\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",file=\".*mi-syn-frame.c\",line=\"$decimal\"},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"}.*\\\]" "backtrace from inferior function at exception"
>  
> Index: src/gdb/testsuite/gdb.mi/mi2-console.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-console.exp,v
> retrieving revision 1.2
> diff -w -u -r1.2 mi2-console.exp
> --- src/gdb/testsuite/gdb.mi/mi2-console.exp	9 Aug 2004 22:21:54 -0000	1.2
> +++ src/gdb/testsuite/gdb.mi/mi2-console.exp	7 Feb 2005 20:08:33 -0000
> @@ -34,6 +34,7 @@
>  
>  load_lib mi-support.exp
>  set MIFLAGS "-i=mi2"
> +global mi_inferior_spawn_id
>  
>  gdb_exit
>  if [mi_gdb_start] {
> @@ -64,11 +65,11 @@
>      }
>  }
>  
> -gdb_expect {
> -    -re "@\"H\"\r\n.*@\"e\"\r\n.*@\"l\"\r\n.*@\"l\"\r\n.*@\"o\"\r\n.*@\" \"\r\n.*@\"\\\\\\\\\"\r\n.*@\"\\\\\"\"\r\n.*@\"!\"\r\n.*@\"\\\\r\"\r\n.*@\"\\\\n\"\r\n" {
> +expect {
> +    -i $mi_inferior_spawn_id -re "@\"H\"\r\n.*@\"e\"\r\n.*@\"l\"\r\n.*@\"l\"\r\n.*@\"o\"\r\n.*@\" \"\r\n.*@\"\\\\\\\\\"\r\n.*@\"\\\\\"\"\r\n.*@\"!\"\r\n.*@\"\\\\r\"\r\n.*@\"\\\\n\"\r\n" {
>  	pass "Hello message"
>      }
> -    -re "Hello" {
> +    -i $mi_inferior_spawn_id -re "Hello" {
>  
>  	# Probably a native system where GDB doesn't have direct
>  	# control over the inferior console.
> Index: src/gdb/testsuite/gdb.mi/mi2-syn-frame.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-syn-frame.exp,v
> retrieving revision 1.1
> diff -w -u -r1.1 mi2-syn-frame.exp
> --- src/gdb/testsuite/gdb.mi/mi2-syn-frame.exp	7 Aug 2003 17:47:42 -0000	1.1
> +++ src/gdb/testsuite/gdb.mi/mi2-syn-frame.exp	7 Feb 2005 20:08:33 -0000
> @@ -27,6 +27,7 @@
>  
>  load_lib mi-support.exp
>  set MIFLAGS "-i=mi2"
> +global mi_inferior_spawn_id
>  
>  set testfile "mi-syn-frame"
>  set srcfile ${testfile}.c
> @@ -61,7 +62,7 @@
>  
>  send_gdb "403-exec-continue\n"
>  gdb_expect {
> -  -re "403\\^running\[\r\n\]+${my_mi_gdb_prompt}hi in foo\[\r\n\]+403\\\*stopped\[\r\n\]+${my_mi_gdb_prompt}$" {
> +  -re "403\\^running\[\r\n\]+${my_mi_gdb_prompt}403\\\*stopped\[\r\n\]+${my_mi_gdb_prompt}$" {
>      pass "403-exec-continue"
>    }
>    timeout {
> @@ -69,6 +70,10 @@
>    }
>  }
>  
> +expect {
> +	-i $mi_inferior_spawn_id -re "hi in foo\[\r\n\]+"
> +}
> +
>  mi_gdb_test "404-stack-list-frames 0 0" "404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
>  
>  
> @@ -78,7 +83,11 @@
>  
>  mi_gdb_test "405-break-insert subroutine" "405\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"subroutine\",file=\".*mi-syn-frame.c\",line=\"$decimal\",times=\"0\"\}"
>  
> -mi_gdb_test "406-data-evaluate-expression have_a_very_merry_interrupt()" "Waiting to get a signal\[\r\n\]+\\&\"The program being debugged stopped while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"When the function \\(have_a_very_merry_interrupt\\) is done executing, GDB will silently\\\\n\"\[\r\n\]+\\&\"stop \\(instead of continuing to evaluate the expression containing\\\\n\"\[\r\n\]+\\&\"the function call\\).\\\\n\"\[\r\n\]+406\\^error,msg=\"The program being debugged stopped while in a function called from GDB.\\\\nWhen the function \\(have_a_very_merry_interrupt\\) is done executing, GDB will silently\\\\nstop \\(instead of continuing to evaluate the expression containing\\\\nthe function call\\).\""
> +mi_gdb_test "406-data-evaluate-expression have_a_very_merry_interrupt()" "\\&\"The program being debugged stopped while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"When the function \\(have_a_very_merry_interrupt\\) is done executing, GDB will silently\\\\n\"\[\r\n\]+\\&\"stop \\(instead of continuing to evaluate the expression containing\\\\n\"\[\r\n\]+\\&\"the function call\\).\\\\n\"\[\r\n\]+406\\^error,msg=\"The program being debugged stopped while in a function called from GDB.\\\\nWhen the function \\(have_a_very_merry_interrupt\\) is done executing, GDB will silently\\\\nstop \\(instead of continuing to evaluate the expression containing\\\\nthe function call\\).\""
> +
> +expect {
> +	-i $mi_inferior_spawn_id -re "Waiting to get a signal\[\r\n\]+"
> +}
>  
>  # We should have both a signal handler and a call dummy frame
>  # in this next output.
> @@ -102,7 +111,11 @@
>  # Call bar() by hand, which should get an exception while running.
>  # 
>  
> -mi_gdb_test "410-data-evaluate-expression bar()" "hi in bar\[\r\n\]+\\&\"The program being debugged was signaled while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"GDB remains in the frame where the signal was received.\\\\n\"\[\r\n\]+\\&\"To change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\n\"\[\r\n\]+\\&\"Evaluation of the expression containing the function \\(bar\\) will be abandoned.\\\\n\"\[\r\n\]+410\\^error,msg=\"The program being debugged was signaled while in a function called from GDB.\\\\nGDB remains in the frame where the signal was received.\\\\nTo change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\nEvaluation of the expression containing the function \\(bar\\) will be abandoned.\"" "call inferior function which raises exception"
> +mi_gdb_test "410-data-evaluate-expression bar()" "\\&\"The program being debugged was signaled while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"GDB remains in the frame where the signal was received.\\\\n\"\[\r\n\]+\\&\"To change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\n\"\[\r\n\]+\\&\"Evaluation of the expression containing the function \\(bar\\) will be abandoned.\\\\n\"\[\r\n\]+410\\^error,msg=\"The program being debugged was signaled while in a function called from GDB.\\\\nGDB remains in the frame where the signal was received.\\\\nTo change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\nEvaluation of the expression containing the function \\(bar\\) will be abandoned.\"" "call inferior function which raises exception"
> +
> +expect {
> +	-i $mi_inferior_spawn_id -re "hi in bar\[\r\n\]+"
> +}
>  
>  mi_gdb_test "411-stack-list-frames" "411\\^done,reason=\"signal-received\",signal-name=\".*\",signal-meaning=\".*\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"bar\",args=\\\[\\\],file=\".*mi-syn-frame.c\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",file=\".*mi-syn-frame.c\",line=\"$decimal\"},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"}.*\\\]" "backtrace from inferior function at exception"
>  
> Index: src/gdb/testsuite/lib/mi-support.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
> retrieving revision 1.24
> diff -w -u -r1.24 mi-support.exp
> --- src/gdb/testsuite/lib/mi-support.exp	18 Jan 2004 15:23:30 -0000	1.24
> +++ src/gdb/testsuite/lib/mi-support.exp	7 Feb 2005 20:08:35 -0000
> @@ -28,6 +28,8 @@
>      set mi_gdb_prompt "\[(\]gdb\[)\] \r\n"
>  }
>  
> +global mi_inferior_spawn_id
> +
>  set MIFLAGS "-i=mi"
>  
>  #
> @@ -99,6 +101,8 @@
>  
>      gdb_stop_suppressing_tests;
>  
> +	load /home/bob/cvs/tcl_ext/extension/libgdbmi.so
> +
>      # Start SID.
>      if { [info procs sid_start] != "" } {
>  	verbose "Spawning SID"
> @@ -117,6 +121,11 @@
>  	    exit 1
>  	}
>      }
> +	spawn -pty
> +	global mi_inferior_spawn_id
> +	set mi_inferior_spawn_id $spawn_id
> +	set mi_inferior_tty_name $spawn_out(slave,name)
> +	
>      set res [remote_spawn host "$GDB -nw $GDBFLAGS $MIFLAGS [host_info gdb_opts]"];
>      if { $res < 0 || $res == "" } {
>  	perror "Spawning $GDB failed."
> @@ -189,6 +198,26 @@
>  	    warning "Couldn't set the width to 0."
>  	}
>      }
> +	# redirect the inferior output to /dev/null, it's not needed in this testsuite
> +    send_gdb "102-interpreter-exec console \"tty $mi_inferior_tty_name\"\n"
> +    gdb_expect 10 {
> +	-re ".*$mi_gdb_prompt$" {
> +	    verbose "redirect inferior output to /dev/null" 2
> +	}
> +	timeout {
> +	    warning "Couldn't redirect inferior output."
> +	}
> +    }
> +	# tell GDB not to echo, for some reason, stty_init isn't working
> +    send_gdb "103-interpreter-exec console \"shell stty -echo\"\n"
> +    gdb_expect 10 {
> +	-re ".*$mi_gdb_prompt$" {
> +	    verbose "turning off the terminal echoing" 2
> +	}
> +	timeout {
> +	    warning "Couldn't turn off the terminal's echoing."
> +	}
> +    }
>  
>      return 0;
>  }
> @@ -209,7 +238,7 @@
>  	    send_gdb "y\n";
>  	    exp_continue
>           }
> -	 -re ".*102-break-delete\r\n102\\\^done\r\n$mi_gdb_prompt$" {
> +	 -re "102\\\^done\r\n$mi_gdb_prompt$" {
>              # This happens if there were no breakpoints
>  	 }
>  	 timeout { perror "Delete all breakpoints in mi_delete_breakpoints (timeout)" ; return }
> @@ -219,9 +248,9 @@
>  # empty BreakpointTable. Also, a query is not acceptable with mi.
>      send_gdb "103-break-list\n"
>      gdb_expect 30 {
> -	 -re "103-break-list\r\n103\\\^done,BreakpointTable=\{\}\r\n$mi_gdb_prompt$" {}
> -	 -re "103-break-list\r\n103\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[\\\]\}" {}
> -	 -re "103-break-list\r\n103\\\^doneNo breakpoints or watchpoints.\r\n\r\n$mi_gdb_prompt$" {warning "Unexpected console text received"}
> +	 -re "103\\\^done,BreakpointTable=\{\}\r\n$mi_gdb_prompt$" {}
> +	 -re "103\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[\\\]\}" {}
> +	 -re "103\\\^doneNo breakpoints or watchpoints.\r\n\r\n$mi_gdb_prompt$" {warning "Unexpected console text received"}
>  	 -re "$mi_gdb_prompt$" { perror "Breakpoints not deleted" ; return }
>  	 -re "Delete all breakpoints.*or n.*$" {
>  	    warning "Unexpected prompt for breakpoints deletion";
> @@ -396,7 +425,7 @@
>              perror "($arg) No such file or directory\n"
>              return -1
>          }
> -        -re "105-file-exec-and-symbols .*\r\n105\\\^done\r\n$mi_gdb_prompt$" {
> +        -re "105\\\^done\r\n$mi_gdb_prompt$" {
>              # We (MI) are just giving the prompt back for now, instead of giving
>  	    # some acknowledgement.
>  	    return 0
> @@ -532,6 +561,8 @@
>  #    0 if the test passes,
>  #   -1 if there was an internal error.
>  #  
> +#	 -re "\[\r\n\]*$command.*(\[\r\n\]*(($pattern)\[\r\n\]+$mi_gdb_prompt\[ \]*$))" {
> +#	 -re "^((.*?)\[\r\n\]+(.*$pattern\[\r\n\]+$mi_gdb_prompt\[ \]*))$" {
>  proc mi_gdb_test { args } {
>      global verbose
>      global mi_gdb_prompt
> @@ -598,6 +629,9 @@
>  	}
>      }
>  
> +#	set ncommand $command
> +#	regsub "\\*" $ncommand "\\\\*" ncommand
> +
>      if [info exists timeout] {
>  	set tmt $timeout;
>      } else {
> @@ -624,7 +658,22 @@
>  	    gdb_start
>  	    set result -1
>  	}
> -	 -re "\[\r\n\]*($pattern)\[\r\n\]+$mi_gdb_prompt\[ \]*$" {
> +	 -re "^(.*$pattern\[\r\n\]+$mi_gdb_prompt\[ \]*)$" {
> +#		set entire_out $expect_out(1,string)
> +#		set command_out $expect_out(2,string)
> +#		set mi_out $expect_out(3,string)
> +		set mi_out $expect_out(1,string)
> +
> +		set parse_result [gdbmi_parse $mi_out]
> +		if [string match "syntax error" $parse_result] then {
> +			fail "Syntax check of MI Output Command failed"
> +			puts "COMMAND($command)"
> +#			puts "ENTIRE_OUT###$entire_out###"
> +#			puts "COMMAND_OUT###$command_out###"
> +			puts "PATTER_TO_END###$mi_out###"
> +			puts "BUFFER###$expect_out(buffer)###"
> +		}
> +
>  	    if ![string match "" $message] then {
>  		pass "$message"
>  	    }
> @@ -864,11 +913,11 @@
>      global decimal
>      send_gdb "220-$cmd\n"
>      gdb_expect {
> -	-re ".*220\\^running\r\n${mi_gdb_prompt}.*220\\*stopped,reason=\"$reason\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\".*$file\",line=\"$line\"\}$extra\r\n$mi_gdb_prompt$" {
> +	-re "220\\^running\r\n${mi_gdb_prompt}.*220\\*stopped,reason=\"$reason\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\".*$file\",line=\"$line\"\}$extra\r\n$mi_gdb_prompt$" {
>  	    pass "$test"
>  	    return 0
>  	}
> -	-re ".*220\\^running\r\n${mi_gdb_prompt}.*220\\*stopped,reason=\"$reason\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].*\[\\\]\}\],file=\".*\",line=\"\[0-9\]*\"\}.*\r\n$mi_gdb_prompt$" {
> +	-re "220\\^running\r\n${mi_gdb_prompt}.*220\\*stopped,reason=\"$reason\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].*\[\\\]\}\],file=\".*\",line=\"\[0-9\]*\"\}.*\r\n$mi_gdb_prompt$" {
>  	    fail "$test (stopped at wrong place)"
>  	    return -1
>  	}


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