diff options
author | Andrew Cagney <cagney@redhat.com> | 2003-02-03 06:02:47 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2003-02-03 06:02:47 +0000 |
commit | f4f0e87853e67c845fec3c681e61cfa881834a3d (patch) | |
tree | 1059d69eb6db60f524972004f3918b5821a6d75a /gdb/testsuite/gdb.mi | |
parent | 6e049a14bf180a9db80bf9e437498798b0ba2cf5 (diff) | |
download | gdb-f4f0e87853e67c845fec3c681e61cfa881834a3d.tar.gz |
Merge kseitz_interps-20020528-branch.
Diffstat (limited to 'gdb/testsuite/gdb.mi')
21 files changed, 417 insertions, 155 deletions
diff --git a/gdb/testsuite/gdb.mi/ChangeLog b/gdb/testsuite/gdb.mi/ChangeLog index 2e2a82e3c85..8af7538b053 100644 --- a/gdb/testsuite/gdb.mi/ChangeLog +++ b/gdb/testsuite/gdb.mi/ChangeLog @@ -1,3 +1,29 @@ +2002-08-21 Keith Seitz <keiths@redhat.com> + + * mi-cli.exp: Use "target_changed" instead of "register-update". + +2002-07-25 Keith Seitz <keiths@redhat.com> + + * mi-cli.exp: Fix typo in result for "-interpreter-exec console list" + test. + Don't break at main: use mi_run_to_main instead. + Add tests to break in callee4 and navigate the stack. + Add test to set a register and test for update event. + +2002-07-22 Keith Seitz <keiths@redhat.com> + + * mi-cli.exp: Use mi_run_to_main to get to main. Don't use "run". + Refine result string for "-interpreter-exec console bougs" test. + +2002-06-25 Keith Seitz <keiths@redhat.com> + + * mi-cli.exp: Add tests to check if list_command in the console + is synchronized with MI's state. + +2002-06-24 Keith Seitz <keiths@redhat.com> + + * mi-cli.exp: New file. + 2002-12-13 Jeff Johnston <jjohnstn@redhat.com> * mi-basics.exp: Change tests for -environment-directory. Also add diff --git a/gdb/testsuite/gdb.mi/mi-break.exp b/gdb/testsuite/gdb.mi/mi-break.exp index 5cbe4e40d2e..ffc23a6b4d8 100644 --- a/gdb/testsuite/gdb.mi/mi-break.exp +++ b/gdb/testsuite/gdb.mi/mi-break.exp @@ -1,4 +1,4 @@ -# Copyright 1999 Free Software Foundation, Inc. +# Copyright 1999, 2002 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -62,20 +62,20 @@ proc test_tbreak_creation_and_listing {} { # -break-list mi_gdb_test "222-break-insert -t main" \ - "222\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \ + "=breakpoint-create,number=\"1\"\r\n222\\^done" \ "break-insert -t operation" mi_gdb_test "333-break-insert -t basics.c:callee2" \ - "333\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",line=\"22\",times=\"0\"\}" \ + "=breakpoint-create,number=\"2\"\r\n333\\^done" \ "insert temp breakpoint at basics.c:callee2" mi_gdb_test "444-break-insert -t basics.c:15" \ - "444\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"callee3\",file=\".*basics.c\",line=\"15\",times=\"0\"\}" \ + "=breakpoint-create,number=\"3\"\r\n444\\^done" \ "insert temp breakpoint at basics.c:15 (callee3)" # Getting the quoting right is tricky. That is "\"<file>\":6" mi_gdb_test "555-break-insert -t \"\\\"${srcfile}\\\":6\"" \ - "555\\^done,bkpt=\{number=\"4\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"6\",times=\"0\"\}" \ + "=breakpoint-create,number=\"4\"\r\n555\\^done" \ "insert temp breakpoint at \"<fullfilename>\":6 (callee4)" mi_gdb_test "666-break-list" \ diff --git a/gdb/testsuite/gdb.mi/mi-cli.exp b/gdb/testsuite/gdb.mi/mi-cli.exp new file mode 100644 index 00000000000..850d177cb19 --- /dev/null +++ b/gdb/testsuite/gdb.mi/mi-cli.exp @@ -0,0 +1,143 @@ +# Copyright 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# Please email any bugs, comments, and/or additions to this file to: +# bug-gdb@prep.ai.mit.edu + +# This file tests that GDB's console can be accessed via the MI. +# Specifically, we are testing the "interpreter-exec" command and that +# the commands that are executed via this command are properly executed. +# Console commands executed via MI should use MI output wrappers, MI event +# handlers, etc. + +load_lib mi-support.exp +set MIFLAGS "-i=mi" + +gdb_exit +if [mi_gdb_start] { + continue +} + +set testfile "basics" +set srcfile ${testfile}.c +set binfile ${objdir}/${subdir}/${testfile} +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } { + gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." +} + +mi_gdb_reinitialize_dir $srcdir/$subdir + +mi_gdb_test "-interpreter-exec" \ + {\^error,msg="mi_cmd_interpreter_exec: Usage: -interpreter-exec interp command"} \ + "-interpreter-exec with no arguments" + +mi_gdb_test "-interpreter-exec console" \ + {\^error,msg="mi_cmd_interpreter_exec: Usage: -interpreter-exec interp command"} \ + "-interpreter-exec with one argument" + +mi_gdb_test "-interpreter-exec bogus command" \ + {\^error,msg="mi_cmd_interpreter_exec: could not find interpreter \\\"bogus\\\""} \ + "-interpreter-exec with bogus interpreter" + +set msg {Undefined command: \\\"bogus\\\"\. Try \\\"help\\\"\.} +mi_gdb_test "-interpreter-exec console bogus" \ + "&\\\"$msg\\\\n\\\".*\\^error,msg=\\\"$msg\\\".*" \ + "-interpreter-exec console bogus" + +mi_gdb_test "-interpreter-exec console \"file $binfile\"" \ + {(=.*)+\^done} \ + "-interpreter-exec console \"file \$binfile\"" + +mi_run_to_main + +mi_gdb_test "-interpreter-exec console \"set args foobar\"" \ + {\^done} \ + "-interpreter-exec console \"set args foobar\"" + +mi_gdb_test "-interpreter-exec console \"show args\"" \ + {\~"Argument list to give program being debugged when it is started is \\\"foobar\\\"\.\\n".*\^done} \ + "-interpreter-exec console \"show args\"" + +mi_gdb_test "-interpreter-exec console \"break callee4\"" \ + {(&.*)*.*~"Breakpoint 2 at.*\\n".*=breakpoint-create,number="2".*\^done} \ + "-interpreter-exec console \"break callee4\"" + +mi_gdb_test "-interpreter-exec console \"info break\"" \ + {\~"Num[ \t]*Type[ \t]*Disp[ \t]*Enb[ \t]*Address[ \t]*What\\n".*~"2[ \t]*breakpoint[ \t]*keep[ \t]*y[ \t]*0x[0-9A-Fa-f]+[ \t]*in callee4 at .*basics.c:[0-9]+\\n".*\^done} \ + "-interpreter-exec console \"info break\"" + +mi_gdb_test "-interpreter-exec console \"set listsize 1\"" \ + {\^done} \ + "-interpreter-exec console \"set listsize 1\"" + +mi_gdb_test "-interpreter-exec console \"list\"" \ + {.*\~"32[ \t(\\t)]*callee1.*\\n".*\^done} \ + "-interpreter-exec console \"list\"" + +mi_gdb_test "-exec-continue" \ + {.*\*stopped,reason="breakpoint-hit",.*func="callee4".*file=".*basics.c",line="8"\}} \ + "-interpreter-exec console \"continue to callee4\"" + +mi_gdb_test "-interpreter-exec console \"delete 2\"" \ + {.*=breakpoint-delete,number=\"2\".*\^done} \ + "-interpreter-exec console \"delete 2\"" + +mi_gdb_test "-interpreter-exec console \"up\"" \ + {.*=selected-frame-level-changed,level="1".*\^done} \ + "-interpreter-exec console \"up\"" + +mi_gdb_test "-interpreter-exec console \"down\"" \ + {.*=selected-frame-level-changed,level="0".*\^done} \ + "-interpreter-exec console \"down\"" + +mi_gdb_test "-interpreter-exec console \"frame 2\"" \ + {.*=selected-frame-level-changed,level="2".*\^done} \ + "-interpreter-exec console \"frame 2\"" + +mi_gdb_test "-stack-select-frame 0" \ + {.*=selected-frame-level-changed,level="0".*\^done} \ + "-stack-select-frame 0" + +mi_gdb_test "-break-insert -t basics.c:35" \ + {.*=breakpoint-create,number="3".*\^done} \ + "-break-insert -t basics.c:35" + +mi_gdb_test "-exec-continue" \ + {.*\*stopped.*,file=".*basics.c",line="35"\}} \ + "-exec-continue to line 35" + +mi_gdb_test "-exec-next" \ + {.*\*stopped,reason="end-stepping-range",.*,file=".*basics.c",line="37"\}} \ + "-exec-next to line 37" + +mi_gdb_test "-interpreter-exec console \"list\"" \ + {\~"37[ \t(\\t)]*return 0;\\n".*\^done} \ + "-interpreter-exec console \"list\" at basics.c:37" + +mi_gdb_test "-interpreter-exec console \"help set args\"" \ + {\~"Set argument list to give program being debugged when it is started\.\\nFollow this command with any number of args, to be passed to the program\.".*\^done} \ + "-interpreter-exec console \"help set args\"" + +mi_gdb_test "-interpreter-exec console \"set \$pc=0x0\"" \ + {.*=target-changed.*\^done} \ + "-interpreter-exec console \"set \$pc=0x0\"" + +#mi_gdb_test "-interpreter-exec console \"\"" \ + {} \ + "-interpreter-exec console \"\"" + +mi_gdb_exit +return 0 diff --git a/gdb/testsuite/gdb.mi/mi-pthreads.exp b/gdb/testsuite/gdb.mi/mi-pthreads.exp index 532134acc04..8fc5061c803 100644 --- a/gdb/testsuite/gdb.mi/mi-pthreads.exp +++ b/gdb/testsuite/gdb.mi/mi-pthreads.exp @@ -17,11 +17,11 @@ # Please email any bugs, comments, and/or additions to this file to: # bug-gdb@prep.ai.mit.edu -# This file tests MI thread commands. -# Specifically, we are testing the MI command set and the console (in MI) -# command set ("interpreter-exec") and that the commands that are executed -# via these command pathways are properly executed. Console commands -# executed via MI should use MI output wrappers, MI event handlers, etc. +# This file tests that GDB's console can be accessed via the MI. +# Specifically, we are testing the "interpreter-exec" command and that +# the commands that are executed via this command are properly executed. +# Console commands executed via MI should use MI output wrappers, MI event +# handlers, etc. # This only works with native configurations if {![isnative]} { @@ -36,10 +36,6 @@ if {[mi_gdb_start]} { continue } -# The procs below dealing with parsing cli/mi output for the threadlist -# is duplicated in gdb669.exp. Any changes here will probably need to -# be made there as well. - proc get_mi_thread_list {name} { global expect_out @@ -49,16 +45,11 @@ proc get_mi_thread_list {name} { # ^done,thread-ids=[thread-id="1",thread-id="2",...],number-of-threads="N" # (gdb) mi_gdb_test "-thread-list-ids" \ - {\^done,thread-ids={(thread-id="[0-9]+"(,)?)+},number-of-threads="[0-9]+"} \ + {\^done,thread-ids=\{(thread-id="[0-9]+"(,)*)+\},number-of-threads="[0-9]+"} \ "-thread_list_ids ($name)" - set output {} - if {[info exists expect_out(buffer)]} { - set output $expect_out(buffer) - } - set thread_list {} - if {![regexp {thread-ids=\{(thread-id="[0-9]+"(,)?)*\}} $output threads]} { + if {![regexp {thread-ids=\{(thread-id="[0-9]+"(,)?)*\}} $expect_out(buffer) threads]} { fail "finding threads in MI output ($name)" } else { pass "finding threads in MI output ($name)" @@ -83,12 +74,9 @@ proc check_mi_and_console_threads {name} { global expect_out mi_gdb_test "-thread-list-ids" \ - {\^done,thread-ids={(thread-id="[0-9]+"(,)*)+},number-of-threads="[0-9]+"} \ + {\^done,thread-ids=\{(thread-id="[0-9]+"(,)*)+\},number-of-threads="[0-9]+"} \ "-thread-list-ids ($name)" - set mi_output {} - if {[info exists expect_out(buffer)]} { - set mi_output $expect_out(buffer) - } + set mi_output $expect_out(buffer) # GDB will return a list of thread ids and some more info: # @@ -98,14 +86,10 @@ proc check_mi_and_console_threads {name} { # ~" 3 Thread 1026 (LWP 7733) () at __libc_nanosleep:-1" # ~" 2 Thread 2049 (LWP 7732) 0x401411f8 in __poll (fds=0x804bb24, nfds=1, timeout=2000) at ../sysdeps/unix/sysv/linux/poll.c:63" # ~"* 1 Thread 1024 (LWP 7731) main (argc=1, argv=0xbfffdd94) at ../../../src/gdb/testsuite/gdb.mi/pthreads.c:160" - # FIXME: kseitz/2002-09-05: Don't use the hack-cli method. - mi_gdb_test "info threads" \ + mi_gdb_test {-interpreter-exec console "info threads"} \ {.*(~".*"[\r\n]*)+.*} \ "info threads ($name)" - set console_output {} - if {[info exists $expect_out(buffer)]} { - set console_output $expect_out(buffer) - } + set console_output $expect_out(buffer) # Make a list of all known threads to console (gdb's thread IDs) set console_thread_list {} @@ -175,6 +159,19 @@ proc check_mi_and_console_threads {name} { } } +# This procedure checks for the bug gdb/669, where the console +# command "info threads" and the MI command "-thread-list-ids" +# return different threads in the system. +proc check_for_gdb669_bug {} { + mi_run_to_main + check_mi_and_console_threads "at main" + + for {set i 0} {$i < 4} {incr i} { + mi_next "next, try $i" + check_mi_and_console_threads "try $i" + } +} + # This procedure tests the various thread commands in MI. proc check_mi_thread_command_set {} { @@ -195,11 +192,24 @@ proc check_mi_thread_command_set {} { # many of the threads are blocked in libc calls, # and many people have libc's with no symbols. mi_gdb_test "-thread-select $thread" \ - "\\^done,new-thread-id=\"$thread\",frame={.*}(,line=\"(-)?\[0-9\]+\",file=\".*\")?" \ + "=context-changed,thread=\"$thread\"\r\n\\^done,new-thread-id=\"$thread\",frame={.*},line=\"(-)?\[0-9\]+\",file=\".*\"" \ "check_mi_thread_command_set: -thread-select $thread" } } +# This procedure checks that the console and MI don't get out +# of sync with each other. +proc check_console_thread_commands {} { + + # Assumed that we're at done_making_threads + set thread_list [get_mi_thread_list "in check_console_thread_commands"] + foreach thread $thread_list { + mi_gdb_test "-interpreter-exec console \"thread $thread\"" \ + "(\\~\".*\"\r\n)*=context-changed,thread=\"$thread\"\r\n\\^done" \ + "-interpreter-exec console \"thread $thread\"" + } +} + # # Start here # @@ -216,6 +226,8 @@ mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_load $binfile check_mi_thread_command_set +check_console_thread_commands +check_for_gdb669_bug mi_gdb_exit diff --git a/gdb/testsuite/gdb.mi/mi-return.exp b/gdb/testsuite/gdb.mi/mi-return.exp index ca37e9fc9fc..0454e0ef788 100644 --- a/gdb/testsuite/gdb.mi/mi-return.exp +++ b/gdb/testsuite/gdb.mi/mi-return.exp @@ -46,7 +46,6 @@ mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_load ${binfile} - proc test_return_simple {} { global mi_gdb_prompt global hex diff --git a/gdb/testsuite/gdb.mi/mi-simplerun.exp b/gdb/testsuite/gdb.mi/mi-simplerun.exp index a3ebd20910b..4c6629700a3 100644 --- a/gdb/testsuite/gdb.mi/mi-simplerun.exp +++ b/gdb/testsuite/gdb.mi/mi-simplerun.exp @@ -1,4 +1,4 @@ -# Copyright 1999, 2000 Free Software Foundation, Inc. +# Copyright 1999, 2000, 2002 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -62,19 +62,19 @@ proc test_breakpoints_creation_and_listing {} { # -break-info mi_gdb_test "200-break-insert main" \ - "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \ + "=breakpoint-create,number=\"1\"\r\n200\\^done" \ "break-insert operation" mi_gdb_test "201-break-insert basics.c:callee2" \ - "201\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",line=\"22\",times=\"0\"\}" \ + "=breakpoint-create,number=\"2\"\r\n201\\^done" \ "insert breakpoint at basics.c:callee2" mi_gdb_test "202-break-insert basics.c:15" \ - "202\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee3\",file=\".*basics.c\",line=\"15\",times=\"0\"\}" \ + "=breakpoint-create,number=\"3\"\r\n202\\^done" \ "insert breakpoint at basics.c:15 (callee3)" mi_gdb_test "203-break-insert \"\\\"${srcfile}\\\":6\"" \ - "203\\^done,bkpt=\{number=\"4\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"6\",times=\"0\"\}" \ + "=breakpoint-create,number=\"4\"\r\n203\\^done" \ "insert breakpoint at \"<fullfilename>\":6 (callee4)" mi_gdb_test "204-break-list" \ @@ -82,7 +82,7 @@ proc test_breakpoints_creation_and_listing {} { "list of breakpoints" mi_gdb_test "205-break-disable 2 3 4" \ - "205\\^done.*" \ + "=breakpoint-modify,number=\"2\"\r\n=breakpoint-modify,number=\"3\"\r\n=breakpoint-modify,number=\"4\"\r\n205\\^done.*" \ "disabling of breakpoints" mi_gdb_test "206-break-info 2" \ diff --git a/gdb/testsuite/gdb.mi/mi-until.exp b/gdb/testsuite/gdb.mi/mi-until.exp index ac276cc5229..8e82a0c053a 100644 --- a/gdb/testsuite/gdb.mi/mi-until.exp +++ b/gdb/testsuite/gdb.mi/mi-until.exp @@ -1,4 +1,4 @@ -# Copyright 1999, 2000 Free Software Foundation, Inc. +# Copyright 1999, 2000, 2002 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -46,12 +46,13 @@ mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_load ${binfile} +set timeout 5 proc test_running_to_foo {} { global mi_gdb_prompt global hex mi_gdb_test "200-break-insert 10" \ - "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"foo\",file=\".*until.c\",line=\"10\",times=\"0\"\}" \ + "=breakpoint-create,number=\"1\"\r\n200\\^done" \ "break-insert operation" mi_run_cmd @@ -68,7 +69,7 @@ proc test_running_to_foo {} { } } - mi_gdb_test "100-break-delete 1" "100\\^done" "break-delete 1" + mi_gdb_test "100-break-delete 1" "=breakpoint-delete,number=\"1\"\r\n100\\^done" "break-delete 1" } @@ -88,7 +89,7 @@ proc test_until {} { send_gdb "222-exec-until 15\n" gdb_expect { - -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"15\"\}\r\n$mi_gdb_prompt$" { + -re "222\\^running\r\n${mi_gdb_prompt}(=breakpoint-.*\r\n)*222\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"15\"\}\r\n$mi_gdb_prompt$" { pass "until line number" } timeout { @@ -98,7 +99,7 @@ proc test_until {} { send_gdb "333-exec-until until.c:17\n" gdb_expect { - -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"17\"\}\r\n$mi_gdb_prompt$" { + -re "333\\^running\r\n${mi_gdb_prompt}(=breakpoint-.*\r\n)*333\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"17\"\}\r\n$mi_gdb_prompt$" { pass "until line number:file" } timeout { @@ -110,7 +111,7 @@ proc test_until {} { send_gdb "444-exec-until until.c:25\n" gdb_expect { - -re "444\\^running\r\n${mi_gdb_prompt}444\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*until.c\",line=\"24\"\}\r\n$mi_gdb_prompt$" { + -re "444\\^running\r\n${mi_gdb_prompt}(=breakpoint-.*\r\n)*444\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*until.c\",line=\"24\"\}\r\n$mi_gdb_prompt$" { pass "until after current function" } timeout { diff --git a/gdb/testsuite/gdb.mi/mi-var-cmd.exp b/gdb/testsuite/gdb.mi/mi-var-cmd.exp index 7d02b36943a..bdb4f75fbd6 100644 --- a/gdb/testsuite/gdb.mi/mi-var-cmd.exp +++ b/gdb/testsuite/gdb.mi/mi-var-cmd.exp @@ -385,7 +385,7 @@ mi_gdb_test "-var-assign lsimple.integer 333" \ ##### mi_gdb_test "-break-insert subroutine1" \ - "\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"subroutine1\",file=\".*var-cmd.c\",line=\"146\",times=\"0\"\}" \ + "=breakpoint-create,number=\"2\"\r\n\\^done" \ "break-insert subroutine1" mi_continue_to "2" "subroutine1" \ "\{name=\"i\",value=\"4321\"\},\{name=\"l\",value=\"$hex\"\}" \ @@ -530,7 +530,7 @@ mi_gdb_test "-var-delete l" \ # Test whether we can follow the name of a variable through multiple # stack frames. mi_gdb_test "-break-insert do_special_tests" \ - {\^done,bkpt=.*} \ + "=breakpoint-create,number=\"\[0-9\]+\"\r\n\\^done" \ "set breakpoint at do_special_tests" mi_continue_to {.*} do_special_tests {.*} {.*var-cmd.c} {.*} {stop in do_special_tests} @@ -540,7 +540,7 @@ mi_gdb_test "-var-create selected_a @ a" \ "create selected_a" mi_gdb_test "-break-insert incr_a" \ - {\^done,bkpt=.*} \ + "=breakpoint-create,number=\"\[0-9\]+\"\r\n\\^done" \ "set breakpoint at incr_a" mi_continue_to {.*} incr_a {.*} {.*var-cmd.c} {.*} {stop in incr_a} diff --git a/gdb/testsuite/gdb.mi/mi-var-display.exp b/gdb/testsuite/gdb.mi/mi-var-display.exp index fafa79a3390..1a888dfa0df 100644 --- a/gdb/testsuite/gdb.mi/mi-var-display.exp +++ b/gdb/testsuite/gdb.mi/mi-var-display.exp @@ -43,7 +43,7 @@ mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_load ${binfile} mi_gdb_test "200-break-insert 260" \ - "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_children_tests\",file=\".*var-cmd.c\",line=\"260\",times=\"0\"\}" \ + "=breakpoint-create,number=\"1\"\r\n200\\^done" \ "break-insert operation" mi_run_cmd @@ -325,12 +325,12 @@ mi_gdb_test "-var-delete weird" \ # Stop in "do_special_tests" mi_gdb_test "200-break-insert do_special_tests" \ - "200\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_special_tests\",file=\".*var-cmd.c\",line=\"282\",times=\"0\"\}" \ + "=breakpoint-create,number=\"2\"\r\n200\\^done" \ "break-insert operation" send_gdb "-exec-continue\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_special_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"282\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}(=breakpoint-.*\r\n)*\\*stopped,reason=\"breakpoint-hit\",bkptno=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_special_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"282\"\}\r\n$mi_gdb_prompt$" { pass "continue to do_special_tests" } timeout { @@ -584,14 +584,14 @@ gdb_expect { } mi_gdb_test "200-break-insert incr_a" \ - "200\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"incr_a\",file=\".*var-cmd.c\",line=\"85\",times=\"0\"\}" \ + "=breakpoint-create,number=\"3\"\r\n200\\^done" \ "break-insert operation" send_gdb "-exec-continue\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",line=\"85\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}(=breakpoint-.*\r\n)*\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",line=\"85\"\}\r\n$mi_gdb_prompt$" { pass "continue to incr_a" } - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"\.*\"\}\\\],file=\".*var-cmd.c\",line=\"8\[345\]\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}(=breakpoint-.*\r\n)*\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"\.*\"\}\\\],file=\".*var-cmd.c\",line=\"8\[345\]\"\}\r\n$mi_gdb_prompt$" { fail "continue to incr_a (compiler debug info incorrect)" } -re "\\^running\r\n${mi_gdb_prompt}.*\r\n$mi_gdb_prompt$" { diff --git a/gdb/testsuite/gdb.mi/mi-watch.exp b/gdb/testsuite/gdb.mi/mi-watch.exp index ba243999d19..c7bffb510e4 100644 --- a/gdb/testsuite/gdb.mi/mi-watch.exp +++ b/gdb/testsuite/gdb.mi/mi-watch.exp @@ -58,7 +58,7 @@ proc test_watchpoint_creation_and_listing {} { # -break-list mi_gdb_test "111-break-watch C" \ - "111\\^done,wpt=\{number=\"2\",exp=\"C\"\}" \ + "=breakpoint-create,number=\"2\"\r\n111\\^done" \ "break-watch operation" mi_gdb_test "222-break-list" \ @@ -79,7 +79,7 @@ proc test_awatch_creation_and_listing {} { # -break-list mi_gdb_test "333-break-watch -a A" \ - "333\\^done,bkpt=\{number=\"1\",addr=\"$hex\",file=\".*basics.c\",line=\"32\"\}" \ + "=breakpoint-create,number=\"1\"\r\n333\\^done" \ "break-watch -a operation" mi_gdb_test "444-break-list" \ @@ -87,7 +87,7 @@ proc test_awatch_creation_and_listing {} { "list of watchpoints awatch" mi_gdb_test "777-break-delete 3" \ - "777\\^done" \ + "=breakpoint-delete,number=\"3\"\r\n777\\^done" \ "delete access watchpoint" } @@ -103,7 +103,7 @@ proc test_rwatch_creation_and_listing {} { # -break-list mi_gdb_test "200-break-watch -r C" \ - "200\\^done,bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \ + "=breakpoint-create,number=\"5"\r\n200\\^done" \ "break-insert -r operation" mi_gdb_test "300-break-list" \ @@ -111,7 +111,7 @@ proc test_rwatch_creation_and_listing {} { "list of breakpoints" mi_gdb_test "177-break-delete 4" \ - "177\\^done" \ + "=breakpoint-delete,number=\"4\"\r\n177\\^done" \ "delete read watchpoint" } diff --git a/gdb/testsuite/gdb.mi/mi1-basics.exp b/gdb/testsuite/gdb.mi/mi1-basics.exp index 42d022d6861..a10468b3c10 100644 --- a/gdb/testsuite/gdb.mi/mi1-basics.exp +++ b/gdb/testsuite/gdb.mi/mi1-basics.exp @@ -1,4 +1,4 @@ -# Copyright 1999, 2000 Free Software Foundation, Inc. +# Copyright 2002 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/gdb/testsuite/gdb.mi/mi1-break.exp b/gdb/testsuite/gdb.mi/mi1-break.exp index 34a6ef7b141..04e353494ea 100644 --- a/gdb/testsuite/gdb.mi/mi1-break.exp +++ b/gdb/testsuite/gdb.mi/mi1-break.exp @@ -1,4 +1,4 @@ -# Copyright 1999 Free Software Foundation, Inc. +# Copyright 2002 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/gdb/testsuite/gdb.mi/mi1-console.exp b/gdb/testsuite/gdb.mi/mi1-console.exp index ab7f5ac5d3f..5d7a381a753 100644 --- a/gdb/testsuite/gdb.mi/mi1-console.exp +++ b/gdb/testsuite/gdb.mi/mi1-console.exp @@ -1,4 +1,4 @@ -# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +# Copyright 2002 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/gdb/testsuite/gdb.mi/mi1-hack-cli.exp b/gdb/testsuite/gdb.mi/mi1-hack-cli.exp index 951981a16b9..0f59249e10f 100644 --- a/gdb/testsuite/gdb.mi/mi1-hack-cli.exp +++ b/gdb/testsuite/gdb.mi/mi1-hack-cli.exp @@ -1,4 +1,4 @@ -# Copyright 1999 Free Software Foundation, Inc. +# Copyright 2002 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/gdb/testsuite/gdb.mi/mi1-return.exp b/gdb/testsuite/gdb.mi/mi1-return.exp index 539a61cbf44..476fe576769 100644 --- a/gdb/testsuite/gdb.mi/mi1-return.exp +++ b/gdb/testsuite/gdb.mi/mi1-return.exp @@ -53,7 +53,7 @@ proc test_return_simple {} { send_gdb "111-exec-return\n" gdb_expect { - -re "111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",line=\"18\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"} + -re "111\\^done,frame=\{level=\"0 \",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",line=\"18\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"} -re ".*\r\n$mi_gdb_prompt$" { fail "return from callee4 now" } timeout { fail "return from callee4 now (timeout)" } diff --git a/gdb/testsuite/gdb.mi/mi1-simplerun.exp b/gdb/testsuite/gdb.mi/mi1-simplerun.exp index 839903a02cc..bef690532f0 100644 --- a/gdb/testsuite/gdb.mi/mi1-simplerun.exp +++ b/gdb/testsuite/gdb.mi/mi1-simplerun.exp @@ -1,4 +1,4 @@ -# Copyright 1999, 2000 Free Software Foundation, Inc. +# Copyright 2002 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/gdb/testsuite/gdb.mi/mi1-stack.exp b/gdb/testsuite/gdb.mi/mi1-stack.exp index b8c7cab5ce3..7de39992c7b 100644 --- a/gdb/testsuite/gdb.mi/mi1-stack.exp +++ b/gdb/testsuite/gdb.mi/mi1-stack.exp @@ -57,13 +57,13 @@ proc test_stack_frame_listing {} { # -stack-list-frames 1 3 mi_gdb_test "231-stack-list-frames" \ - "231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4\",addr=\"$hex\",func=\"main\",.*\}\\\]" \ + "231\\^done,stack=\\\[frame=\{level=\"0 \",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\"\},frame=\{level=\"1 \",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2 \",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3 \",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4 \",addr=\"$hex\",func=\"main\",.*\}\\\]" \ "stack frame listing" mi_gdb_test "232-stack-list-frames 1 1" \ - "232\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \ + "232\\^done,stack=\\\[frame=\{level=\"1 \",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \ "stack frame listing 1 1" mi_gdb_test "233-stack-list-frames 1 3" \ - "233\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\}\\\]" \ + "233\\^done,stack=\\\[frame=\{level=\"1 \",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2 \",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3 \",addr=\"$hex\",func=\"callee1\",.*\}\\\]" \ "stack frame listing 1 3" mi_gdb_test "234-stack-list-frames 1" \ diff --git a/gdb/testsuite/gdb.mi/mi1-until.exp b/gdb/testsuite/gdb.mi/mi1-until.exp index a036b937c68..44daf79c9bd 100644 --- a/gdb/testsuite/gdb.mi/mi1-until.exp +++ b/gdb/testsuite/gdb.mi/mi1-until.exp @@ -1,4 +1,4 @@ -# Copyright 1999, 2000 Free Software Foundation, Inc. +# Copyright 2002 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/gdb/testsuite/gdb.mi/mi1-var-child.exp b/gdb/testsuite/gdb.mi/mi1-var-child.exp index 92ae3819277..91536a67d57 100644 --- a/gdb/testsuite/gdb.mi/mi1-var-child.exp +++ b/gdb/testsuite/gdb.mi/mi1-var-child.exp @@ -1,5 +1,5 @@ -# Copyright (C) 1999, 2000, 2002 Free Software Foundation - +# Copyright 2002 Free Software Foundation, Inc. +# # This Program Is Free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or @@ -42,7 +42,19 @@ mi_delete_breakpoints mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_load ${binfile} -mi_runto do_children_tests +mi_gdb_test "200-break-insert do_children_tests" \ + "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_children_tests\",file=\".*var-cmd.c\",line=\"190\",times=\"0\"\}" \ + "break-insert operation" + +mi_run_cmd +# The running part has been checked already by mi_run_cmd +gdb_expect { + -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"190\"\}\r\n$mi_gdb_prompt$" { + pass "run to do_children_tests" + } + -re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"} + timeout {fail "run to do_children_tests (timeout 2)"} +} ##### ##### # # @@ -555,8 +567,16 @@ mi_gdb_test "-var-info-num-children struct_declarations.int_ptr_ptr.*int_ptr_ptr # Step to "struct_declarations.integer = 123;" -set line 192 -mi_step_to do_children_tests {} {.*var-cmd.c} $line "step to line $line" +send_gdb "-exec-step\n" +gdb_expect { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"192\"\}\r\n$mi_gdb_prompt$" { + pass "step at do_children_tests" + } + timeout { + fail "step at do_children_tests (timeout)" + } +} + # Test: c_variable-4.81 # Desc: create local variable "weird" @@ -754,8 +774,15 @@ mi_gdb_test "-var-update *" \ "update all vars. None changed" # Step over "struct_declarations.integer = 123;" -set line 193 -mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line" +send_gdb "-exec-step\n" +gdb_expect { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"193\"\}\r\n$mi_gdb_prompt$" { + pass "step at do_children_tests" + } + timeout { + fail "step at do_children_tests (timeout)" + } +} # Test: c_variable-5.2 # Desc: check that integer changed @@ -767,8 +794,16 @@ mi_gdb_test "-var-update *" \ # weird->char_ptr = "hello"; # bar = 2121; # foo = &bar; -set line 196 -mi_execute_to "exec-step 3" "end-stepping-range" do_children_tests {} {.*var-cmd.c} $line {} "step $line" + +send_gdb "-exec-step 3\n" +gdb_expect { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"196\"\}\r\n$mi_gdb_prompt$" { + pass "step at do_children_tests" + } + timeout { + fail "step at do_children_tests (timeout)" + } +} # Test: c_variable-5.3 # Desc: check that char_ptr changed @@ -777,8 +812,15 @@ mi_gdb_test "-var-update *" \ "update all vars struct_declarations.char_ptr" # Step over "struct_declarations.int_ptr_ptr = &foo;" -set line 197 -mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line" +send_gdb "-exec-step\n" +gdb_expect { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"197\"\}\r\n$mi_gdb_prompt$" { + pass "step at do_children_tests" + } + timeout { + fail "step at do_children_tests (timeout)" + } +} # Test: c_variable-5.4 # Desc: check that int_ptr_ptr and children changed @@ -787,8 +829,15 @@ mi_gdb_test "-var-update *" \ "update all vars int_ptr_ptr and children changed" # Step over "weird->long_array[0] = 1234;" -set line 198 -mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line" +send_gdb "-exec-step\n" +gdb_expect { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"198\"\}\r\n$mi_gdb_prompt$" { + pass "step at do_children_tests" + } + timeout { + fail "step at do_children_tests (timeout)" + } +} # Test: c_variable-5.5 # Desc: check that long_array[0] changed @@ -797,8 +846,15 @@ mi_gdb_test "-var-update *" \ "update all vars struct_declarations.long_array.0 changed" # Step over "struct_declarations.long_array[1] = 2345;" -set line 199 -mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line" +send_gdb "-exec-step\n" +gdb_expect { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"199\"\}\r\n$mi_gdb_prompt$" { + pass "step at do_children_tests" + } + timeout { + fail "step at do_children_tests (timeout)" + } +} # Test: c_variable-5.6 # Desc: check that long_array[1] changed @@ -807,8 +863,15 @@ mi_gdb_test "-var-update *" \ "update all vars struct_declarations.long_array.1 changed" # Step over "weird->long_array[2] = 3456;" -set line 200 -mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line" +send_gdb "-exec-step\n" +gdb_expect { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"200\"\}\r\n$mi_gdb_prompt$" { + pass "step at do_children_tests" + } + timeout { + fail "step at do_children_tests (timeout)" + } +} # Test: c_variable-5.7 # Desc: check that long_array[2] changed @@ -824,8 +887,15 @@ mi_gdb_test "-var-update *" \ # struct_declarations.long_array[7] = 8901; # weird->long_array[8] = 9012; # struct_declarations.long_array[9] = 1234; -set line 208 -mi_execute_to "exec-step 7" "end-stepping-range" do_children_tests {} {.*var-cmd.c} $line {} "step $line" +send_gdb "-exec-step 7\n" +gdb_expect { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"208\"\}\r\n$mi_gdb_prompt$" { + pass "step at do_children_tests" + } + timeout { + fail "step at do_children_tests (timeout)" + } +} # Test: c_variable-5.8 # Desc: check that long_array[3-9] changed @@ -835,8 +905,15 @@ mi_gdb_test "-var-update *" \ # Step over "weird->func_ptr = nothing;" -set line 211 -mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line" +send_gdb "-exec-step\n" +gdb_expect { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"211\"\}\r\n$mi_gdb_prompt$" { + pass "step at do_children_tests" + } + timeout { + fail "step at do_children_tests (timeout)" + } +} # Test: c_variable-5.9 # Desc: check that func_ptr changed @@ -856,8 +933,15 @@ mi_gdb_test "-var-delete weird->int_ptr_ptr" \ # Step over all lines: # ... # psnp = &snp0; -set line 254 -mi_execute_to "exec-step 43" "end-stepping-range" do_children_tests {} {.*var-cmd.c} $line {} "step $line" +send_gdb "-exec-step 43\n" +gdb_expect { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"254\"\}\r\n$mi_gdb_prompt$" { + pass "step at do_children_tests" + } + timeout { + fail "step at do_children_tests (timeout)" + } +} # Test: c_variable-5.10 # Desc: create psnp->char_ptr @@ -1127,8 +1211,15 @@ mi_gdb_test "-var-list-children psnp->ptrs.0.next.next.ptrs" \ "get children of psnp->ptrs.0.next.next.ptrs" # Step over "snp0.char_ptr = &b3;" -set line 255 -mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line" +send_gdb "-exec-step\n" +gdb_expect { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"255\"\}\r\n$mi_gdb_prompt$" { + pass "step at do_children_tests" + } + timeout { + fail "step at do_children_tests (timeout)" + } +} # Test: c_variable-5.47 # Desc: check that psnp->char_ptr (and [0].char_ptr) changed @@ -1137,8 +1228,16 @@ mi_gdb_test "-var-update *" \ "update all vars psnp->char_ptr (and 0.char_ptr) changed" # Step over "snp1.char_ptr = &c3;" -set line 256 -mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line" +send_gdb "-exec-step\n" +gdb_expect { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"256\"\}\r\n$mi_gdb_prompt$" { + pass "step at do_children_tests" + } + timeout { + fail "step at do_children_tests (timeout)" + } +} + # Test: c_variable-5.48 # Desc: check that psnp->next->char_ptr (and [1].char_ptr) changed @@ -1148,8 +1247,16 @@ mi_gdb_test "-var-update *" \ # Step over "snp2.char_ptr = &a3;" -set line 257 -mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line" +send_gdb "-exec-step\n" +gdb_expect { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"257\"\}\r\n$mi_gdb_prompt$" { + pass "step at do_children_tests" + } + timeout { + fail "step at do_children_tests (timeout)" + } +} + # Test: c_variable-5.49 # Desc: check that psnp->next->next->char_ptr (and [2].char_ptr) changed @@ -1159,8 +1266,15 @@ mi_gdb_test "-var-update *" \ # Step over "snp0.long_ptr = &y3;" -set line 258 -mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line" +send_gdb "-exec-step\n" +gdb_expect { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"258\"\}\r\n$mi_gdb_prompt$" { + pass "step at do_children_tests" + } + timeout { + fail "step at do_children_tests (timeout)" + } +} # Test: c_variable-5.50 # Desc: check that psnp->long_ptr (and [0].long_ptr) changed @@ -1170,8 +1284,16 @@ mi_gdb_test "-var-update *" \ # Step over "snp1.long_ptr = &x3;" -set line 259 -mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line" +send_gdb "-exec-step\n" +gdb_expect { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"259\"\}\r\n$mi_gdb_prompt$" { + pass "step at do_children_tests" + } + timeout { + fail "step at do_children_tests (timeout)" + } +} + # Test: c_variable-5.51 # Desc: check that psnp->next->long_ptr (and [1].long_ptr) changed @@ -1187,8 +1309,16 @@ clear_xfail *-*-* # # Step over "snp2.long_ptr = &z3;" -set line 260 -mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line" +send_gdb "-exec-step\n" +gdb_expect { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"260\"\}\r\n$mi_gdb_prompt$" { + pass "step at do_children_tests" + } + timeout { + fail "step at do_children_tests (timeout)" + } +} + # Test: c_variable-5.52 # Desc: check that psnp->next->next->long_ptr (and [2].long_ptr) changed diff --git a/gdb/testsuite/gdb.mi/mi1-var-cmd.exp b/gdb/testsuite/gdb.mi/mi1-var-cmd.exp index c6a88b6bd93..ca98d7e52d6 100644 --- a/gdb/testsuite/gdb.mi/mi1-var-cmd.exp +++ b/gdb/testsuite/gdb.mi/mi1-var-cmd.exp @@ -276,18 +276,6 @@ mi_gdb_test "-var-assign linteger 3333" \ "\\^done,value=\"3333\"" \ "assign to linteger" -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}" \ - "update all vars: linteger changed after assign" - -mi_gdb_test "-var-assign linteger 3333" \ - "\\^done,value=\"3333\"" \ - "assign to linteger again, same value" - -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{\}" \ - "update all vars: linteger not changed after same assign" - mi_gdb_test "-var-evaluate-expression linteger" \ "\\^done,value=\"3333\"" \ "eval linteger" @@ -296,14 +284,6 @@ mi_gdb_test "-var-assign lpinteger \"&linteger + 3\"" \ "\\^done,value=\"$hex\"" \ "assign to lpinteger" -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\"\}" \ - "update all vars: lpinteger changed after assign" - -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{\}" \ - "update all vars: no changes for second update" - mi_gdb_test "-var-evaluate-expression lpinteger" \ "\\^done,value=\"$hex\"" \ "eval lpinteger" @@ -527,34 +507,5 @@ mi_gdb_test "-var-delete l" \ "\\^done,ndeleted=\"1\"" \ "delete var l" -# Test whether we can follow the name of a variable through multiple -# stack frames. -mi_gdb_test "-break-insert do_special_tests" \ - {\^done,bkpt=.*} \ - "set breakpoint at do_special_tests" - -mi_continue_to {.*} do_special_tests {.*} {.*var-cmd.c} {.*} {stop in do_special_tests} - -mi_gdb_test "-var-create selected_a @ a" \ - {\^done,name="selected_a",numchild="0",type="int"} \ - "create selected_a" - -mi_gdb_test "-break-insert incr_a" \ - {\^done,bkpt=.*} \ - "set breakpoint at incr_a" - -mi_continue_to {.*} incr_a {.*} {.*var-cmd.c} {.*} {stop in incr_a} - -mi_gdb_test "-var-update selected_a" \ - {\^done,changelist=\{name="selected_a",in_scope="true",new_type="char",new_num_children="0"\}} \ - "update selected_a in incr_a" - -mi_next "step a line in incr_a" -mi_next "return from incr_a to do_special_tests" - -mi_gdb_test "-var-update selected_a" \ - {\^done,changelist=\{name="selected_a",in_scope="true",new_type="int",new_num_children="0"\}} \ - "update selected_a in do_special_tests" - mi_gdb_exit return 0 diff --git a/gdb/testsuite/gdb.mi/mi1-var-display.exp b/gdb/testsuite/gdb.mi/mi1-var-display.exp index 0bdaee44ae4..a2873dac99d 100644 --- a/gdb/testsuite/gdb.mi/mi1-var-display.exp +++ b/gdb/testsuite/gdb.mi/mi1-var-display.exp @@ -1,4 +1,4 @@ -# Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. +# Copyright 2002 Free Software Foundation, Inc. # # This Program Is Free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by |