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.
This commit is contained in:
Yao Qi 2013-03-15 01:41:29 +00:00
parent 2c415c0f38
commit 0a251e08fa
28 changed files with 2464 additions and 2300 deletions

View file

@ -1,3 +1,56 @@
2013-03-15 Yao Qi <yao@codesourcery.com>
* 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.
2013-03-15 Yao Qi <yao@codesourcery.com>
* gdb.base/condbreak.exp: Add semicolon back which was removed

View file

@ -190,7 +190,8 @@ proc reach {func command displacement} {
}
}
proc test_core {file displacement} { with_test_prefix "core" {
proc test_core {file displacement} {
with_test_prefix "core" {
global srcdir subdir gdb_prompt expect_out
set corefile [core_find $file {} "segv"]
@ -237,9 +238,11 @@ proc test_core {file displacement} { with_test_prefix "core" {
}
gdb_test "bt" "#\[0-9\]+ +\[^\r\n\]*\\mlibfunc\\M\[^\r\n\]*\r\n#\[0-9\]+ +\[^\r\n\]*\\mmain\\M.*" "core main bt"
}}
}
}
proc test_attach_gdb {file pid displacement prefix} { with_test_prefix "$prefix" {
proc test_attach_gdb {file pid displacement prefix} {
with_test_prefix "$prefix" {
global gdb_prompt expect_out
gdb_exit
@ -286,7 +289,8 @@ proc test_attach_gdb {file pid displacement prefix} { with_test_prefix "$prefix"
gdb_test "bt" "#\[0-9\]+ +\[^\r\n\]*\\mlibfunc\\M\[^\r\n\]*\r\n#\[0-9\]+ +\[^\r\n\]*\\mmain\\M.*" "attach main bt"
gdb_exit
}}
}
}
proc test_attach {file displacement {relink_args ""}} {
global board_info

View file

@ -46,7 +46,8 @@ if { [gdb_compile_shlib "${srcdir}/${subdir}/${srcfile2}" ${binfile2} {debug}] !
# names.
# KIND is passed to the "catch" command.
# MATCH is a boolean saying whether we expect the catchpoint to be hit.
proc one_catch_load_test {scenario kind match sostop} { with_test_prefix "${scenario}" {
proc one_catch_load_test {scenario kind match sostop} {
with_test_prefix "${scenario}" {
global verbose testfile testfile2 binfile2 binfile2_dlopen
global srcfile
global decimal gdb_prompt
@ -93,7 +94,8 @@ proc one_catch_load_test {scenario kind match sostop} { with_test_prefix "${scen
fail "continue"
}
}
}}
}
}
one_catch_load_test "plain load" "load" 1 0
one_catch_load_test "plain load with stop-on-solib-events" "load" 1 1

View file

@ -30,7 +30,8 @@ if { [istarget "i\[34567\]86-*-linux*"] || [istarget "x86_64-*-linux*"] } {
return -1
}
proc disp_step_cross_syscall { syscall } { with_test_prefix "$syscall" {
proc disp_step_cross_syscall { syscall } {
with_test_prefix "$syscall" {
global syscall_insn
global gdb_prompt
@ -151,7 +152,8 @@ proc disp_step_cross_syscall { syscall } { with_test_prefix "$syscall" {
gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, marker \\(\\) at.*" \
"continue to marker ($syscall)"
}}
}
}
disp_step_cross_syscall "fork"
disp_step_cross_syscall "vfork"

View file

@ -63,7 +63,8 @@ if { [gdb_compile_shlib ${solib_srcfile} ${solib_binfile} {}] != "" } {
set solib_binfile_target [gdb_download ${solib_binfile}]
proc one_jit_test {count match_str} { with_test_prefix "one_jit_test-$count" {
proc one_jit_test {count match_str} {
with_test_prefix "one_jit_test-$count" {
global verbose testfile srcfile2 binfile2 binfile2_dlopen solib_binfile_target solib_binfile_test_msg
clean_restart $testfile
@ -111,7 +112,8 @@ proc one_jit_test {count match_str} { with_test_prefix "one_jit_test-$count" {
# All jit librares must have been unregistered
gdb_test "info function jit_function" \
"All functions matching regular expression \"jit_function\":"
}}
}
}
one_jit_test 1 "${hex} jit_function_0000"
one_jit_test 2 "${hex} jit_function_0000\[\r\n\]+${hex} jit_function_0001"

View file

@ -61,7 +61,8 @@ proc compile_jit_test {testname options} {
return 0
}
proc one_jit_test {count match_str} { with_test_prefix "one_jit_test-$count" {
proc one_jit_test {count match_str} {
with_test_prefix "one_jit_test-$count" {
global verbose testfile solib_binfile_target solib_binfile_test_msg
clean_restart $testfile
@ -101,7 +102,8 @@ proc one_jit_test {count match_str} { with_test_prefix "one_jit_test-$count" {
# All jit librares must have been unregistered
gdb_test "info function jit_function" \
"All functions matching regular expression \"jit_function\":"
}}
}
}
if {[compile_jit_test jit.exp {}] < 0} {
return

View file

@ -648,7 +648,8 @@ test_next_with_recursion
#********
proc test_different_dir {type test_different_dir xfail} { with_test_prefix "$type" {
proc test_different_dir {type test_different_dir xfail} {
with_test_prefix "$type" {
global srcdir subdir objdir binfile srcfile timeout gdb_prompt
global bp_location6 decimal hex
@ -742,7 +743,8 @@ proc test_different_dir {type test_different_dir xfail} { with_test_prefix "$typ
}
# proc test_different_dir
}}
}
}
# now move the .debug file to a different location so that we can test

View file

@ -335,7 +335,8 @@ if ![runto_main] {
gdb_test "cd ${srcabsdir}/rdir" "Working directory [string_to_regexp ${srcabsdir}]/rdir\\." "cd .../rdir"
proc test { func compdir filename } { with_test_prefix "$func" {
proc test { func compdir filename } {
with_test_prefix "$func" {
# Clear the GDB cache.
gdb_test_no_output "set directories" ""
@ -362,7 +363,8 @@ proc test { func compdir filename } { with_test_prefix "$func" {
gdb_test_no_output "set filename-display relative"
verbose -log "expect: $filename"
gdb_test "frame" " in $func \\(\\) at [string_to_regexp $filename]:999" "relative"
}}
}
}
set bdir "${srcabsdir}"
set file "${srctmpfile}"

View file

@ -33,7 +33,8 @@ if { [prepare_for_testing dw2-noloc.exp "dw2-noloc" {dw2-noloc-main.c dw2-noloc.
# unresolvable: .symtab entry does not exist for this symbol name.
# DW_AT_declaration is not present in any of these DIEs.
proc file_symbols {type} { with_test_prefix "$type" {
proc file_symbols {type} {
with_test_prefix "$type" {
global gdb_prompt
@ -75,7 +76,8 @@ proc file_symbols {type} { with_test_prefix "$type" {
# As DW_AT_declaration is not present in this DIE
# it should print <optimized out>. As usefulness of such DIE is not
# clear its resolution is not being tested.
}}
}
}
file_symbols no-run

View file

@ -138,7 +138,8 @@ test_insert_delete_modify
# Test 'breakpoint-modified' notification is emited when pending breakpoints are
# resolved.
proc test_pending_resolved { } { with_test_prefix "pending resolved" {
proc test_pending_resolved { } {
with_test_prefix "pending resolved" {
global decimal hex
global srcdir
global subdir
@ -230,6 +231,7 @@ proc test_pending_resolved { } { with_test_prefix "pending resolved" {
}
mi_expect_stop "exited-normally" "" "" "" "" "" ""
}}
}
}
test_pending_resolved

View file

@ -23,7 +23,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
return -1
}
proc test_command_param_changed { } { with_test_prefix "cmd param" {
proc test_command_param_changed { } {
with_test_prefix "cmd param" {
if [mi_gdb_start] {
return
}
@ -94,7 +95,8 @@ proc test_command_param_changed { } { with_test_prefix "cmd param" {
"\"set ch type on\""
mi_gdb_exit
}}
}
}
test_command_param_changed

View file

@ -141,7 +141,8 @@ proc test_watchpoint_triggering {type} {
clear_xfail *-*-*
}
proc test_watchpoint_all {type} { with_test_prefix "$type" {
proc test_watchpoint_all {type} {
with_test_prefix "$type" {
upvar srcdir srcdir
upvar subdir subdir
upvar binfile binfile
@ -155,7 +156,8 @@ proc test_watchpoint_all {type} { with_test_prefix "$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" \

View file

@ -27,7 +27,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
return
}
proc test_memory_changed_observer { mi_command } { with_test_prefix "${mi_command}" {
proc test_memory_changed_observer { mi_command } {
with_test_prefix "${mi_command}" {
global srcfile
if [mi_gdb_start] {
@ -59,7 +60,8 @@ proc test_memory_changed_observer { mi_command } { with_test_prefix "${mi_comman
"watchpoint hit 2"
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)

View file

@ -28,7 +28,8 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
return -1
}
proc do_test { lock_sched } { with_test_prefix "lock-sched$lock_sched" {
proc do_test { lock_sched } {
with_test_prefix "lock-sched$lock_sched" {
global executable
clean_restart ${executable}
@ -50,7 +51,8 @@ proc do_test { lock_sched } { with_test_prefix "lock-sched$lock_sched" {
gdb_test "continue" \
".*is executing new program.*Breakpoint 1, main.* at .*" \
"continue over exec"
}}
}
}
do_test 0
do_test 1

View file

@ -29,7 +29,8 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
return -1
}
proc do_test { lock_sched } { with_test_prefix "lock-sched$lock_sched" {
proc do_test { lock_sched } {
with_test_prefix "lock-sched$lock_sched" {
global executable
clean_restart ${executable}
@ -55,7 +56,8 @@ proc do_test { lock_sched } { with_test_prefix "lock-sched$lock_sched" {
gdb_test "continue" \
".*is executing new program.*Breakpoint 1, main.* at .*" \
"continue over exec"
}}
}
}
do_test 0
do_test 1

View file

@ -31,7 +31,8 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
return -1
}
proc do_test { lock_sched } { with_test_prefix "lock-sched$lock_sched" {
proc do_test { lock_sched } {
with_test_prefix "lock-sched$lock_sched" {
global executable
clean_restart ${executable}
@ -53,7 +54,8 @@ proc do_test { lock_sched } { with_test_prefix "lock-sched$lock_sched" {
gdb_test "continue" \
".*is executing new program.*Breakpoint 1, main.* at .*" \
"continue over exec"
}}
}
}
do_test 0
do_test 1

View file

@ -30,7 +30,8 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
return -1
}
proc do_test { lock_sched } { with_test_prefix "lock-sched$lock_sched" {
proc do_test { lock_sched } {
with_test_prefix "lock-sched$lock_sched" {
global executable
clean_restart ${executable}
@ -52,7 +53,8 @@ proc do_test { lock_sched } { with_test_prefix "lock-sched$lock_sched" {
gdb_test "continue" \
".*is executing new program.*Breakpoint 1, main.* at .*" \
"continue over exec"
}}
}
}
do_test 0
do_test 1

View file

@ -22,7 +22,8 @@ if [is_remote target] {
return
}
proc test {type symbol} { with_test_prefix "$type" {
proc test {type symbol} {
with_test_prefix "$type" {
global testfile subdir srcdir gdb_prompt
set srcfile_type ${srcdir}/${subdir}/${testfile}-${type}.c
@ -135,7 +136,8 @@ proc test {type symbol} { with_test_prefix "$type" {
"atchpoint \[0-9\]+: var.*Old value = 6.*New value = 7.*after-fork2-B.*" "watchpoint B after the second fork"
gdb_test "continue" "Continuing\\..*\r\nBreakpoint \[0-9\]+, mark_exit .*" "finish"
}
}}
}
}
test parent FOLLOW_PARENT

View file

@ -69,7 +69,8 @@ if [is_amd64_regs_target] {
# Set tracepoint during tracing experiment.
proc tracepoint_change_loc_1 { trace_type } { with_test_prefix "1 $trace_type" {
proc tracepoint_change_loc_1 { trace_type } {
with_test_prefix "1 $trace_type" {
global testfile
global srcfile
global pcreg
@ -82,13 +83,15 @@ proc tracepoint_change_loc_1 { trace_type } { with_test_prefix "1 $trace_type" {
}
gdb_test_no_output "delete break 1"
# Set a tracepoint we'll never meet. Just to avoid the complain after
# type `tstart' later.
# Set a tracepoint we'll never meet. Just to avoid the
# complain after type `tstart' later.
gdb_test "next" ".*"
gdb_test "trace main" "Tracepoint \[0-9\] at.* file .*$srcfile, line.*" \
gdb_test "trace main" \
"Tracepoint \[0-9\] at.* file .*$srcfile, line.*" \
"set tracepoint on main"
gdb_test "break marker" "Breakpoint.*at.* file .*$srcfile, line.*" \
gdb_test "break marker" \
"Breakpoint.*at.* file .*$srcfile, line.*" \
"breakpoint on marker"
gdb_test_no_output "tstart"
@ -142,7 +145,8 @@ proc tracepoint_change_loc_1 { trace_type } { with_test_prefix "1 $trace_type" {
}
}
# tracepoint has three locations after shlib change-loc-2 is loaded.
# tracepoint has three locations after shlib change-loc-2 is
# loaded.
gdb_test "info trace" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
\[0-9\]+\[\t \]+\(|fast \)tracepoint\[ \]+keep y.*\<MULTIPLE\>.*4\.1.* in func4.*4\.2.* in func4.*4\.3.* in func4 .*" \
@ -151,7 +155,8 @@ proc tracepoint_change_loc_1 { trace_type } { with_test_prefix "1 $trace_type" {
gdb_test "continue" ".*Breakpoint.*marker.*at.*$srcfile.*" \
"continue to marker 3"
# shlib is unloaded, there are still three locations, but one is pending.
# shlib is unloaded, there are still three locations, but one
# is pending.
gdb_test "info trace" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
\[0-9\]+\[\t \]+\(|fast \)tracepoint\[ \]+keep y.*\<MULTIPLE\>.*
@ -160,13 +165,17 @@ proc tracepoint_change_loc_1 { trace_type } { with_test_prefix "1 $trace_type" {
gdb_test_no_output "tstop"
gdb_test "tfind" "Found trace frame 0, tracepoint 4.*" "tfind frame 0"
gdb_test "tfind" "Target failed to find requested trace frame\\..*"
}}
gdb_test "tfind" "Found trace frame 0, tracepoint 4.*" \
"tfind frame 0"
gdb_test "tfind" \
"Target failed to find requested trace frame\\..*"
}
}
# Set pending tracepoint.
proc tracepoint_change_loc_2 { trace_type } { with_test_prefix "2 $trace_type" {
proc tracepoint_change_loc_2 { trace_type } {
with_test_prefix "2 $trace_type" {
global srcdir
global srcfile
global subdir
@ -270,7 +279,8 @@ proc tracepoint_change_loc_2 { trace_type } { with_test_prefix "2 $trace_type" {
gdb_test "tfind" "Found trace frame 1, tracepoint 1.*" "tfind frame 1"
gdb_test "tfind" "Found trace frame 2, tracepoint 1.*" "tfind frame 2"
gdb_test "tfind" "Target failed to find requested trace frame\\..*"
}}
}
}
tracepoint_change_loc_1 "trace"
tracepoint_change_loc_2 "trace"

View file

@ -45,7 +45,8 @@ if ![gdb_target_supports_trace] {
# Disconnect in tracing.
proc disconnected_tracing { } { with_test_prefix "trace" {
proc disconnected_tracing { } {
with_test_prefix "trace" {
global executable
global decimal
global srcfile
@ -101,13 +102,15 @@ proc disconnected_tracing { } { with_test_prefix "trace" {
\[\t \]+trace buffer usage ${decimal} bytes.
\[\t \]+collect foo.*" \
"fourth info tracepoints"
}}
}
}
disconnected_tracing
# Disconnected in tfind
proc disconnected_tfind { } { with_test_prefix "tfind" {
proc disconnected_tfind { } {
with_test_prefix "tfind" {
global executable
global decimal
@ -140,6 +143,7 @@ proc disconnected_tfind { } { with_test_prefix "tfind" {
gdb_test "p \$trace_line" ".*\\\$${decimal} = -1.*"
gdb_test "p \$trace_file" ".*\\\$${decimal} = void.*"
gdb_test "p \$trace_func" ".*\\\$${decimal} = void.*"
}}
}
}
disconnected_tfind

View file

@ -34,7 +34,8 @@ remote_exec target "$binfile"
# Copy tracefile from target to host.
remote_download host [remote_upload target basic.tf] basic.tf
proc test_tfind_tfile { } { with_test_prefix "tfile" {
proc test_tfind_tfile { } {
with_test_prefix "tfile" {
global binfile
global decimal
@ -66,7 +67,8 @@ proc test_tfind_tfile { } { with_test_prefix "tfile" {
"-trace-find frame-number 0"
mi_gdb_exit
}}
}
}
test_tfind_tfile
@ -99,7 +101,8 @@ if ![gdb_target_supports_trace] {
gdb_exit
proc test_tfind_remote { } { with_test_prefix "remote" {
proc test_tfind_remote { } {
with_test_prefix "remote" {
global decimal
if [mi_gdb_start] {
@ -130,7 +133,8 @@ proc test_tfind_remote { } { with_test_prefix "remote" {
"tfind end"
mi_gdb_exit
}}
}
}
test_tfind_remote

View file

@ -49,7 +49,8 @@ set MIFLAGS "-i=mi"
# remote stub can be uploaded to GDB, and GDB emits MI notification if
# new tracepoints are created.
proc test_reconnect { } { with_test_prefix "reconnect" {
proc test_reconnect { } {
with_test_prefix "reconnect" {
global gdbserver_reconnect_p
global gdb_prompt
@ -153,13 +154,14 @@ proc test_reconnect { } { with_test_prefix "reconnect" {
"break-info 1"
set gdbserver_reconnect_p 0
}}
}
}
# Test 'breakpoint-modified' notification is emited when pending tracepoints are
# resolved.
proc test_pending_resolved { } { with_test_prefix "pending resolved" {
proc test_pending_resolved { } {
with_test_prefix "pending resolved" {
global decimal hex
global executable
global srcdir
@ -234,7 +236,8 @@ proc test_pending_resolved { } { with_test_prefix "pending resolved" {
}
mi_expect_stop "exited-normally" "" "" "" "" "" ""
}}
}
}
# Test target supports tracepoints or not.

View file

@ -25,7 +25,8 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
# Test notifications on creating, deleting and modifying TSV.
proc test_create_delete_modify_tsv { } {with_test_prefix "create delete modify" {
proc test_create_delete_modify_tsv { } {
with_test_prefix "create delete modify" {
global binfile
global decimal
global testfile
@ -123,14 +124,16 @@ proc test_create_delete_modify_tsv { } {with_test_prefix "create delete modify"
".*=tsv-modified,name=\"tvar3\",initial=\"2\",current=\"6\".*\\^done" \
"tvariable \$tvar3 modified"
}}
}
}
# Test when GDB connects to a disconnected stub, existing TSVs in
# remote stub can be uploaded to GDB, and GDB emits MI notification
# for new uploaded TSVs.
proc test_upload_tsv { } { with_test_prefix "upload" {
proc test_upload_tsv { } {
with_test_prefix "upload" {
global gdbserver_reconnect_p
global gdb_prompt
@ -220,7 +223,8 @@ proc test_upload_tsv { } { with_test_prefix "upload" {
}
set gdbserver_reconnect_p 0
}}
}
}
test_create_delete_modify_tsv

View file

@ -58,7 +58,8 @@ if ![gdb_target_supports_trace] {
# Verify pending tracepoint is resolved to running to main.
proc pending_tracepoint_resolved { trace_type } { with_test_prefix "$trace_type resolved" {
proc pending_tracepoint_resolved { trace_type } {
with_test_prefix "$trace_type resolved" {
global srcdir
global subdir
global binfile
@ -95,11 +96,13 @@ proc pending_tracepoint_resolved { trace_type } { with_test_prefix "$trace_type
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
\[0-9\]+\[\t \]+\(fast |\)tracepoint\[ \]+keep y.*pendfunc.*" \
"single tracepoint info"
}}
}
}
# Verify pending tracepoint is resolved and works as expected.
proc pending_tracepoint_works { trace_type } { with_test_prefix "$trace_type works" {
proc pending_tracepoint_works { trace_type } {
with_test_prefix "$trace_type works" {
global executable
global srcfile
global lib_sl1
@ -112,7 +115,9 @@ proc pending_tracepoint_works { trace_type } { with_test_prefix "$trace_type wor
gdb_test_multiple "$trace_type set_point1" "set pending tracepoint" {
-re ".*Make \(fast |\)tracepoint pending.*y or \\\[n\\\]. $" {
gdb_test "y" "\(Fast t|T\)racepoint.*set_point1.*pending." "set pending tracepoint"
gdb_test "y" \
"\(Fast t|T\)racepoint.*set_point1.*pending." \
"set pending tracepoint"
}
}
@ -155,10 +160,15 @@ proc pending_tracepoint_works { trace_type } { with_test_prefix "$trace_type wor
gdb_test "tstop" "\[\r\n\]+" "stop trace experiment"
gdb_test "tfind start" "#0 .*" "tfind test frame 0"
gdb_test "tfind" "Found trace frame 1, tracepoint 1.*" "tfind test frame 1"
gdb_test "tfind" "Found trace frame 2, tracepoint 1.*" "tfind test frame 2"
gdb_test "tfind" "Target failed to find requested trace frame..*" "tfind test frame"
}}
gdb_test "tfind" "Found trace frame 1, tracepoint 1.*" \
"tfind test frame 1"
gdb_test "tfind" "Found trace frame 2, tracepoint 1.*" \
"tfind test frame 2"
gdb_test "tfind" \
"Target failed to find requested trace frame..*" \
"tfind test frame"
}
}
# Verify pending tracepoint is resolved during trace.

View file

@ -192,7 +192,8 @@ gdb_test "help tdump" "Print everything collected at the current.*" \
# Check the collected trace data from different sources, such as live
# inferior and tfile.
proc use_collected_data { data_source } { with_test_prefix "${data_source}" {
proc use_collected_data { data_source } {
with_test_prefix "${data_source}" {
global tdp1 tdp2 tdp3 tdp4 tdp5 tdp6
global testline1 testline2 testline3 testline4 testline5 testline6
global pcreg fpreg spreg

View file

@ -37,7 +37,8 @@ if ![gdb_target_supports_trace] {
# Verify that the sequence of commands "tstart tstop tstart" works well.
proc test_tstart_tstop_tstart { } { with_test_prefix "tstart_tstop_tstart" {
proc test_tstart_tstop_tstart { } {
with_test_prefix "tstart_tstop_tstart" {
global executable
global hex
@ -52,16 +53,19 @@ proc test_tstart_tstop_tstart { } { with_test_prefix "tstart_tstop_tstart" {
gdb_test_no_output "tstart"
gdb_test "break end" "Breakpoint \[0-9\] at $hex: file.*"
gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" "continue to end"
gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" \
"continue to end"
gdb_test_no_output "tstop"
gdb_test_no_output "tstart"
}}
}
}
# Verify the sequence of commands "tstart tstart" works well.
proc test_tstart_tstart { } { with_test_prefix "tstart_tstart" {
proc test_tstart_tstart { } {
with_test_prefix "tstart_tstart" {
global executable
global hex
@ -75,12 +79,16 @@ proc test_tstart_tstart { } { with_test_prefix "tstart_tstart" {
gdb_test "trace func1" "Tracepoint \[0-9\] at $hex: file.*"
gdb_test_no_output "tstart"
gdb_test "tstart" "" "tstart again" "A trace is running already. Start a new run\\? \\(y or n\\) " "y"
}}
gdb_test "tstart" "" "tstart again" \
"A trace is running already. Start a new run\\? \\(y or n\\) " \
"y"
}
}
# Verify that trace stops clearly when trace buffer is full.
proc test_buffer_full_tstart { } { with_test_prefix "buffer_full_tstart" {
proc test_buffer_full_tstart { } {
with_test_prefix "buffer_full_tstart" {
global executable
global hex
@ -102,7 +110,8 @@ proc test_buffer_full_tstart { } { with_test_prefix "buffer_full_tstart" {
gdb_test "tstatus" ".*buffer was full.*"
gdb_test_no_output "tstart"
}}
}
}
test_tstart_tstop_tstart

View file

@ -126,7 +126,8 @@ proc strace_remove_socket { action } {
}
}}
proc strace_info_marker { } { with_test_prefix "info_marker" {
proc strace_info_marker { } {
with_test_prefix "info_marker" {
global executable
global gdb_prompt
global libipa
@ -157,9 +158,11 @@ proc strace_info_marker { } { with_test_prefix "info_marker" {
pass "detach"
}
}
}}
}
}
proc strace_probe_marker { } { with_test_prefix "probe_marker" {
proc strace_probe_marker { } {
with_test_prefix "probe_marker" {
global executable
global expect_out
global gdb_prompt
@ -174,8 +177,10 @@ proc strace_probe_marker { } { with_test_prefix "probe_marker" {
return -1
}
gdb_test "strace -m ust/bar" "Static tracepoint \[0-9\]+ at ${hex}: file.*"
gdb_test "strace -m ust/bar2" "Static tracepoint \[0-9\]+ at ${hex}: file.*"
gdb_test "strace -m ust/bar" \
"Static tracepoint \[0-9\]+ at ${hex}: file.*"
gdb_test "strace -m ust/bar2" \
"Static tracepoint \[0-9\]+ at ${hex}: file.*"
# Two trace markers should be enabled.
gdb_test "info static-tracepoint-markers" \
"ust/bar\[\t \]+y\[\t \]+$hex .*ust/bar2\[\t \]+y\[\t \]+$hex.*"
@ -183,13 +188,18 @@ proc strace_probe_marker { } { with_test_prefix "probe_marker" {
gdb_test "break end" "Breakpoint \[0-9\]+ at.*"
gdb_test_no_output "tstart"
gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" "continue to end"
gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" \
"continue to end"
gdb_test_no_output "tstop"
gdb_test "tfind" "Found trace frame 0, tracepoint .*" "tfind frame 0"
gdb_test "tfind" "Found trace frame 1, tracepoint .*" "tfind frame 1"
gdb_test "tfind" "Target failed to find requested trace frame\\..*"
}}
gdb_test "tfind" "Found trace frame 0, tracepoint .*" \
"tfind frame 0"
gdb_test "tfind" "Found trace frame 1, tracepoint .*" \
"tfind frame 1"
gdb_test "tfind" \
"Target failed to find requested trace frame\\..*"
}
}
proc strace_trace_on_same_addr { type } {
with_test_prefix "trace_same_addr $type" {
@ -280,15 +290,22 @@ with_test_prefix "trace_same_addr $type" {
"continue to end"
gdb_test_no_output "tstop"
gdb_test "tfind" "Found trace frame 0, tracepoint .*" "tfind frame 0"
gdb_test "tfind" "Found trace frame 1, tracepoint .*" "tfind frame 1"
gdb_test "tfind" "Found trace frame 2, tracepoint .*" "tfind frame 2"
gdb_test "tfind" "Found trace frame 3, tracepoint .*" "tfind frame 3"
gdb_test "tfind" "Target failed to find requested trace frame\\..*"
gdb_test "tfind" "Found trace frame 0, tracepoint .*" \
"tfind frame 0"
gdb_test "tfind" "Found trace frame 1, tracepoint .*" \
"tfind frame 1"
gdb_test "tfind" "Found trace frame 2, tracepoint .*" \
"tfind frame 2"
gdb_test "tfind" "Found trace frame 3, tracepoint .*" \
"tfind frame 3"
gdb_test "tfind" \
"Target failed to find requested trace frame\\..*"
}
}
}
}}
proc strace_trace_on_diff_addr { } { with_test_prefix "trace_diff_addr" {
proc strace_trace_on_diff_addr { } {
with_test_prefix "trace_diff_addr" {
global executable
global expect_out
@ -336,13 +353,18 @@ proc strace_trace_on_diff_addr { } { with_test_prefix "trace_diff_addr" {
gdb_test "break end" "Breakpoint \[0-9\]+ at.*"
gdb_test_no_output "tstart"
gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" "continue to end"
gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" \
"continue to end"
gdb_test_no_output "tstop"
gdb_test "tfind" "Found trace frame 0, tracepoint .*" "tfind frame 0"
gdb_test "tfind" "Found trace frame 1, tracepoint .*" "tfind frame 1"
gdb_test "tfind" "Target failed to find requested trace frame\\..*"
}}
gdb_test "tfind" "Found trace frame 0, tracepoint .*" \
"tfind frame 0"
gdb_test "tfind" "Found trace frame 1, tracepoint .*" \
"tfind frame 1"
gdb_test "tfind" \
"Target failed to find requested trace frame\\..*"
}
}
# Run it on x86/x86_64 linux.
if { [istarget "x86_64-*-linux*"] || [istarget "i\[34567\]86-*-linux*"] } {

View file

@ -133,7 +133,8 @@ proc test_maybe_regvar_display { var } {
# Test procs
#
proc gdb_collect_args_test {} { with_test_prefix "unavailable arguments" {
proc gdb_collect_args_test {} {
with_test_prefix "unavailable arguments" {
global cr
global gdb_prompt
@ -198,9 +199,11 @@ proc gdb_collect_args_test {} { with_test_prefix "unavailable arguments" {
gdb_test "tfind none" \
"#0 end .*" \
"cease trace debugging"
}}
}
}
proc gdb_collect_locals_test { func msg } { with_test_prefix "unavailable locals: $msg" {
proc gdb_collect_locals_test { func msg } {
with_test_prefix "unavailable locals: $msg" {
global cr
global gdb_prompt
@ -249,9 +252,11 @@ proc gdb_collect_locals_test { func msg } { with_test_prefix "unavailable locals
gdb_test "tfind none" \
"#0 end .*" \
"cease trace debugging"
}}
}
}
proc gdb_unavailable_registers_test { } { with_test_prefix "unavailable registers" {
proc gdb_unavailable_registers_test { } {
with_test_prefix "unavailable registers" {
global gdb_prompt
global spreg
global pcreg
@ -300,7 +305,8 @@ proc gdb_unavailable_registers_test { } { with_test_prefix "unavailable register
"info registers \$$spreg reports not available"
gdb_test "tfind none" "#0 end .*" "cease trace debugging"
}}
}
}
proc gdb_unavailable_floats { } {
global gdb_prompt
@ -335,7 +341,8 @@ proc gdb_unavailable_floats { } {
}
}
proc gdb_collect_globals_test { } { with_test_prefix "collect globals" {
proc gdb_collect_globals_test { } {
with_test_prefix "collect globals" {
global ws
global cr
global gdb_prompt
@ -572,7 +579,8 @@ proc gdb_collect_globals_test { } { with_test_prefix "collect globals" {
gdb_test "tfind none" \
"#0 end .*" \
"cease trace debugging"
}}
}
}
proc gdb_trace_collection_test {} {
gdb_collect_globals_test