aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.mi
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2013-03-15 01:41:29 +0000
committerYao Qi <yao@codesourcery.com>2013-03-15 01:41:29 +0000
commit0a251e08fa4e7130f05462ecc9f60e6683cdefca (patch)
treec79ccfc1f502d7e7d48c54b67720381603201b98 /gdb/testsuite/gdb.mi
parent2c415c0f382fd6361d9d702ebdd71cd6d6a06d19 (diff)
downloadgdb-0a251e08fa4e7130f05462ecc9f60e6683cdefca.zip
gdb-0a251e08fa4e7130f05462ecc9f60e6683cdefca.tar.gz
gdb-0a251e08fa4e7130f05462ecc9f60e6683cdefca.tar.bz2
gdb/testsuite/
* gdb.threads/non-ldr-exc-1.exp (do_test): Fix the indent of using with_test_prefix. * gdb.threads/non-ldr-exc-2.exp (do_test): Likewise. * gdb.threads/non-ldr-exc-3.exp (do_test): Likewise. * gdb.threads/non-ldr-exc-4.exp (do_test): Likewise. * gdb.threads/watchpoint-fork.exp (test): Likewise. * gdb.base/break-interp.exp (test_core): Likewise. (test_attach_gdb): Likewise. * gdb.base/catch-load.exp (one_catch_load_test): Likewise. * gdb.base/disp-step-syscall.exp (disp_step_cross_syscall): Likewise. * gdb.base/jit-so.exp (one_jit_test): Likewise. * gdb.base/jit.exp (one_jit_test): Likewise. * gdb.base/sepdebug.exp (test_different_dir): Likewise. * gdb.dwarf2/dw2-dir-file-name.exp (test): Likewise. * gdb.dwarf2/dw2-noloc.exp (file_symbols): Likewise. * gdb.mi/mi-breakpoint-changed.exp (test_pending_resolved): Likewise. * gdb.mi/mi-cmd-param-changed.exp (test_command_param_changed): Likewise. * gdb.mi/mi-watch.exp test_watchpoint_all): Likewise. * gdb.mi/pr11022.exp (test_memory_changed_observer): Likewise. * gdb.trace/change-loc.exp (tracepoint_change_loc_1): Likewise. (tracepoint_change_loc_2): Likewise. * gdb.trace/disconnected-tracing.exp (disconnected_tracing): Likewise. (disconnected_tfind): Likewise. * gdb.trace/mi-traceframe-changed.exp (test_tfind_tfile): Likewise. (test_tfind_remote): Likewise. * gdb.trace/mi-tracepoint-changed.exp (test_reconnect): Likewise. (test_pending_resolved): Likewise. * gdb.trace/mi-tsv-changed.exp (test_create_delete_modify_tsv): Likewise. (test_upload_tsv): Likewise. * gdb.trace/pending.exp (pending_tracepoint_resolved): Likewise. (pending_tracepoint_works): Likewise. * gdb.trace/report.exp (use_collected_data): Likewise. * gdb.trace/status-stop.exp (test_tstart_tstop_tstart): Likewise. (test_tstart_tstart, test_buffer_full_tstart): Likewise. * gdb.trace/strace.exp (strace_info_marker): Likewise. (strace_trace_on_same_addr): Likewise. (strace_trace_on_diff_addr): Likewise. * gdb.trace/unavailable.exp (gdb_collect_args_test): Likewise. (gdb_collect_locals_test): Likewise. (gdb_unavailable_registers_test): Likewise. (gdb_collect_globals_test): Likewise.
Diffstat (limited to 'gdb/testsuite/gdb.mi')
-rw-r--r--gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp176
-rw-r--r--gdb/testsuite/gdb.mi/mi-cmd-param-changed.exp128
-rw-r--r--gdb/testsuite/gdb.mi/mi-watch.exp32
-rw-r--r--gdb/testsuite/gdb.mi/pr11022.exp50
4 files changed, 197 insertions, 189 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp b/gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp
index fd32698..04a5636 100644
--- a/gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp
+++ b/gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp
@@ -138,98 +138,100 @@ test_insert_delete_modify
# Test 'breakpoint-modified' notification is emited when pending breakpoints are
# resolved.
-proc test_pending_resolved { } { with_test_prefix "pending resolved" {
- global decimal hex
- global srcdir
- global subdir
- global binfile
- global lib_sl1 lib_sl2
- global mi_gdb_prompt
-
- gdb_exit
- if [mi_gdb_start] {
- continue
- }
- mi_gdb_reinitialize_dir $srcdir/$subdir
- mi_gdb_load ${binfile}
- mi_load_shlibs $lib_sl1 $lib_sl2
-
- # Create a pending breakpoint on pendfunc1
- mi_gdb_test "-break-insert -f pendfunc1" \
- {.*\^done,bkpt=.*addr=\"<PENDING>\".*} \
- "insert breakpoint on pendfunc1"
- mi_run_cmd
-
- set test "breakpoint on pendfunc1 resolved"
- gdb_expect {
- -re ".*=breakpoint-modified,bkpt=\{number=\"1\".*addr=\"${hex}\".*,times=\"0\"" {
- pass $test
- exp_continue
+proc test_pending_resolved { } {
+ with_test_prefix "pending resolved" {
+ global decimal hex
+ global srcdir
+ global subdir
+ global binfile
+ global lib_sl1 lib_sl2
+ global mi_gdb_prompt
+
+ gdb_exit
+ if [mi_gdb_start] {
+ continue
}
- -re ".*=breakpoint-modified,bkpt=\{number=\"1\".*addr=\"${hex}\".*,times=\"1\"" {
- pass "$test: hit_count is updated"
+ mi_gdb_reinitialize_dir $srcdir/$subdir
+ mi_gdb_load ${binfile}
+ mi_load_shlibs $lib_sl1 $lib_sl2
+
+ # Create a pending breakpoint on pendfunc1
+ mi_gdb_test "-break-insert -f pendfunc1" \
+ {.*\^done,bkpt=.*addr=\"<PENDING>\".*} \
+ "insert breakpoint on pendfunc1"
+ mi_run_cmd
+
+ set test "breakpoint on pendfunc1 resolved"
+ gdb_expect {
+ -re ".*=breakpoint-modified,bkpt=\{number=\"1\".*addr=\"${hex}\".*,times=\"0\"" {
+ pass $test
+ exp_continue
+ }
+ -re ".*=breakpoint-modified,bkpt=\{number=\"1\".*addr=\"${hex}\".*,times=\"1\"" {
+ pass "$test: hit_count is updated"
+ }
+ -re ".*${mi_gdb_prompt}$" {
+ fail $test
+ }
+ timeout {
+ fail "$test (timeout)"
+ }
}
- -re ".*${mi_gdb_prompt}$" {
- fail $test
- }
- timeout {
- fail "$test (timeout)"
+ mi_expect_stop "breakpoint-hit" "pendfunc1" ""\
+ ".*" ".*" {"" "disp=\"keep\""} \
+ "continue to pendfunc1 breakpoint"
+
+ # Delete breakpoint on pendfunc1
+ mi_gdb_test "-break-delete 1" {\^done} \
+ "delete breakpoint on pendfunc1"
+ # Insert breakpoint on marker
+ mi_gdb_test "-break-insert marker" {.*\^done,bkpt=.*} \
+ "insert breakpoint on marker"
+ # Create a pending breakpoint on pendfunc3
+ mi_gdb_test "-break-insert -f pendfunc3" \
+ {.*\^done,bkpt=.*addr=\"<PENDING>\".*} \
+ "insert breakpoint on pendfunc3"
+
+ mi_execute_to "exec-continue" "breakpoint-hit" "marker" ".*" ".*" ".*" \
+ {"" "disp=\"keep\""} "continue to marker 1"
+
+ mi_send_resuming_command "exec-continue" "continuing execution to marker"
+
+ set test "breakpoint on pendfunc3 resolved"
+ gdb_expect {
+ -re ".*=breakpoint-modified,bkpt=\{number=\"2\".*addr=\"${hex}\",.*func=\"marker\",.*times=\"1\"" {
+ pass "$test: hit_count is updated"
+ exp_continue
+ }
+ -re ".*=breakpoint-modified,bkpt=\{number=\"3\".*addr=\"${hex}\",.*func=\"pendfunc3\",.*times=\"0\"" {
+ pass $test
+ }
+ -re ".*${mi_gdb_prompt}$" {
+ fail $test
+ }
+ timeout {
+ fail "$test (timeout)"
+ }
}
- }
- mi_expect_stop "breakpoint-hit" "pendfunc1" ""\
- ".*" ".*" {"" "disp=\"keep\""} \
- "continue to pendfunc1 breakpoint"
-
- # Delete breakpoint on pendfunc1
- mi_gdb_test "-break-delete 1" {\^done} \
- "delete breakpoint on pendfunc1"
- # Insert breakpoint on marker
- mi_gdb_test "-break-insert marker" {.*\^done,bkpt=.*} \
- "insert breakpoint on marker"
- # Create a pending breakpoint on pendfunc3
- mi_gdb_test "-break-insert -f pendfunc3" \
- {.*\^done,bkpt=.*addr=\"<PENDING>\".*} \
- "insert breakpoint on pendfunc3"
-
- mi_execute_to "exec-continue" "breakpoint-hit" "marker" ".*" ".*" ".*" \
- {"" "disp=\"keep\""} "continue to marker 1"
-
- mi_send_resuming_command "exec-continue" "continuing execution to marker"
-
- set test "breakpoint on pendfunc3 resolved"
- gdb_expect {
- -re ".*=breakpoint-modified,bkpt=\{number=\"2\".*addr=\"${hex}\",.*func=\"marker\",.*times=\"1\"" {
- pass "$test: hit_count is updated"
- exp_continue
- }
- -re ".*=breakpoint-modified,bkpt=\{number=\"3\".*addr=\"${hex}\",.*func=\"pendfunc3\",.*times=\"0\"" {
- pass $test
+ mi_expect_stop "breakpoint-hit" "marker" ".*" ".*" ".*" \
+ {"" "disp=\"keep\""} "continue to marker 2"
+
+ mi_send_resuming_command "exec-continue" "continuing to exit"
+ set test "breakpoint on pendfunc3 pending again"
+ gdb_expect {
+ -re ".*=breakpoint-modified,bkpt=\{number=\"3\".*addr=\"<PENDING>\"" {
+ pass $test
+ }
+ -re ".*${mi_gdb_prompt}$" {
+ fail $test
+ }
+ timeout {
+ fail "$test (timeout)"
+ }
}
- -re ".*${mi_gdb_prompt}$" {
- fail $test
- }
- timeout {
- fail "$test (timeout)"
- }
- }
- mi_expect_stop "breakpoint-hit" "marker" ".*" ".*" ".*" \
- {"" "disp=\"keep\""} "continue to marker 2"
- mi_send_resuming_command "exec-continue" "continuing to exit"
- set test "breakpoint on pendfunc3 pending again"
- gdb_expect {
- -re ".*=breakpoint-modified,bkpt=\{number=\"3\".*addr=\"<PENDING>\"" {
- pass $test
- }
- -re ".*${mi_gdb_prompt}$" {
- fail $test
- }
- timeout {
- fail "$test (timeout)"
- }
+ mi_expect_stop "exited-normally" "" "" "" "" "" ""
}
-
- mi_expect_stop "exited-normally" "" "" "" "" "" ""
-}}
+}
test_pending_resolved
diff --git a/gdb/testsuite/gdb.mi/mi-cmd-param-changed.exp b/gdb/testsuite/gdb.mi/mi-cmd-param-changed.exp
index 69a3d6e..7fc025f 100644
--- a/gdb/testsuite/gdb.mi/mi-cmd-param-changed.exp
+++ b/gdb/testsuite/gdb.mi/mi-cmd-param-changed.exp
@@ -23,78 +23,80 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
return -1
}
-proc test_command_param_changed { } { with_test_prefix "cmd param" {
- if [mi_gdb_start] {
- return
- }
- mi_run_to_main
-
- foreach opt { "on" "off" "step" } {
- mi_gdb_test "set scheduler-locking ${opt}" \
- ".*=cmd-param-changed,param=\"scheduler-locking\",value=\"${opt}\".*\\^done" \
- "\"set scheduler-locking ${opt}\""
- }
- foreach opt { "on" "off" "step" } {
- mi_gdb_test "interpreter-exec console \"set scheduler-locking ${opt}\"" \
- ".*=cmd-param-changed,param=\"scheduler-locking\",value=\"${opt}\".*\\^done" \
- "interpreter-exec \"set scheduler-locking ${opt}\""
- }
- # Don't emit MI notification for request from MI.
- mi_gdb_test "-gdb-set scheduler-locking on" \
- {\^done} \
- "\"set scheduler-locking on\" no event (requested by MI)"
-
- mi_gdb_test "interpreter-exec mi \"-gdb-set scheduler-locking step\"" \
- "\\&\"interpreter-exec mi .*\"-gdb-set scheduler-locking step.*\"\\\\n\"\r\n\\^done\r\n\\^done" \
- "\"set scheduler-locking step\" no event (requested by MI interp)"
- mi_gdb_test "set scheduler-locking step" \
- "\\&\"set scheduler-locking step\\\\n\"\r\n\\^done" \
- "\"set scheduler-locking stepr\" no event"
+proc test_command_param_changed { } {
+ with_test_prefix "cmd param" {
+ if [mi_gdb_start] {
+ return
+ }
+ mi_run_to_main
+ foreach opt { "on" "off" "step" } {
+ mi_gdb_test "set scheduler-locking ${opt}" \
+ ".*=cmd-param-changed,param=\"scheduler-locking\",value=\"${opt}\".*\\^done" \
+ "\"set scheduler-locking ${opt}\""
+ }
+ foreach opt { "on" "off" "step" } {
+ mi_gdb_test "interpreter-exec console \"set scheduler-locking ${opt}\"" \
+ ".*=cmd-param-changed,param=\"scheduler-locking\",value=\"${opt}\".*\\^done" \
+ "interpreter-exec \"set scheduler-locking ${opt}\""
+ }
+ # Don't emit MI notification for request from MI.
+ mi_gdb_test "-gdb-set scheduler-locking on" \
+ {\^done} \
+ "\"set scheduler-locking on\" no event (requested by MI)"
+
+ mi_gdb_test "interpreter-exec mi \"-gdb-set scheduler-locking step\"" \
+ "\\&\"interpreter-exec mi .*\"-gdb-set scheduler-locking step.*\"\\\\n\"\r\n\\^done\r\n\\^done" \
+ "\"set scheduler-locking step\" no event (requested by MI interp)"
+ mi_gdb_test "set scheduler-locking step" \
+ "\\&\"set scheduler-locking step\\\\n\"\r\n\\^done" \
+ "\"set scheduler-locking stepr\" no event"
+
+
+ foreach command { "remotecache" "check type" } {
+
+ # The default value of each command option may be different, so we first
+ # set it to 'off', and this may or may not trigger MI notification.
+ mi_gdb_test "set ${command} off" ".*\\^done" "\"set ${command}\" warmup"
+
+ foreach boolean_opt { "on" "off" } {
+ mi_gdb_test "set ${command} ${boolean_opt}" \
+ ".*=cmd-param-changed,param=\"${command}\",value=\"${boolean_opt}\".*\\^done" \
+ "\"set ${command} ${boolean_opt}\""
+ }
+ mi_gdb_test "set ${command} off" \
+ "\\&\"set ${command} off\\\\n\"\r\n\\^done" \
+ "\"set ${command}\" no event"
+ }
- foreach command { "remotecache" "check type" } {
- # The default value of each command option may be different, so we first
- # set it to 'off', and this may or may not trigger MI notification.
- mi_gdb_test "set ${command} off" ".*\\^done" "\"set ${command}\" warmup"
+ foreach command { "trace-notes" "remote exec-file" } {
+ foreach str_opt { "foo" "bar" } {
+ mi_gdb_test "set ${command} ${str_opt}" \
+ ".*=cmd-param-changed,param=\"${command}\",value=\"${str_opt}\".*\\^done" \
+ "\"set ${command} ${str_opt}\""
+ }
+ mi_gdb_test "set ${command} bar" \
+ "\\&\"set ${command} bar\\\\n\"\r\n(\\&\"warning.*|)\\^done" \
+ "\"set ${command} bar\" no event"
+ }
+ # No notification is emitted for 'maint set' commands.
foreach boolean_opt { "on" "off" } {
- mi_gdb_test "set ${command} ${boolean_opt}" \
- ".*=cmd-param-changed,param=\"${command}\",value=\"${boolean_opt}\".*\\^done" \
- "\"set ${command} ${boolean_opt}\""
+ mi_gdb_test "maint set profile ${boolean_opt}" \
+ "\\&\"maint set profile ${boolean_opt}\\\\n\"\r\n\\^done" \
+ "\"maint set profile ${boolean_opt}\""
}
- mi_gdb_test "set ${command} off" \
- "\\&\"set ${command} off\\\\n\"\r\n\\^done" \
- "\"set ${command}\" no event"
- }
+ # Full command parameters are included in the notification when a
+ # abbreviated one is typed.
+ mi_gdb_test "set ch type on" \
+ ".*=cmd-param-changed,param=\"check type\",value=\"on\".*\\^done" \
+ "\"set ch type on\""
- foreach command { "trace-notes" "remote exec-file" } {
- foreach str_opt { "foo" "bar" } {
- mi_gdb_test "set ${command} ${str_opt}" \
- ".*=cmd-param-changed,param=\"${command}\",value=\"${str_opt}\".*\\^done" \
- "\"set ${command} ${str_opt}\""
- }
- mi_gdb_test "set ${command} bar" \
- "\\&\"set ${command} bar\\\\n\"\r\n(\\&\"warning.*|)\\^done" \
- "\"set ${command} bar\" no event"
- }
-
- # No notification is emitted for 'maint set' commands.
- foreach boolean_opt { "on" "off" } {
- mi_gdb_test "maint set profile ${boolean_opt}" \
- "\\&\"maint set profile ${boolean_opt}\\\\n\"\r\n\\^done" \
- "\"maint set profile ${boolean_opt}\""
+ mi_gdb_exit
}
-
- # Full command parameters are included in the notification when a
- # abbreviated one is typed.
- mi_gdb_test "set ch type on" \
- ".*=cmd-param-changed,param=\"check type\",value=\"on\".*\\^done" \
- "\"set ch type on\""
-
- mi_gdb_exit
-}}
+}
test_command_param_changed
diff --git a/gdb/testsuite/gdb.mi/mi-watch.exp b/gdb/testsuite/gdb.mi/mi-watch.exp
index 858a8c1..199c43c 100644
--- a/gdb/testsuite/gdb.mi/mi-watch.exp
+++ b/gdb/testsuite/gdb.mi/mi-watch.exp
@@ -141,21 +141,23 @@ proc test_watchpoint_triggering {type} {
clear_xfail *-*-*
}
-proc test_watchpoint_all {type} { with_test_prefix "$type" {
- upvar srcdir srcdir
- upvar subdir subdir
- upvar binfile binfile
-
- mi_delete_breakpoints
- mi_gdb_reinitialize_dir $srcdir/$subdir
- mi_gdb_load ${binfile}
-
- mi_runto callee4
- test_watchpoint_creation_and_listing $type
- #test_rwatch_creation_and_listing $type
- #test_awatch_creation_and_listing $type
- test_watchpoint_triggering $type
-}}
+proc test_watchpoint_all {type} {
+ with_test_prefix "$type" {
+ upvar srcdir srcdir
+ upvar subdir subdir
+ upvar binfile binfile
+
+ mi_delete_breakpoints
+ mi_gdb_reinitialize_dir $srcdir/$subdir
+ mi_gdb_load ${binfile}
+
+ mi_runto callee4
+ test_watchpoint_creation_and_listing $type
+ #test_rwatch_creation_and_listing $type
+ #test_awatch_creation_and_listing $type
+ test_watchpoint_triggering $type
+ }
+}
# Run the tests twice, once using software watchpoints...
mi_gdb_test "567-gdb-set can-use-hw-watchpoints 0" \
diff --git a/gdb/testsuite/gdb.mi/pr11022.exp b/gdb/testsuite/gdb.mi/pr11022.exp
index 0390980..8e1a0d0 100644
--- a/gdb/testsuite/gdb.mi/pr11022.exp
+++ b/gdb/testsuite/gdb.mi/pr11022.exp
@@ -27,39 +27,41 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
return
}
-proc test_memory_changed_observer { mi_command } { with_test_prefix "${mi_command}" {
- global srcfile
+proc test_memory_changed_observer { mi_command } {
+ with_test_prefix "${mi_command}" {
+ global srcfile
- if [mi_gdb_start] {
- return
- }
- mi_run_to_main
+ if [mi_gdb_start] {
+ return
+ }
+ mi_run_to_main
- set line_number [gdb_get_line_number "break here"]
- mi_gdb_test "-break-insert ${srcfile}:${line_number}" \
- {\^done,bkpt=.number="2",type="breakpoint".*\}} \
- "set breakpoint"
+ set line_number [gdb_get_line_number "break here"]
+ mi_gdb_test "-break-insert ${srcfile}:${line_number}" \
+ {\^done,bkpt=.number="2",type="breakpoint".*\}} \
+ "set breakpoint"
- mi_gdb_test "watch x" ".*" "set watchpoint"
+ mi_gdb_test "watch x" ".*" "set watchpoint"
- mi_execute_to "exec-continue" "breakpoint-hit" "main" "" ".*" ".*" \
- { "" "disp=\"keep\"" } "breakpoint hit"
+ mi_execute_to "exec-continue" "breakpoint-hit" "main" "" ".*" ".*" \
+ { "" "disp=\"keep\"" } "breakpoint hit"
- mi_execute_to "exec-continue" "watchpoint-trigger" "main" "" ".*" ".*" \
- { "" "wpt=\{number=\"3\",exp=\"x\"\},value=\{old=\"0\",new=\"42\"\}" } \
- "watchpoint hit"
+ mi_execute_to "exec-continue" "watchpoint-trigger" "main" "" ".*" ".*" \
+ { "" "wpt=\{number=\"3\",exp=\"x\"\},value=\{old=\"0\",new=\"42\"\}" } \
+ "watchpoint hit"
- mi_execute_to "exec-continue" "breakpoint-hit" "main" "" ".*" ".*" \
- { "" "disp=\"keep\"" } "breakpoint hit 2"
+ mi_execute_to "exec-continue" "breakpoint-hit" "main" "" ".*" ".*" \
+ { "" "disp=\"keep\"" } "breakpoint hit 2"
- mi_gdb_test "-${mi_command}" {\^done} "set x"
+ mi_gdb_test "-${mi_command}" {\^done} "set x"
- mi_execute_to "exec-continue" "watchpoint-trigger" "main" "" ".*" ".*" \
- { "" "wpt=\{number=\"3\",exp=\"x\"\},value=\{old=\"1\",new=\"42\"\}" } \
- "watchpoint hit 2"
+ mi_execute_to "exec-continue" "watchpoint-trigger" "main" "" ".*" ".*" \
+ { "" "wpt=\{number=\"3\",exp=\"x\"\},value=\{old=\"1\",new=\"42\"\}" } \
+ "watchpoint hit 2"
- mi_gdb_exit
-}}
+ mi_gdb_exit
+ }
+}
test_memory_changed_observer "data-write-memory-bytes &x \"01\""
# We want to trigger a target memory write here, so the word size (4 or 8)