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