1 # Copyright 2004, 2005, 2007, 2008, 2009, 2010, 2011
2 # Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # interp.exp Test interpreter-exec command
25 if { [prepare_for_testing ${testfile}.exp ${testfile} ${testfile}.c {debug}] } {
29 # Do not use gdb_test for this test, since it has two prompts.
30 set cmd "interpreter-exec mi \"-var-update *\""
31 gdb_test_multiple $cmd $cmd {
32 -re "\\^done,changelist=\\\[\\\]\r\n$gdb_prompt " {
35 -re "\r\n$gdb_prompt $" { }
39 gdb_test "interpreter-exec console \"show version\"" "GNU gdb .*"
41 # Regression test for crash when an exception occurs in mi_parse.
42 gdb_test_multiple "interpreter-exec mi \"-break-insert --thread a\"" \
43 "regression test for mi_parse crash" {
44 -re ".error,msg=.Invalid value for the '--thread' option.\r\n$gdb_prompt " {
47 -re "\r\n$gdb_prompt $" { }
52 set cmd "interpreter-exec mi \"-stack-info-frame\""
53 gdb_test_multiple $cmd $cmd {
54 -re ".error,msg=.No registers\..\r\n$gdb_prompt " {
57 -re "\r\n$gdb_prompt $" { }
62 set cmd "interpreter-exec mi1 \"-break-insert main\""
63 gdb_test_multiple $cmd $cmd {
64 -re ".done.bkpt=.number=.\[0-9\]\[^\n\]+\r\n$gdb_prompt " {
67 -re "\r\n$gdb_prompt $" { }
72 set cmd "interpreter-exec mi2 \"-break-insert main\""
73 gdb_test_multiple $cmd $cmd {
74 -re ".done.bkpt=.number=.\[0-9\]\[^\n\]+\r\n$gdb_prompt " {
77 -re "\r\n$gdb_prompt $" { }
82 set cmd "interpreter-exec mi3 \"-break-insert main\""
83 gdb_test_multiple $cmd $cmd {
84 -re ".done.bkpt=.number=.\[0-9\]\[^\n\]+\r\n$gdb_prompt " {
87 -re "\r\n$gdb_prompt $" { }
92 if ![runto_main] then {
97 gdb_test "list" ".*\[0-9\].*main \\(int argc.*" "can list sources"