Update copyright year in most headers.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.mi / mi-break.exp
index 4b8d101b3a155370a77de54f4cfba99a259802a9..1064f130eb26aad5116739fc4e8a0a94ac41e2fc 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999, 2001, 2004, 2006, 2007, 2008, 2009
+# Copyright 1999, 2001, 2004, 2006, 2007, 2008, 2009, 2010
 # Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
@@ -175,7 +175,7 @@ proc test_error {} {
     # containing function call, the internal breakpoint created to handle
     # function call would be reported, messing up MI output.
     mi_gdb_test "-var-create V * return_1()" \
-        "\\^done,name=\"V\",numchild=\"0\",value=\"1\",type=\"int\"" \
+        "\\^done,name=\"V\",numchild=\"0\",value=\"1\",type=\"int\",has_more=\"0\"" \
         "create varobj for function call"
 
     mi_gdb_test "-var-update *" \
@@ -197,6 +197,45 @@ proc test_disabled_creation {} {
             "test disabled creation: cleanup"
 }
 
+proc test_breakpoint_commands {} {
+    global line_callee2_body
+    global hex
+    global fullname
+
+    mi_create_breakpoint "basics.c:callee2" 7 keep callee2 ".*basics.c" $line_callee2_body $hex \
+             "breakpoint commands: insert breakpoint at basics.c:callee2"
+
+    mi_gdb_test "-break-commands 7 \"print 10\" \"continue\"" \
+        "\\^done" \
+        "breakpoint commands: set commands"
+
+    mi_gdb_test "-break-info 7" \
+       "\\^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=\\\[bkpt=\{number=\"7\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",${fullname},line=\"$line_callee2_body\",times=\"0\",script=\{\"print 10\",\"continue\"\},original-location=\".*\"\}.*\\\]\}" \
+        "breakpoint commands: check that commands are set"
+
+    mi_gdb_test "-break-commands 7" \
+        "\\^done" \
+        "breakpoint commands: clear commands"
+
+    mi_list_breakpoints [list [list 7 "keep" "callee2" "basics.c" "$line_callee2_body" $hex]] \
+        "breakpoint commands: check that commands are cleared"
+
+    mi_run_to_main
+
+    mi_create_breakpoint "basics.c:callee2" 9 keep callee2 ".*basics.c" $line_callee2_body $hex \
+             "breakpoint commands: insert breakpoint at basics.c:callee2, again"
+
+    mi_gdb_test "-break-commands 9 \"set \$i=0\" \"while \$i<10\" \"print \$i\" \"set \$i=\$i+1\" \"end\" \"continue\" " \
+        "\\^done" \
+        "breakpoint commands: set commands"
+
+    mi_gdb_test "-exec-continue" \
+        ".*\\\$1 = 0.*\\\$10 = 9.*\\*running.*\\*stopped,reason=\"exited-normally\".*" \
+        "test hitting breakpoint with commands"    
+
+
+}
+
 test_tbreak_creation_and_listing
 test_rbreak_creation_and_listing
 
@@ -206,5 +245,7 @@ test_error
 
 test_disabled_creation
 
+test_breakpoint_commands
+
 mi_gdb_exit
 return 0
This page took 0.026749 seconds and 4 git commands to generate.