2013-06-07 Pedro Alves <palves@redhat.com>
+ * boards/native-extended-gdbserver.exp: Remove semicolon.
+ * config/arm-ice.exp: Likewise.
+ * config/bfin.exp: Likewise.
+ * config/cygmon.exp: Likewise.
+ * config/h8300.exp: Likewise.
+ * config/monitor.exp: Likewise.
+ * config/sid.exp: Likewise.
+ * config/sim.exp: Likewise.
+ * config/slite.exp: Likewise.
+ * config/vx.exp: Likewise.
+ * gdb.arch/i386-bp_permanent.exp: Likewise.
+ * gdb.asm/asm-source.exp: Likewise.
+ * gdb.base/args.exp: Likewise.
+ * gdb.base/attach-pie-misread.exp: Likewise.
+ * gdb.base/auxv.exp: Likewise.
+ * gdb.base/bigcore.exp: Likewise.
+ * gdb.base/bitfields2.exp: Likewise.
+ * gdb.base/bitfields.exp: Likewise.
+ * gdb.base/break.exp: Likewise.
+ * gdb.base/break-interp.exp: Likewise.
+ * gdb.base/callfuncs.exp: Likewise.
+ * gdb.base/call-sc.exp: Likewise.
+ * gdb.base/commands.exp: Likewise.
+ * gdb.base/corefile.exp: Likewise.
+ * gdb.base/dbx.exp: Likewise.
+ * gdb.base/ending-run.exp: Likewise.
+ * gdb.base/exprs.exp: Likewise.
+ * gdb.base/funcargs.exp: Likewise.
+ * gdb.base/hbreak2.exp: Likewise.
+ * gdb.base/huge.exp: Likewise.
+ * gdb.base/list.exp: Likewise.
+ * gdb.base/memattr.exp: Likewise.
+ * gdb.base/overlays.exp: Likewise.
+ * gdb.base/printcmds.exp: Likewise.
+ * gdb.base/recurse.exp: Likewise.
+ * gdb.base/remotetimeout.exp: Likewise.
+ * gdb.base/reread.exp: Likewise.
+ * gdb.base/savedregs.exp: Likewise.
+ * gdb.base/scope.exp: Likewise.
+ * gdb.base/sepdebug.exp: Likewise.
+ * gdb.base/setshow.exp: Likewise.
+ * gdb.base/setvar.exp: Likewise.
+ * gdb.base/sigaltstack.exp: Likewise.
+ * gdb.base/siginfo-addr.exp: Likewise.
+ * gdb.base/siginfo.exp: Likewise.
+ * gdb.base/siginfo-obj.exp: Likewise.
+ * gdb.base/sigrepeat.exp: Likewise.
+ * gdb.base/sigstep.exp: Likewise.
+ * gdb.base/structs.exp: Likewise.
+ * gdb.base/testenv.exp: Likewise.
+ * gdb.base/twice.exp: Likewise.
+ * gdb.base/valgrind-db-attach.exp: Likewise.
+ * gdb.base/valgrind-infcall.exp: Likewise.
+ * gdb.base/varargs.exp: Likewise.
+ * gdb.base/watchpoint.exp: Likewise.
+ * gdb.cp/gdb1355.exp: Likewise.
+ * gdb.cp/misc.exp: Likewise.
+ * gdb.disasm/hppa.exp: Likewise.
+ * gdb.disasm/t01_mov.exp: Likewise.
+ * gdb.disasm/t02_mova.exp: Likewise.
+ * gdb.disasm/t03_add.exp: Likewise.
+ * gdb.disasm/t04_sub.exp: Likewise.
+ * gdb.disasm/t05_cmp.exp: Likewise.
+ * gdb.disasm/t06_ari2.exp: Likewise.
+ * gdb.disasm/t07_ari3.exp: Likewise.
+ * gdb.disasm/t08_or.exp: Likewise.
+ * gdb.disasm/t09_xor.exp: Likewise.
+ * gdb.disasm/t10_and.exp: Likewise.
+ * gdb.disasm/t11_logs.exp: Likewise.
+ * gdb.disasm/t12_bit.exp: Likewise.
+ * gdb.disasm/t13_otr.exp: Likewise.
+ * gdb.gdb/selftest.exp: Likewise.
+ * gdb.hp/gdb.base-hp/callfwmall.exp: Likewise.
+ * gdb.mi/mi-reverse.exp: Likewise.
+ * gdb.pascal/floats.exp: Likewise.
+ * gdb.python/py-inferior.exp: Likewise.
+ * gdb.threads/attach-into-signal.exp: Likewise.
+ * gdb.threads/pthreads.exp: Likewise.
+ * gdb.threads/thread_events.exp: Likewise.
+ * gdb.threads/watchthreads.exp: Likewise.
+ * gdb.trace/actions-changed.exp: Likewise.
+ * gdb.trace/actions.exp: Likewise.
+ * gdb.trace/ax.exp: Likewise.
+ * gdb.trace/backtrace.exp: Likewise.
+ * gdb.trace/change-loc.exp: Likewise.
+ * gdb.trace/deltrace.exp: Likewise.
+ * gdb.trace/disconnected-tracing.exp: Likewise.
+ * gdb.trace/ftrace.exp: Likewise.
+ * gdb.trace/infotrace.exp: Likewise.
+ * gdb.trace/passc-dyn.exp: Likewise.
+ * gdb.trace/passcount.exp: Likewise.
+ * gdb.trace/pending.exp: Likewise.
+ * gdb.trace/qtro.exp: Likewise.
+ * gdb.trace/range-stepping.exp: Likewise.
+ * gdb.trace/report.exp: Likewise.
+ * gdb.trace/save-trace.exp: Likewise.
+ * gdb.trace/status-stop.exp: Likewise.
+ * gdb.trace/strace.exp: Likewise.
+ * gdb.trace/tfile.exp: Likewise.
+ * gdb.trace/tfind.exp: Likewise.
+ * gdb.trace/trace-break.exp: Likewise.
+ * gdb.trace/tracecmd.exp: Likewise.
+ * gdb.trace/trace-mt.exp: Likewise.
+ * gdb.trace/tspeed.exp: Likewise.
+ * gdb.trace/tsv.exp: Likewise.
+ * gdb.trace/while-stepping.exp: Likewise.
+ * lib/gdb.exp: Likewise.
+ * lib/gdbserver-support.exp: Likewise.
+ * lib/java.exp: Likewise.
+ * lib/mi-support.exp: Likewise.
+ * lib/pascal.exp: Likewise.
+ * lib/prompt.exp: Likewise.
+ * lib/trace-support.exp: Likewise.
+
+2013-06-07 Pedro Alves <palves@redhat.com>
+
* gdb.ada/info_types.c: Fix formating in copyright header.
* gdb.base/break-on-linker-gcd-function.cc: Likewise.
* gdb.base/float.c: Likewise.
# Test the copy of gdbserver in the build directory.
set_board_info gdb_server_prog "../gdbserver/gdbserver"
-send_user "configuring for gdbserver local testing (extended-remote)\n";
+send_user "configuring for gdbserver local testing (extended-remote)\n"
# We must load this explicitly here, and rename the procedures we want
# to override. If we didn't do this, given that mi-support.exp is
-load_lib "../config/monitor.exp";
+load_lib "../config/monitor.exp"
-load_lib "../config/monitor.exp";
+load_lib "../config/monitor.exp"
-load_lib "../config/monitor.exp";
+load_lib "../config/monitor.exp"
-load_lib "../config/monitor.exp";
+load_lib "../config/monitor.exp"
send_gdb "target $targetname $serialport\n"
gdb_expect 60 {
-re "A program is being debugged already.*ill it.*y or n. $" {
- send_gdb "y\n";
- exp_continue;
+ send_gdb "y\n"
+ exp_continue
}
-re "Couldn't establish connection to remote.*$gdb_prompt" {
- verbose "Connection failed";
+ verbose "Connection failed"
}
-re "Remote MIPS debugging.*$gdb_prompt" {
- verbose "Set target to $targetname";
+ verbose "Set target to $targetname"
return 0
}
-re "Remote debugging using .*$serialport.*$gdb_prompt" {
- verbose "Set target to $targetname";
+ verbose "Set target to $targetname"
return 0
}
-re "Remote target $targetname connected to.*$gdb_prompt" {
- verbose "Set target to $targetname";
+ verbose "Set target to $targetname"
return 0
}
-re "Connected to.*$gdb_prompt" {
- verbose "Set target to $targetname";
+ verbose "Set target to $targetname"
return 0
}
-re "Ending remote.*$gdb_prompt" { }
continue
}
-re "Timeout reading from remote system.*$gdb_prompt" {
- verbose "Got timeout error from gdb.";
+ verbose "Got timeout error from gdb."
}
timeout {
- send_gdb "\ 3";
+ send_gdb "\ 3"
break
}
}
if [target_info exists gdb_protocol] {
set targetname "[target_info gdb_protocol]"
} else {
- perror "No protocol specified for [target_info name].";
+ perror "No protocol specified for [target_info name]."
return -1
}
if [target_info exists baud] {
gdb_test "set remote Z-packet disable" ""
}
if [target_info exists gdb_serial] {
- set serialport "[target_info gdb_serial]";
+ set serialport "[target_info gdb_serial]"
} elseif [target_info exists netport] {
set serialport "[target_info netport]"
} else {
if ![gdb_target_cmd $targetname $serialport] { return 0 }
- gdb_target_exec;
+ gdb_target_exec
if { $j == 1 && ![reboot_target] } {
- break;
+ break
}
}
- perror "Couldn't set target for $targetname, port is $serialport.";
+ perror "Couldn't set target for $targetname, port is $serialport."
return -1
}
global GDB
global gdb_prompt
global timeout
- global last_gdb_file;
+ global last_gdb_file
if { $arg == "" } {
if [info exists last_gdb_file] {
- set arg $last_gdb_file;
+ set arg $last_gdb_file
} else {
- send_gdb "info files\n";
+ send_gdb "info files\n"
gdb_expect 30 {
-re "Symbols from \"(\[^\"\]+)\"" {
- set arg $expect_out(1,string);
- exp_continue;
+ set arg $expect_out(1,string)
+ exp_continue
}
-re "Local exec file:\[\r\n\]+\[ \t\]*`(\[^'\]+)'," {
- set arg $expect_out(1,string);
- exp_continue;
+ set arg $expect_out(1,string)
+ exp_continue
}
-re "$gdb_prompt $" { }
}
}
}
- set last_gdb_file $arg;
+ set last_gdb_file $arg
for { set j 1 } { $j <= 2 } {incr j } {
if [target_info exists gdb,use_standard_load] {
- gdb_target_exec;
+ gdb_target_exec
if ![target_info exists gdb,no_push_conn] {
- remote_push_conn host;
+ remote_push_conn host
}
- set state [remote_ld target $arg];
+ set state [remote_ld target $arg]
if ![target_info exists gdb,no_push_conn] {
- remote_close target;
- remote_pop_conn host;
+ remote_close target
+ remote_pop_conn host
}
if { $state == "pass" } {
if [gdb_target_monitor $arg] { return -1 }
gdb_test "list main" ".*" ""
- verbose "Loaded $arg into $GDB\n";
+ verbose "Loaded $arg into $GDB\n"
return 0
}
} else {
if [is_remote host] {
# FIXME: Multiple downloads. bleah.
- set farg [remote_download host $arg];
+ set farg [remote_download host $arg]
} else {
- set farg $arg;
+ set farg $arg
}
if { $arg != "" && [target_info exists gdb_sect_offset] } {
- set textoff [target_info gdb_sect_offset];
- send_gdb "sect .text $textoff\n";
+ set textoff [target_info gdb_sect_offset]
+ send_gdb "sect .text $textoff\n"
gdb_expect 30 {
-re "(0x\[0-9a-z]+) - 0x\[0-9a-z\]+ is \\.data" {
- set dataoff $expect_out(1,string);
- exp_continue;
+ set dataoff $expect_out(1,string)
+ exp_continue
}
-re "(0x\[0-9a-z\]+) - 0x\[0-9a-z\]+ is \\.bss" {
- set bssoff $expect_out(1,string);
- exp_continue;
+ set bssoff $expect_out(1,string)
+ exp_continue
}
-re "$gdb_prompt" { }
}
- set dataoff [format 0x%x [expr $dataoff + $textoff]];
- set bssoff [format 0x%x [expr $bssoff + $textoff]];
- send_gdb "sect .data $dataoff\n";
+ set dataoff [format 0x%x [expr $dataoff + $textoff]]
+ set bssoff [format 0x%x [expr $bssoff + $textoff]]
+ send_gdb "sect .data $dataoff\n"
gdb_expect 30 {
-re "$gdb_prompt" { }
}
- send_gdb "sect .bss $bssoff\n";
+ send_gdb "sect .bss $bssoff\n"
gdb_expect 30 {
-re "$gdb_prompt" { }
}
verbose "Loading $farg"
if [target_info exists gdb_load_offset] {
- set command "load $farg [target_info gdb_load_offset]\n";
+ set command "load $farg [target_info gdb_load_offset]\n"
} else {
- set command "load $farg\n";
+ set command "load $farg\n"
}
if [target_info exists gdb_load_timeout] {
set loadtimeout [target_info gdb_load_timeout]
}
set load_ok 0
- send_gdb $command;
+ send_gdb $command
gdb_expect $loadtimeout {
-re "\[Ff\]ailed.*$gdb_prompt $" {
- verbose "load failed";
+ verbose "load failed"
}
-re "Timeout reading from remote.*$gdb_prompt" {
}
}
# Make sure we don't have an open connection to the target.
- gdb_target_exec;
+ gdb_target_exec
if { $j == 1 } {
if { ![reboot_target] } {
- break;
+ break
}
}
}
- perror "Couldn't load file into GDB.";
+ perror "Couldn't load file into GDB."
return -1
}
sleep 4
if ![target_info exists gdb,no_push_conn] {
- remote_push_conn host;
+ remote_push_conn host
}
}
proc sid_exit {} {
if ![target_info exists gdb,no_push_conn] {
- remote_close host;
- remote_pop_conn host;
+ remote_close host
+ remote_pop_conn host
}
}
if $verbose>1 then {
perror "Error during download."
}
- set retval -1;
+ set retval -1
}
-re ".*$gdb_prompt $" {
if $verbose>1 then {
send_user "Loaded $arg into $GDB\n"
}
- set retval 0;
+ set retval 0
}
-re "$gdb_prompt $" {
if $verbose>1 then {
perror "GDB couldn't load."
}
- set retval -1;
+ set retval -1
}
timeout {
if $verbose>1 then {
perror "Timed out trying to load $arg."
}
- set retval -1;
+ set retval -1
}
}
set timeout $prev_timeout
proc gdb_target_sim { } {
global gdb_prompt
- set target_sim_options "[board_info target gdb,target_sim_options]";
+ set target_sim_options "[board_info target gdb,target_sim_options]"
send_gdb "target sim $target_sim_options\n"
set timeout 60
gdb_file_cmd $arg
if [target_info exists gdb_protocol] {
- set protocol [target_info gdb_protocol];
+ set protocol [target_info gdb_protocol]
} else {
set protocol "sparclite"
}
if [target_info exists serial] {
- set targetname [target_info serial];
- set command "target $protocol [target_info serial]\n";
+ set targetname [target_info serial]
+ set command "target $protocol [target_info serial]\n"
} else {
if ![target_info exists netport] {
- perror "Need either netport or gdb_serial entry for [target_info name].";
+ perror "Need either netport or gdb_serial entry for [target_info name]."
return -1
}
- set targetname [target_info netport];
- set command "target $protocol udp [target_info netport]\n";
+ set targetname [target_info netport]
+ set command "target $protocol udp [target_info netport]\n"
}
set timeout 60
verbose "Timeout is now $timeout seconds" 2
- set try_count 0;
- send_gdb $command;
+ set try_count 0
+ send_gdb $command
gdb_expect {
-re "Unknown response.*resetting the board.|remote timeout" {
- incr try_count;
+ incr try_count
if { $try_count > 3 } {
- set try_count 0;
- reboot_target;
- sleep 5;
+ set try_count 0
+ reboot_target
+ sleep 5
}
- sleep 1;
- send_gdb $command;
- exp_continue;
+ sleep 1
+ send_gdb $command
+ exp_continue
}
-re "Remote target.*$gdb_prompt $" { }
-re ".*SPARClite appears to be alive.*$gdb_prompt $" {
}
if [target_info exists gdb_load_offset] {
- set offset "[target_info gdb_load_offset]";
+ set offset "[target_info gdb_load_offset]"
} else {
- set offset "";
+ set offset ""
}
if { 1 } {
if [is_remote host] {
- set arg [remote_download host $arg];
+ set arg [remote_download host $arg]
if { $arg == "" } {
error "download failed"
return -1
if [target_info exists need_monitor_run] {
set timeout 10
verbose "Timeout is now $timeout seconds, doing monitor run" 2
- send_gdb "monitor run\n";
- sleep 2;
- send_gdb "\ 3";
+ send_gdb "monitor run\n"
+ sleep 2
+ send_gdb "\ 3"
gdb_expect {
-re ".*$gdb_prompt $" { verbose "Run command succeded" }
default {
- perror "error sending monitor run command";
+ perror "error sending monitor run command"
}
}
} else {
- sleep 2;
+ sleep 2
}
if [target_info exists gdb_serial] {
- set serial [target_info gdb_serial];
+ set serial [target_info gdb_serial]
} else {
- set serial [target_info serial];
+ set serial [target_info serial]
}
send_gdb "target remote $serial\n"
set timeout 60
verbose "Timeout is now $timeout seconds" 2
gdb_expect {
-re ".*Kill it?.*y or n.*" {
- send_gdb "y\n";
+ send_gdb "y\n"
exp_continue
}
-re ".*$gdb_prompt $" {
set timeout 10
verbose "Timeout is now $timeout seconds" 2
- set state [spawn_vxgdb];
+ set state [spawn_vxgdb]
if { $state == "pass" } {
return 0
}
return -1
}
}
- remote_reboot target;
+ remote_reboot target
}
}
gdb_expect {
-re "Done\..*$gdb_prompt $" {
verbose "Set target to [target_info hostname]" 1
- set timeout 10;
+ set timeout 10
return "pass"
}
-re "net_connect: RPC: (Program not registered|.*Timed out).*$" {
}
proc gdb_exit { } {
- remote_close target;
+ remote_close target
catch default_gdb_exit
}
set retcode [gdb_test_multiple "disassemble $function" "Disassemble function '$function'" {
-re ".*($hex) <\\+0>.*($hex) <\\+4>.*($hex) <\\+5>.*($hex) <\\+6>.*$gdb_prompt $" {
- set function_start $expect_out(1,string);
- set address $expect_out(2,string);
- set address1 $expect_out(3,string);
- set address2 $expect_out(4,string);
+ set function_start $expect_out(1,string)
+ set address $expect_out(2,string)
+ set address1 $expect_out(3,string)
+ set address2 $expect_out(4,string)
}
}]
set start_esp 0
gdb_test_multiple "print \$esp" "Fetch esp value." {
-re "\\\$1.*($hex).*$gdb_prompt $" {
- set start_esp $expect_out(1,string);
+ set start_esp $expect_out(1,string)
}
}
if { "${multilib_flags}" != "" } {
untested asm-source.exp
return -1
- return;
+ return
}
}
# Skip test if target does not support argument passing.
if [target_info exists noargs] {
- return;
+ return
}
set testfile "args"
set test "start inferior"
gdb_exit
-set res [remote_spawn host $binfile];
+set res [remote_spawn host $binfile]
if { $res < 0 || $res == "" } {
perror "Spawning $binfile failed."
fail $test
}
if { ![runto_main] } then {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
set print_core_line [gdb_get_line_number "ABORT;"]
gdb_test "tbreak $print_core_line"
gdb_test_no_output "set width 0"
if { ![runto_main] } then {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
set print_core_line [gdb_get_line_number "Dump core"]
gdb_test "tbreak $print_core_line"
global srcfile
if { ! [runto break1] } {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
if [gdb_test "print flags" ".*uc = 1 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #1"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Note that we check for s1 as either 1 or -1, so that failure to
# treat it correctly as a signed 1bit field (values 0 or -1) while
# printing its value does not cause a spurious failure. We do the
# signedness preservation test later.
if [gdb_test "print flags" ".*uc = 0 .*, s1 = (1|-1), u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (s1)"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #2"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 1, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (u1)"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #3"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 1, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (s2)"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #4"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 1, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (u2)"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #5"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 1, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (s3)"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #6"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 1, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (u3)"] {
gdb_suppress_tests
gdb_suppress_tests
}
# Hmmmm?
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
if [gdb_test "print/x flags" "= {uc = 0x0, s1 = 0x(1|f*), u1 = 0x0, s2 = 0x(3|f*), u2 = 0x0, s3 = 0x(7|f*), u3 = 0x0, s9 = 0x(1ff|f*), u9 = 0x0, sc = 0xff}" "bitfield containment #2"] {
gdb_suppress_tests
}
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
# Test unsigned bitfields for unsignedness and range.
if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 1, s2 = 0, u2 = 3, s3 = 0, u3 = 7, s9 = 0, u9 = 511, sc = 0.*" "unsigned bitfield ranges"] {
gdb_suppress_tests
}
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
#
gdb_suppress_tests
}
default {
- fail "determining signed-ness of bitfields" ;
- gdb_suppress_tests;
+ fail "determining signed-ness of bitfields"
+ gdb_suppress_tests
}
}
gdb_suppress_tests
}
# Hmmmm???
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
# Test bitfields at non-zero offsets in a struct.
start_test break1
if [gdb_test "print flags" ".*u1 = 0, u2 = 0, u3 = 0, s1 = 1, s2 = 0, s3 = 0.*" "bitfield uniqueness; flags.s1 = 1"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
continue_test break1 "#1"
if [gdb_test "print flags" ".*u1 = 1, u2 = 0, u3 = 0, s1 = 0, s2 = 0, s3 = 0.*" "bitfield uniqueness; flags.u1 = 1"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
continue_test break1 "#2"
if [gdb_test "print flags" ".*u1 = 0, u2 = 0, u3 = 0, s1 = 0, s2 = 1, s3 = 0.*" "bitfield uniqueness; flags.s2 = 1"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
continue_test break1 "#3"
if [gdb_test "print flags" ".*u1 = 0, u2 = 1, u3 = 0, s1 = 0, s2 = 0, s3 = 0.*" "bitfield uniqueness; flags.u2 = 1"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
continue_test break1 "#4"
if [gdb_test "print flags" ".*u1 = 0, u2 = 0, u3 = 0, s1 = 0, s2 = 0, s3 = 1.*" "bitfield uniqueness; flags.s3 = 1"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
continue_test break1 "#5"
if [gdb_test "print flags" ".*u1 = 0, u2 = 0, u3 = 1, s1 = 0, s2 = 0, s3 = 0.*" "bitfield uniqueness; flags.u3 = 1"] {
gdb_suppress_tests
}
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
if [gdb_test "print/x flags" "= {u1 = 0x0, u2 = 0x1ffffffff, u3 = 0x0, s1 = 0x(7fff|f*), s2 = 0x0, s3 = 0xf*}" "bitfield containment; flags.u2, flags.s1, flags.s2 to all 1s"] {
gdb_suppress_tests
}
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
# Test unsigned bitfields for unsignedness and range.
if [gdb_test "print flags" ".*u1 = 32767, u2 = 8589934591, u3 = 65535, s1 = 0, s2 = 0, s3 = 0.*" "maximum unsigned bitfield values"] {
gdb_suppress_tests
}
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
#
unsupported $test
}
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
unsupported $test
}
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
gdb_start
set test "sleep function started"
set command "${file} sleep"
- set res [remote_spawn host $command];
+ set res [remote_spawn host $command]
if { $res < 0 || $res == "" } {
perror "Spawning $command failed."
fail $test
set dir ${exec}.d
set relink_args [build_executable_own_libs ${test}.exp [file tail $exec] $srcfile $opts $interp $dir]
if {$relink_args == ""} {
- continue;
+ continue
}
if {$binsepdebug == "SEP"} {
gdb_expect {
-re "Break.* factorial .value=6. .*$gdb_prompt $" {}
-re ".*$gdb_prompt $" {
- fail "run to factorial(6)";
- gdb_suppress_tests;
+ fail "run to factorial(6)"
+ gdb_suppress_tests
}
timeout { fail "run to factorial(6) (timeout)" ; gdb_suppress_tests }
}
if [target_info exists gdb,noresults] { gdb_suppress_tests }
gdb_continue_to_end "recursive next test"
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
test_next_with_recursion
# Advance to main
if { ![runto_main] } then {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Get the debug format
global gdb_prompt
# We need to up this because this can be really slow on some boards.
- set timeout 60;
+ set timeout 60
# If any of these calls segv we don't want to affect subsequent tests.
# E.g., we want to ensure register values are restored.
# the language be set to the default.
if { ![runto_main] } {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# However, turn off overload-resolution for aCC. Having it on causes
gdb_test_no_output "set overload-resolution 0"
} else {
if { ![runto_main] } {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
gdb_test_no_output "set language c"
}
gdb_test "if value == 5\np/x 0xfeedface\nelse\np/x 0xdeadbeef\nend" \
"\\\$\[0-9\]* = 0xfeedface" \
"progvar_simple_if_test #2"
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
proc progvar_simple_while_test {} {
gdb_test "while value > 0\np/x 0xfeedface\nset value -= 1\nend" \
"\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface" \
"progvar_simple_while_test #1"
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
proc progvar_complex_if_while_test {} {
gdb_test "while value > 0\nset value -= 1\nif \(value % 2\) == 1\np/x 0xdeadbeef\nelse\np/x 0xfeedface\nend\nend" \
"\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface" \
"progvar_complex_if_while_test #1"
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
proc if_while_breakpoint_command_test {} {
gdb_test "info break" \
"while.*set.*if.*p/x.*else.*p/x.*end.*" \
"info break in if_while_breakpoint_command_test"
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
# Test that we can run the inferior from breakpoint commands.
"Continuing.*.*.*Breakpoint \[0-9\]*, factorial \\(value=5\\).*at.*\[0-9\]*\[ \]*if \\(value > 1\\) \{.*\[0-9\]*\[ \]*value \\*= factorial \\(value - 1\\);.*" \
"continue in infrun_breakpoint_command_test"
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
proc breakpoint_command_test {} {
"Breakpoint \[0-9\]*, factorial.*Now the value is 5" \
"continue in breakpoint_command_test"
gdb_test "print value" " = 5" "print value in breakpoint_command_test"
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
# Test a simple user defined command (with arguments)
timeout { fail "(timeout) 3 commands in test_command_prompt_position" }
}
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
# See previous comments above, they are still applicable.
#
-close;
+close
if $verbose>1 then {
send_user "Spawning $GDB $INTERNAL_GDBFLAGS $GDBFLAGS $binfile -core=$corefile\n"
}
-eval "spawn $GDB $INTERNAL_GDBFLAGS $GDBFLAGS $binfile -core=$corefile";
+eval "spawn $GDB $INTERNAL_GDBFLAGS $GDBFLAGS $binfile -core=$corefile"
expect {
-re "Core was generated by .*coremaker.*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" {
pass "args: execfile -core=[file tail $corefile]"
set timeout $oldtimeout
verbose "Timeout is now $timeout seconds" 2
-close;
+close
# Now restart normally.
-re ".* program is being debugged already.*y or n. $" {
# gdb_load may connect us to a gdbserver.
send_gdb "y\n"
- exp_continue;
+ exp_continue
}
-re "Core was generated by .*coremaker.*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" {
pass "core-file command"
if ![is_remote target] {
set test "attach: spawn sleep"
- set res [remote_spawn host "$binfile sleep"];
+ set res [remote_spawn host "$binfile sleep"]
if { $res < 0 || $res == "" } {
fail $test
return
set last_loaded_file $arg
if [is_remote host] {
- set arg [remote_download host $arg];
+ set arg [remote_download host $arg]
if { $arg == "" } {
error "download failed"
return -1
set program_in_exit 0
if {!$use_gdb_stub
&& (! [target_info exists use_cygmon] || ! [target_info use_cygmon])} {
- global program_exited;
+ global program_exited
if {[eval expr $program_exited == 0]} {
gdb_test_multiple "n" "step to end of run" {
-re "$inferior_exited_re normally.*$gdb_prompt $" {
if { [llength $args] % 2 } {
warning "an even # of arguments should be passed to test_expr"
}
- set last_ent [expr [llength $args] - 1];
- set testname [lindex $args $last_ent];
+ set last_ent [expr [llength $args] - 1]
+ set testname [lindex $args $last_ent]
if [gdb_test [lindex $args 0] ".*" "$testname (setup)"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
for {set x 1} {$x < $last_ent} {set x [expr $x + 2]} {
if [gdb_test [lindex $args $x] [lindex $args [expr $x + 1]] "$testname ([lindex $args $x])"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
}
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
#
# test expressions with "char" types
# Continue; should stop at call0b and print actual arguments.
if [gdb_test "cont" ".* call0b \\(s=1, i=2, l=3, c=97 'a'\\) .*" "continue to call0b"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Continue; should stop at call0c and print actual arguments.
if [gdb_test "cont" ".* call0c \\(i=2, l=3, c=97 'a', s=1\\) .*" "continue to call0c"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Continue; should stop at call0d and print actual arguments.
if [gdb_test "cont" ".* call0d \\(l=3, c=97 'a', s=1, i=2\\) .*" "continue to call0d";] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Continue; should stop at call0e and print actual arguments.
if [gdb_test "cont" ".* call0e \\(c1=97 'a', l=3, c2=97 'a', i=2, c3=97 'a', s=1, c4=97 'a', c5=97 'a'\\) .*" "continue to call0e" ] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
#
delete_breakpoints
- gdb_breakpoint call1a;
- gdb_breakpoint call1b;
- gdb_breakpoint call1c;
- gdb_breakpoint call1d;
- gdb_breakpoint call1e;
+ gdb_breakpoint call1a
+ gdb_breakpoint call1b
+ gdb_breakpoint call1c
+ gdb_breakpoint call1d
+ gdb_breakpoint call1e
# Run; should stop at call1a and print actual arguments.
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
# Continue; should stop at call1b and print actual arguments.
if [gdb_test "cont" ".* call1b \\(us=6, ui=7, ul=8, uc=98 'b'\\) .*" "continue to call1b"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Continue; should stop at call1c and print actual arguments.
if [gdb_test "cont" ".* call1c \\(ui=7, ul=8, uc=98 'b', us=6\\) .*" "continue to call1c"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Continue; should stop at call1d and print actual arguments.
if [gdb_test "cont" ".* call1d \\(ul=8, uc=98 'b', us=6, ui=7\\) .*" "continue to call1d"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Continue; should stop at call1e and print actual arguments.
if [gdb_test "cont" ".* call1e \\(uc1=98 'b', ul=8, uc2=98 'b', ui=7, uc3=98 'b', us=6, uc4=98 'b', uc5=98 'b'\\) .*" "continue to call1e"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
#
if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix*" }
# Continue; should stop at call2b and print actual arguments.
if [gdb_test "cont" ".* call2b \\(f1=4, s=1, d1=5, i=2, f2=4, l=3, d2=5, c=97 'a'\\) .*" "continue to call2b"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Continue; should stop at call2c and print actual arguments.
if [gdb_test "cont" ".* call2c \\(s=1, d1=5, i=2, f2=4, l=3, d2=5, c=97 'a', f1=4\\) .*" "continue to call2c"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Continue; should stop at call2d and print actual arguments.
if [gdb_test "cont" ".* call2d \\(d1=5, i=2, f2=4, l=3, d2=5, c=97 'a', f1=4, s=1\\) .*" "continue to call2d"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Continue; should stop at call2e and print actual arguments.
if [gdb_test "cont" ".* call2e \\(i=2, f2=4, l=3, d2=5, c=97 'a', f1=4, s=1, d1=5\\) .*" "continue to call2e"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Continue; should stop at call2f and print actual arguments.
if [gdb_test "cont" ".* call2f \\(f2=4, l=3, d2=5, c=97 'a', f1=4, s=1, d1=5, i=2\\) .*" "continue to call2f"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Continue; should stop at call2g and print actual arguments.
if [gdb_test "cont" ".* call2g \\(l=3, d2=5, c=97 'a', f1=4, s=1, d1=5, i=2, f2=4\\) .*" "continue to call2g"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Continue; should stop at call2h and print actual arguments.
if [gdb_test "cont" ".* call2h \\(d2=5, c=97 'a', f1=4, s=1, d1=5, i=2, f2=4, l=3\\) .*" "continue to call2h"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# monitor only allows 8 breakpoints; w89k board allows 10, so
# Continue; should stop at call2i and print actual arguments.
if [gdb_test "cont" ".* call2i \\(c1=97 'a', f1=4, c2=97 'a', c3=97 'a', d1=5, c4=97 'a', c5=97 'a', c6=97 'a', f2=4, s=1, c7=97 'a', d2=5\\) .*" "continue to call2i"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
# Continue; should stop at call3b and print actual arguments.
# Try dereferencing the arguments.
if [gdb_test "cont" ".* call3b \\(ucp=$hex <uc> \"b.*\", usp=$hex <us>, uip=$hex <ui>, ulp=$hex <ul>\\) .*" "continue to call3b"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
gdb_test "print *ucp" ".* = 98 'b'"
# Continue; should stop at call3c and print actual arguments.
# Try dereferencing the arguments.
if [gdb_test "cont" ".* call3c \\(fp=$hex <f>, dp=$hex <d>\\) .*" "continue to call3c"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
gdb_test "print *fp" ".* = 4"
gdb_test "print *dp" ".* = 5"
# pass "locate actual args, pointer types"
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
#
}
pass "locate actual args, structs/unions passed by reference"
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
#
fail "print un (unknown case)"
}
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
#
"\[\r\n\]#1 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
"\[\r\n\]#2 .* main \\(.*\\) at "
} ] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Continue; should stop at call6c and print actual arguments.
"\[\r\n\]#2 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
"\[\r\n\]#3 .* main \\(.*\\) at "
} ] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Continue; should stop at call6d and print actual arguments.
# Print backtrace.
"\[\r\n\]#3 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
"\[\r\n\]#4 .* main \\(.*\\) at "
} ] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Continue; should stop at call6e and print actual arguments.
"\[\r\n\]#4 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
"\[\r\n\]#5 .* main \\(.*\\) at "
} ] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Continue; should stop at call6f and print actual arguments.
"\[\r\n\]#5 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
"\[\r\n\]#6 .* main \\(.*\\) at "
} ] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Continue; should stop at call6g and print actual arguments.
"\[\r\n\]#6 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
"\[\r\n\]#7 .* main \\(.*\\) at "
} ] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Continue; should stop at call6h and print actual arguments.
"\[\r\n\]#7 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
"\[\r\n\]#8 .* main \\(.*\\) at "
} ] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# monitor only allows 8 breakpoints; w89k board allows 10, so
"\[\r\n\]#8 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
"\[\r\n\]#9 .* main \\(.*\\) at "
} ] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Continue; should stop at call6j and print actual arguments.
"\[\r\n\]#9 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
"\[\r\n\]#10 .* main \\(.*\\) at "
} ] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Continue; should stop at call6k and print actual arguments.
"\[\r\n\]#10 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
"\[\r\n\]#11 .* main \\(.*\\) at "
} ] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
"\[\r\n\]#10 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
"\[\r\n\]#11 .* main \\(.*\\) at "
}
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
#
} else {
fail "recursive passing of structs by value (sparclet)"
}
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
#
gdb_test "print l" " = 3" "print l in localvars_after_alloca"
gdb_test "backtrace 8" "#0.*localvars_after_alloca \\(c=97 'a', s=1, i=2, l=3\\).*#1.*main.*" "backtrace after alloca"
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
proc call_after_alloca { } {
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_test "backtrace 8" "#0.*call_after_alloca_subr \\(c=97 'a', s=1, i=2, l=3, uc=98 'b', us=11, ui=12, ul=13\\).*#1.*call_after_alloca \\(c=97 'a', s=1, i=2, l=3\\).*#2.*main.*" "backtrace from call_after_alloca_subr"
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
#
}
-re ".*$gdb_prompt $" {
fail "finish from indirectly called function"
- gdb_suppress_tests;
+ gdb_suppress_tests
}
default {
fail "finish from indirectly called function"
- gdb_suppress_tests;
+ gdb_suppress_tests
}
}
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_test "step" "call0a \\(c=97 'a', s=1, i=2, l=3\\).*" \
"stepping into indirectly called function"
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
#
gdb_suppress_tests
}
}
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
# Start with a fresh gdb.
if [target_info exists gdb,noresults] { gdb_suppress_tests }
gdb_continue_to_end "recursive next test"
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
test_next_with_recursion
# (could be very time-consuming on remote targets with slow connection).
#
if [target_info exists gdb,skip_huge_test] {
- return;
+ return
}
set testfile "huge"
# Return 1 if success, 0 if fail.
#
-set set_listsize_count 0;
+set set_listsize_count 0
proc set_listsize { arg } {
global gdb_prompt
- global set_listsize_count;
+ global set_listsize_count
- incr set_listsize_count;
+ incr set_listsize_count
if [gdb_test_no_output "set listsize $arg" "setting listsize to $arg #$set_listsize_count"] {
return 0
}
if { $arg == 0 } {
- set arg "unlimited";
+ set arg "unlimited"
}
if [gdb_test "show listsize" "Number of source lines.* is ${arg}.*" "show listsize $arg #$set_listsize_count"] {
timeout { fail "list list1.c:12 (timeout)" ; gdb_suppress_tests }
}
pass "list filename:number ($testcnt tests)"
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
#
}
pass "successive list commands to page forward ($testcnt tests)"
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
# Test that repeating the list linenum command doesn't print the same
}
pass "repeat list commands to page forward using 'return' ($testcnt tests)"
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
proc test_list_backwards {} {
}
pass "$testcnt successive \"list -\" commands to page backwards"
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
#
gdb_test_multiple "delete mem" "delete mem" {
-re "Delete all memory regions.*y or n.*$" {
- send_gdb "y\n";
+ send_gdb "y\n"
exp_continue
}
-re "$gdb_prompt $" { }
set data_overlays 1
if [istarget "d10v-*-*"] then {
- set linker_script "${srcdir}/${subdir}/d10v.ld";
+ set linker_script "${srcdir}/${subdir}/d10v.ld"
} elseif [istarget "m32r-*-*"] then {
- set linker_script "${srcdir}/${subdir}/m32r.ld";
+ set linker_script "${srcdir}/${subdir}/m32r.ld"
} elseif [istarget "spu-*-*"] then {
- set linker_script "${srcdir}/${subdir}/spu.ld";
+ set linker_script "${srcdir}/${subdir}/spu.ld"
set data_overlays 0
} else {
verbose "Skipping overlay test -- not implemented for this target."
#
if ![runto_main] then {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# couple of convenience variables
for { set x 1 } { $x <= 16 } { incr x } {
gdb_test_no_output "set print elements $x"
for { set e 1 } { $e <= 16 } {incr e } {
- set v [expr $e - 1];
+ set v [expr $e - 1]
set command "p &ctable2\[${v}*16\]"
if { $x < $e } {
- set aval $x;
+ set aval $x
} else {
- set aval $e;
+ set aval $e
}
- set xval [expr $x - $e];
+ set xval [expr $x - $e]
if { $xval < 0 } {
- set xval 0;
+ set xval 0
}
if { $aval > 10 } {
- set a "'a' <repeats $aval times>";
+ set a "'a' <repeats $aval times>"
if { $xval > 0 } {
- set a "${a}, \\\"";
+ set a "${a}, \\\""
}
} else {
- set a "\\\"[string range "aaaaaaaaaaaaaaaa" 1 $aval]";
+ set a "\\\"[string range "aaaaaaaaaaaaaaaa" 1 $aval]"
if { $xval > 10 } {
- set a "$a\\\", ";
+ set a "$a\\\", "
}
}
- set xstr "";
+ set xstr ""
if { $xval > 10 } {
- set xstr "'X' <repeats $xval times>";
+ set xstr "'X' <repeats $xval times>"
} else {
if { $xval > 0 } {
- set xstr "[string range "XXXXXXXXXXXXXXXX" 1 $xval]\\\"";
+ set xstr "[string range "XXXXXXXXXXXXXXXX" 1 $xval]\\\""
} else {
if { $aval <= 10 } {
- set xstr "\\\"";
+ set xstr "\\\""
}
}
}
if { $aval < 16 } {
set xstr "${xstr}\[.\]\[.\]\[.\]"
}
- set string " = \[(\]unsigned char \[*\]\[)\] <ctable2(\\+$decimal)?> ${a}${xstr}";
- gdb_test "$command" "$string" "$command with print elements set to $x";
+ set string " = \[(\]unsigned char \[*\]\[)\] <ctable2(\\+$decimal)?> ${a}${xstr}"
+ gdb_test "$command" "$string" "$command with print elements set to $x"
}
}
}
# We need to up this because this can be really slow on some boards.
# (Test may involve inferior malloc() calls).
- set timeout 60;
+ set timeout 60
gdb_test "p \"a string\"" " = \"a string\""
gdb_test "p \"embedded \\000 null\"" " = \"embedded \\\\000 null\""
# We need to up this because this can be really slow on some boards.
# (Test may involve inferior malloc() calls).
- set timeout 60;
+ set timeout 60
gdb_test "print {'a','b','c'}" " = \"abc\""
gdb_test_escape_braces "print {0,1,2}" " = {0, 1, 2}"
if [gdb_test "continue" \
"Continuing.*\[Ww\]atchpoint.*: b.*Old value = 0.*New value = 10.*" \
"continue to first instance watchpoint, first time"] then {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Continue inward for a few iterations
if [gdb_test "continue" \
"Continuing.*\[Ww\]atchpoint.*: b.*Old value = 0.*New value = 5.*"\
"continue to second instance watchpoint, first time"] then {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Continue inward for a few iterations
if [gdb_test "continue" \
"Continuing.*\[Ww\]atchpoint.*: b.*Old value = 5.*New value = 120.*return.*" \
"continue to second instance watchpoint, second time"] then {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Continue again. We should have a watchpoint go out of scope now
if [gdb_test "continue" \
"Continuing.*\[Ww\]atchpoint.*deleted.*recurse \\(a=6\\) .*" \
"second instance watchpoint deleted when leaving scope"] then {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Continue until second set of b (first instance).
if [gdb_test "continue" \
"Continuing.*\[Ww\]atchpoint.*deleted.*\(main \\(\\) \|21.*\}\).*" \
"first instance watchpoint deleted when leaving scope"] then {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
}
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
# Preserve the old timeout, and set a new one that should be
# Skip test if target does not support argument passing.
if [target_info exists noargs] {
- return;
+ return
}
#
gdb_expect {
-re ".*Breakpoint.* foo .* at .*$srcfile1:14.*$gdb_prompt $" {
- pass "run to foo()";
+ pass "run to foo()"
}
-re ".*$gdb_prompt $" {
- fail "run to foo()";
- gdb_suppress_tests;
+ fail "run to foo()"
+ gdb_suppress_tests
}
timeout { fail "run to foo() (timeout)" ; gdb_suppress_tests }
}
# Should see "Breakpoint 1, foo () at reread2.c:9"
if [is_remote target] {
- unsupported "run to foo() second time ";
+ unsupported "run to foo() second time "
} else {
gdb_run_cmd
gdb_expect {
# -re ".*re-reading symbols.*Breakpoint.* foo .* at .*$srcfile2:9.*$gdb_prompt $" {}
-re ".*Breakpoint.* foo .* at .*:9.*$gdb_prompt $" {
- pass "run to foo() second time ";
+ pass "run to foo() second time "
}
-re ".*$gdb_prompt $" {
- fail "run to foo() second time";
- gdb_suppress_tests;
+ fail "run to foo() second time"
+ gdb_suppress_tests
}
timeout {
- fail "run to foo() second time (timeout)" ;
+ fail "run to foo() second time (timeout)"
gdb_suppress_tests
}
}
gdb_run_cmd
gdb_expect {
-re ".*Breakpoint.* foo .* at .*$srcfile1:14.*$gdb_prompt $" {
- pass "second pass: run to foo()";
+ pass "second pass: run to foo()"
}
-re ".*$gdb_prompt $" {
- fail "second pass: run to foo()";
- gdb_suppress_tests;
+ fail "second pass: run to foo()"
+ gdb_suppress_tests
}
timeout {
fail "second pass: run to foo() (timeout)"
gdb_run_cmd
gdb_expect {
-re ".*Breakpoint.* foo .* at .*:9.*$gdb_prompt $" {
- pass "second pass: run to foo() second time ";
+ pass "second pass: run to foo() second time "
}
-re ".*$gdb_prompt $" {
- fail "second pass: run to foo() second time";
- gdb_suppress_tests;
+ fail "second pass: run to foo() second time"
+ gdb_suppress_tests
}
timeout {
- fail "second pass: run to foo() second time (timeout)" ;
+ fail "second pass: run to foo() second time (timeout)"
gdb_suppress_tests
}
}
# Advance to main
if { ![runto_main] } {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
proc process_saved_regs { current inner outer } {
# Print scope0.c::filelocal, which is 1
if [gdb_test "print filelocal" "\\\$$decimal = 1" "print filelocal" ] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
if [gdb_test "print 'scope0.c'::filelocal" "\\\$$decimal = 1" "print 'scope0.c'::filelocal at main" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal"] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
# Print scope0.c::filelocal_bss, which is 101
if [gdb_test "print filelocal_bss" "\\\$$decimal = 101" "print filelocal_bss" ] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
if [gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal = 101" "print 'scope0.c'::filelocal_bss in test_at_main" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_bss"] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
# No clue why the rs6000 fails this test.
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
if [gdb_test "print filelocal_ro" "\\\$$decimal = 201" "print filelocal_ro in test_at_main" ] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
if [gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal = 201" "print 'scope0.c'::filelocal_ro" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_ro"] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
if [gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal = 2" "print 'scope1.c'::filelocal" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal"] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
if [gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal = 102" "print 'scope1.c'::filelocal_bss" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_bss"] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
if {$hp_cc_compiler} then { setup_xfail "hppa2.0w-*-*" 11747CLLbs}
if [gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal = 202" "print 'scope1.c'::filelocal_ro" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_ro"] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
# Print scope1.c::foo::funclocal, which is 3
if [gdb_test "print foo::funclocal" "\\\$$decimal = 3" "print foo::funclocal" ] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
if [gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal = 3" "print 'scope1.c'::foo::funclocal" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal"] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
# Print scope1.c::foo::funclocal_ro, which is 203
if [gdb_test "print foo::funclocal_ro" "\\\$$decimal = 203" "print foo::funclocal_ro" ] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
if [gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal = 203" "print 'scope1.c'::foo::funclocal_ro" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal_ro"] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
# Print scope1.c::bar::funclocal, which is 4
if [gdb_test "print bar::funclocal" "\\\$$decimal = 4" "print bar::funclocal" ] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
if [gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal = 4" "print 'scope1.c'::bar::funclocal" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::bar::funclocal"] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
global subdir
if [gdb_test "next" ".*bar \\(\\);" "" ] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
# Print scope0.c::filelocal, which is 1
if [gdb_test "print 'scope0.c'::filelocal" "\\\$$decimal = 1" "print 'scope0.c'::filelocal at foo" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal"] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
# Print scope0.c::filelocal_bss, which is 101
if [gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal = 101" "print 'scope0.c'::filelocal_bss in test_at_foo" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_bss"] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
if [gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal = 201" "print 'scope0.c'::filelocal_ro" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_ro"] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
if [gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal = 2" "print 'scope1.c'::filelocal at foo" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal"] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal = 4" "print 'scope1.c'::bar::funclocal at foo" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::bar::funclocal"
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
global subdir
if [gdb_test "next" ".*" "" ] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
# Print scope0.c::filelocal, which is 1
if [gdb_test "print 'scope0.c'::filelocal" "\\\$$decimal = 1" "print 'scope0.c'::filelocal at bar" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal"] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
# Print scope0.c::filelocal_bss, which is 101
if [gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal = 101" "print 'scope0.c'::filelocal_bss in test_at_bar" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_bss"] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
if [gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal = 201" "print 'scope0.c'::filelocal_ro at bar" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_ro"] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
# Print scope1.c::filelocal, which is 2
if [gdb_test "print filelocal" "\\\$$decimal = 2" "print filelocal at bar" ] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
if [gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal = 2" "print 'scope1.c'::filelocal at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal"] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
# Print scope1.c::filelocal_bss, which is 102
if [gdb_test "print filelocal_bss" "\\\$$decimal = 102" "print filelocal_bss at bar" ] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
if [gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal = 102" "print 'scope1.c'::filelocal_bss at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_bss"] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
# Print scope1.c::filelocal_ro, which is 202
if [gdb_test "print filelocal_ro" "\\\$$decimal = 202" "print filelocal_ro in test_at_bar" ] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
if [gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal = 202" "print 'scope1.c'::filelocal_ro at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_ro"] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
# Print scope1.c::foo::funclocal, which is 3
if [gdb_test "print foo::funclocal" "\\\$$decimal = 3" "print foo::funclocal at bar" ] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
if [gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal = 3" "print 'scope1.c'::foo::funclocal at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal"] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
# Print scope1.c::foo::funclocal_bss, which is 103
if [gdb_test "print foo::funclocal_bss" "\\\$$decimal = 103" "print foo::funclocal_bss at bar" ] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
if [gdb_test "print 'scope1.c'::foo::funclocal_bss" "\\\$$decimal = 103" "print 'scope1.c'::foo::funclocal_bss at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal_bss"] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
# Print scope1.c::foo::funclocal_ro, which is 203
if [gdb_test "print foo::funclocal_ro" "\\\$$decimal = 203" "print foo::funclocal_ro at bar" ] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
if [gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal = 203" "print 'scope1.c'::foo::funclocal_ro at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal_ro"] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
# Print scope1.c::bar::funclocal, which is 4
if [gdb_test "print funclocal" "\\\$$decimal = 4" "print funclocal at bar" ] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
if [gdb_test "print bar::funclocal" "\\\$$decimal = 4" "print bar::funclocal at bar" ] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
if [gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal = 4" "print 'scope1.c'::bar::funclocal at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::bar::funclocal"] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
# Print scope1.c::bar::funclocal_bss, which is 104
if [gdb_test "print funclocal_bss" "\\\$$decimal = 104" "print funclocal_bss at bar" ] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
if [gdb_test "print bar::funclocal_bss" "\\\$$decimal = 104" "print bar::funclocal_bss at bar" ] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
if [gdb_test "print 'scope1.c'::bar::funclocal_bss" "\\\$$decimal = 104" "print 'scope1.c'::bar::funclocal_bss at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::bar::funclocal_bss"] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
gdb_breakpoint marker1
if [gdb_test "cont" "Break.* marker1 \\(\\) at .*:$decimal.*" "continue to marker1"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
if [gdb_test "up" ".*autovars.*" "up from marker1 in scope.exp" ] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
set count 0
while {$count < 100} {
if [gdb_test "print i$count" ".* = $count" "" ] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
set count [expr $count+1]
gdb_breakpoint marker4
if [gdb_test "cont" "Break.* marker2 \\(\\) at .*:$decimal.*" "continue to marker2"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
if [gdb_test "up" ".*localscopes.*" "up from marker2 in scopes.exp" ] {
- gdb_suppress_tests ;
+ gdb_suppress_tests
}
# Should be at first (outermost) scope. Check values.
gdb_test "print localval1" " = 11" "print localval1, innermost scope"
gdb_test "print localval2" " = 12" "print localval2, innermost scope"
gdb_test "print localval3" " = 13" "print localval3, innermost scope"
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
# Start with a fresh gdb.
gdb_expect {
-re "Break.* factorial .value=6. .*$gdb_prompt $" {}
-re ".*$gdb_prompt $" {
- fail "run to factorial(6)";
- gdb_suppress_tests;
+ fail "run to factorial(6)"
+ gdb_suppress_tests
}
timeout { fail "run to factorial(6) (timeout)" ; gdb_suppress_tests }
}
if [target_info exists gdb,noresults] { gdb_suppress_tests }
gdb_continue_to_end "recursive next test"
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
test_next_with_recursion
# make sure $pc is sane, in case we're talking to a board.
if { ![runto_main] } {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
#
proc test_set { args } {
global gdb_prompt
- set length [expr [llength $args] - 1];
- set message "[lindex $args $length]";
- set final [expr $length - 2];
- set count 1;
+ set length [expr [llength $args] - 1]
+ set message "[lindex $args $length]"
+ set final [expr $length - 2]
+ set count 1
# Set up the variables.
for {set x 0} {$x < $length} {incr x} {
if { "[lindex $args $x]" != "" } {
- set arg [lindex $args $x];
+ set arg [lindex $args $x]
if { ($x == $final) || ([string first ".*" [lindex $args [expr $x + 1]]] >= 0) } {
- set match [lindex $args [expr $x + 1]];
+ set match [lindex $args [expr $x + 1]]
if { $count == 1 } {
set mess "$message"
} else {
- set mess "$message (#$count)";
+ set mess "$message (#$count)"
}
- incr count;
- incr x;
+ incr count
+ incr x
} else {
- set mess "";
+ set mess ""
set match ""
}
verbose "doing $arg $match"
if [gdb_test "$arg" "$match" "$mess"] {
- fail "$message -- $match";
+ fail "$message -- $match"
return 1
}
}
# Advance to main
if { ![runto_main] } then {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Stop in handle, when at the inner most level
# Advance to main
if { ![runto_main] } then {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Run to the signal.
# Advance to main
if { ![runto_main] } then {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Run to the signal.
# Advance to main
if { ![runto_main] } then {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Run to the signal.
# Advance to main
if { ![runto_main] } then {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Pass all the alarms straight through (but verbosely)
# Advance to main
if { ![runto_main] } then {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Run to the signal handler wait loop.
# Advance to main
if { ![runto_main] } then {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Pass all the alarms straight through (but verbosely)
# Advance to main
if { ![runto_main] } then {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
# Get the debug format
# make sure $pc is sane, in case we're talking to a board.
if { ![runto_main] } {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
set bp_line [gdb_get_line_number "set breakpoint here"]
# make sure $pc is sane, in case we're talking to a board.
if { ![runto_main] } {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
set bp_line [gdb_get_line_number "set breakpoint here"]
set options debug
lappend options "additional_flags=-I."
-set fileid [open ${objdir}/${subdir}/${srcfile} w];
-puts $fileid "#include \"twice.c\"";
-close $fileid;
+set fileid [open ${objdir}/${subdir}/${srcfile} w]
+puts $fileid "#include \"twice.c\""
+close $fileid
remote_download host ${srcdir}/${subdir}/twice.c twice.c
set test "spawn valgrind"
set cmd "valgrind --db-attach=yes $db_command $binfile"
-set res [remote_spawn host $cmd];
+set res [remote_spawn host $cmd]
if { $res < 0 || $res == "" } {
verbose -log "Spawning $cmd failed."
unsupported $test
set test "spawn valgrind"
set cmd "valgrind --vgdb-error=0 $binfile"
-set res [remote_spawn host $cmd];
+set res [remote_spawn host $cmd]
if { $res < 0 || $res == "" } {
verbose -log "Spawning $cmd failed."
unsupported $test
if [gdb_skip_stdio_test "varargs.exp"] {
# Nothing in this module is testable without printf.
- return;
+ return
}
if ![runto_main] then {
# These tests won't work without printf support.
if [gdb_skip_stdio_test "watchpoints triggered in syscall"] {
- return;
+ return
}
# Run until we get to the first marker function.
set x 0
# to gdb, not the inferior, and we lose. So that is why we have
# watchpoint.c prompt us, so we can wait for that prompt.
- send_gdb "continue\n";
+ send_gdb "continue\n"
gdb_expect {
-re "Continuing\\.\r\ntype stuff for buf now:" {
pass "continue to read"
}
default {
- fail "continue to read";
+ fail "continue to read"
return
}
}
set f_b "${ws}bool m_bool;"
set itc "<invalid type code ${decimal}>"
-set bad_i "${ws}(${itc}|int) m_int;";
+set bad_i "${ws}(${itc}|int) m_int;"
set bad_c "${ws}(${itc}|char) m_char;"
set bad_li "${ws}(${itc}|long int) m_long_int;"
set bad_ui "${ws}(${itc}|unsigned int) m_unsigned_int;"
if { [llength $args] % 2 } {
warning "an even # of arguments should be passed to test_expr"
}
- set last_ent [expr [llength $args] - 1];
- set testname [lindex $args $last_ent];
+ set last_ent [expr [llength $args] - 1]
+ set testname [lindex $args $last_ent]
if [gdb_test_no_output [lindex $args 0] "$testname (setup)"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
for {set x 1} {$x < $last_ent} {set x [expr $x + 2]} {
if [gdb_test [lindex $args $x] [lindex $args [expr $x + 1]] "$testname ([lindex $args $x])"] {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
}
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
}
proc do_tests {} {
set testfile "hppa"
set srcfile ${srcdir}/${subdir}/${testfile}.s
set binfile ${objdir}/${subdir}/${testfile}
-set comp_output [gdb_compile "${srcfile}" "${binfile}" executable ""];
+set comp_output [gdb_compile "${srcfile}" "${binfile}" executable ""]
if { $comp_output != "" } {
if [ regexp "Opcode not defined - DIAG" $comp_output] {
warning "HP assembler in use--skipping disasm tests"
set objfile ${objdir}/${subdir}/${testfile}.o
set binfile ${objdir}/${subdir}/${testfile}.x
-set asm-flags "";
-set link-flags "-m h8300sxelf";
+set asm-flags ""
+set link-flags "-m h8300sxelf"
if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
set objfile ${objdir}/${subdir}/${testfile}.o
set binfile ${objdir}/${subdir}/${testfile}.x
-set asm-flags "";
-set link-flags "-m h8300sxelf";
+set asm-flags ""
+set link-flags "-m h8300sxelf"
if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
set objfile ${objdir}/${subdir}/${testfile}.o
set binfile ${objdir}/${subdir}/${testfile}.x
-set asm-flags "";
-set link-flags "-m h8300sxelf";
+set asm-flags ""
+set link-flags "-m h8300sxelf"
if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
set objfile ${objdir}/${subdir}/${testfile}.o
set binfile ${objdir}/${subdir}/${testfile}.x
-set asm-flags "";
-set link-flags "-m h8300sxelf";
+set asm-flags ""
+set link-flags "-m h8300sxelf"
if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
set objfile ${objdir}/${subdir}/${testfile}.o
set binfile ${objdir}/${subdir}/${testfile}.x
-set asm-flags "";
-set link-flags "-m h8300sxelf";
+set asm-flags ""
+set link-flags "-m h8300sxelf"
if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
set objfile ${objdir}/${subdir}/${testfile}.o
set binfile ${objdir}/${subdir}/${testfile}.x
-set asm-flags "";
-set link-flags "-m h8300sxelf";
+set asm-flags ""
+set link-flags "-m h8300sxelf"
if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
set objfile ${objdir}/${subdir}/${testfile}.o
set binfile ${objdir}/${subdir}/${testfile}.x
-set asm-flags "";
-set link-flags "-m h8300sxelf";
+set asm-flags ""
+set link-flags "-m h8300sxelf"
if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
set objfile ${objdir}/${subdir}/${testfile}.o
set binfile ${objdir}/${subdir}/${testfile}.x
-set asm-flags "";
-set link-flags "-m h8300sxelf";
+set asm-flags ""
+set link-flags "-m h8300sxelf"
if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
set objfile ${objdir}/${subdir}/${testfile}.o
set binfile ${objdir}/${subdir}/${testfile}.x
-set asm-flags "";
-set link-flags "-m h8300sxelf";
+set asm-flags ""
+set link-flags "-m h8300sxelf"
if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
set objfile ${objdir}/${subdir}/${testfile}.o
set binfile ${objdir}/${subdir}/${testfile}.x
-set asm-flags "";
-set link-flags "-m h8300sxelf";
+set asm-flags ""
+set link-flags "-m h8300sxelf"
if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
set objfile ${objdir}/${subdir}/${testfile}.o
set binfile ${objdir}/${subdir}/${testfile}.x
-set asm-flags "";
-set link-flags "-m h8300sxelf";
+set asm-flags ""
+set link-flags "-m h8300sxelf"
if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
set objfile ${objdir}/${subdir}/${testfile}.o
set binfile ${objdir}/${subdir}/${testfile}.x
-set asm-flags "";
-set link-flags "-m h8300sxelf";
+set asm-flags ""
+set link-flags "-m h8300sxelf"
if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
set objfile ${objdir}/${subdir}/${testfile}.o
set binfile ${objdir}/${subdir}/${testfile}.x
-set asm-flags "";
-set link-flags "-m h8300sxelf";
+set asm-flags ""
+set link-flags "-m h8300sxelf"
if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
gdb_start
set file [remote_download host $GDB_FULLPATH x$tool]
-set result [test_with_self $file];
-gdb_exit;
-catch "remote_file host delete $file";
+set result [test_with_self $file]
+gdb_exit
+catch "remote_file host delete $file"
if {$result <0} then {
warning "Couldn't test self"
global gdb_prompt
# We need to up this because this can be really slow on some boards.
- set timeout 60;
+ set timeout 60
gdb_test "p t_char_values(0,0)" " = 0"
gdb_test "p t_char_values('a','b')" " = 1"
# the language be set to the default.
if { ![runto_main] } {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
gdb_test "set overload-resolution 0" ".*"
} else {
if { ![set_lang_c] } {
- gdb_suppress_tests;
+ gdb_suppress_tests
} else {
if { ![runto_main] } {
- gdb_suppress_tests;
+ gdb_suppress_tests
}
}
}
if [mi_gdb_test "-interpreter-exec console record" \
"=record-started,thread-group=\"i1\"\r\n\\^done" \
"Turn on process record"] {
- warning "Fail to activate process record/replay, tests in this group will not be performed.\n";
+ warning "Fail to activate process record/replay, tests in this group will not be performed.\n"
return -1
}
}
verbose "expo found: $expo" 1
} else {
set expo "0"
- regsub ".*\[eE\]" "$value" "" expo;
+ regsub ".*\[eE\]" "$value" "" expo
}
- regsub "^-" "$expo" "" mexpo;
+ regsub "^-" "$expo" "" mexpo
verbose "expo is $expo" 1
verbose "mexpo is $mexpo" 1
if { $value == 0 } {
# targets, test the search spanning multiple chunks.
# Remote targets may implement the search differently.
-set CHUNK_SIZE 16000 ;
+set CHUNK_SIZE 16000
gdb_test_no_output "set *(int32_t*) &search_buf\[0*${CHUNK_SIZE}+100\] = 0x12345678"
gdb_test_no_output "set *(int32_t*) &search_buf\[1*${CHUNK_SIZE}+100\] = 0x12345678"
set stoppedtry 10
break
}
- gets $fileid line1;
- gets $fileid line2;
- close $fileid;
+ gets $fileid line1
+ gets $fileid line2
+ close $fileid
if {![string match "*(stopped)*" $line2]} {
# No PASS message as we may be looping in multiple
if [test_startup] then {
if [check_control_c] then {
warning "Could not stop child with ^C; skipping rest of tests.\n"
- return;
+ return
}
check_backtraces
}
return [gdb_test_multiple $command $message {
-re "\\\[New Thread \[^\]\]*\\\]\r\n" {
- incr events_seen;
- exp_continue;
+ incr events_seen
+ exp_continue
}
-re "\[\r\n\]*($pattern)\[\r\n\]+$gdb_prompt $" {
if { $events_seen != $events_expected } {
return [gdb_test_multiple $command $message {
-re "\\\[Thread \[^\]\]* exited\\\]\r\n" {
incr events_seen
- exp_continue;
+ exp_continue
}
-re "\[\r\n\]*($pattern)\[\r\n\]+$gdb_prompt $" {
if { $events_seen != $events_expected } {
# If we fail above, don't bother continuing loop
if { $test_flag == 0 } {
- set i 30;
+ set i 30
}
}
if ![gdb_target_supports_trace] {
unsupported "Current target does not support trace"
- return -1;
+ return -1
}
test_actions_changed
# This file was written by Michael Snyder (msnyder@cygnus.com)
-load_lib "trace-support.exp";
+load_lib "trace-support.exp"
gdb_exit
# define relative source line numbers:
# all subsequent line numbers are relative to this first one (baseline)
-set baseline [gdb_find_recursion_test_baseline $srcfile];
+set baseline [gdb_find_recursion_test_baseline $srcfile]
if { $baseline == -1 } then {
fail "Could not find gdb_recursion_test function"
- return;
+ return
}
set testline1 [expr $baseline + 7]
#
gdb_delete_tracepoints
-set trcpt1 [gdb_gettpnum gdb_c_test];
-set trcpt2 [gdb_gettpnum gdb_asm_test];
-set trcpt3 [gdb_gettpnum $testline1];
+set trcpt1 [gdb_gettpnum gdb_c_test]
+set trcpt2 [gdb_gettpnum gdb_asm_test]
+set trcpt3 [gdb_gettpnum $testline1]
if { $trcpt1 <= 0 || $trcpt2 <= 0 || $trcpt3 <= 0 } then {
fail "setting tracepoints"
- return;
+ return
}
# 5.1 actions of specified tracepoint
# The tests that use the maintenance command do not need tracepoint
# support on the target, but they do want a live program.
-load_lib "trace-support.exp";
+load_lib "trace-support.exp"
gdb_exit
# This file was written by Michael Snyder (msnyder@cygnus.com)
-load_lib "trace-support.exp";
+load_lib "trace-support.exp"
gdb_exit
set arg5 5
set arg6 6
-set baseline [gdb_find_recursion_test_baseline $srcfile];
+set baseline [gdb_find_recursion_test_baseline $srcfile]
if { $baseline == -1 } {
fail "Could not find gdb_recursion_test function"
- return;
+ return
}
set return_me 0
if { $tdp2 <= 0 || $tdp3 <= 0 || \
$tdp4 <= 0 || $tdp5 <= 0 || $tdp6 <= 0 } then {
fail "setting tracepoints failed"
- return;
+ return
}
#gdb_trace_setactions "setup TP to collect FP" \
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-load_lib "trace-support.exp";
+load_lib "trace-support.exp"
if {[skip_shlib_tests]} {
return 0
# This file was written by Michael Snyder (msnyder@cygnus.com)
-load_lib "trace-support.exp";
+load_lib "trace-support.exp"
gdb_exit
# define relative source line numbers:
# all subsequent line numbers are relative to this first one (baseline)
-set baseline [gdb_find_recursion_test_baseline $srcfile];
+set baseline [gdb_find_recursion_test_baseline $srcfile]
if { $baseline == -1 } then {
fail "Could not find gdb_recursion_test function"
- return;
+ return
}
set testline1 [expr $baseline + 4]
# 3.2 delete tracepoint <n>
gdb_delete_tracepoints
-set trcpt1 [gdb_gettpnum gdb_c_test];
-set trcpt2 [gdb_gettpnum gdb_asm_test];
-set trcpt3 [gdb_gettpnum $testline1];
+set trcpt1 [gdb_gettpnum gdb_c_test]
+set trcpt2 [gdb_gettpnum gdb_asm_test]
+set trcpt3 [gdb_gettpnum $testline1]
if { $trcpt1 <= 0 || $trcpt2 <= 0 || $trcpt3 <= 0 } then {
fail "setting tracepoints"
- return;
+ return
}
gdb_test "info tracepoints" \
# 3.3 delete three tracepoints at once
gdb_delete_tracepoints
-set trcpt1 [gdb_gettpnum gdb_c_test];
-set trcpt2 [gdb_gettpnum gdb_asm_test];
-set trcpt3 [gdb_gettpnum $testline1];
+set trcpt1 [gdb_gettpnum gdb_c_test]
+set trcpt2 [gdb_gettpnum gdb_asm_test]
+set trcpt3 [gdb_gettpnum $testline1]
if { $trcpt1 <= 0 || $trcpt2 <= 0 || $trcpt3 <= 0 } then {
fail "setting tracepoints"
- return;
+ return
}
gdb_test "info tracepoints" \
# Test of disconnected-tracing.
-load_lib "trace-support.exp";
+load_lib "trace-support.exp"
standard_testfile
set executable $testfile
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-load_lib "trace-support.exp";
+load_lib "trace-support.exp"
standard_testfile
set executable $testfile
# This file was written by Michael Snyder (msnyder@cygnus.com)
-load_lib "trace-support.exp";
+load_lib "trace-support.exp"
gdb_exit
#
gdb_delete_tracepoints
-set c_test_num [gdb_gettpnum gdb_c_test];
-set asm_test_num [gdb_gettpnum gdb_asm_test];
+set c_test_num [gdb_gettpnum gdb_c_test]
+set asm_test_num [gdb_gettpnum gdb_asm_test]
if { $c_test_num <= 0 || $asm_test_num <= 0 } then {
fail "setting tracepoints"
- return;
+ return
}
# 2.1 info tracepoints (all)
# This file was written by Michael Snyder (msnyder@cygnus.com)
-load_lib "trace-support.exp";
+load_lib "trace-support.exp"
gdb_exit
# test passcount dynamically (live target)
#
-set baseline [gdb_find_recursion_test_baseline $srcfile];
+set baseline [gdb_find_recursion_test_baseline $srcfile]
if { $baseline == -1 } then {
fail "Could not find gdb_recursion_test function"
- return;
+ return
}
# define relative source line numbers:
set tdp4 [gdb_gettpnum "$testline4"]
if { $tdp2 <= 0 || $tdp3 <= 0 || $tdp4 <= 0 } then {
fail "setting tracepoints"
- return;
+ return
}
gdb_test "passcount 4 $tdp2" "Setting tracepoint $tdp2's passcount to 4" \
# This file was written by Michael Snyder (msnyder@cygnus.com)
-load_lib "trace-support.exp";
+load_lib "trace-support.exp"
gdb_exit
# define relative source line numbers:
# all subsequent line numbers are relative to this first one (baseline)
-set baseline [gdb_find_recursion_test_baseline $srcfile];
+set baseline [gdb_find_recursion_test_baseline $srcfile]
if { $baseline == -1 } then {
fail "Could not find gdb_recursion_test function"
- return;
+ return
}
set testline1 [expr $baseline + 3]
#
gdb_delete_tracepoints
-set trcpt1 [gdb_gettpnum gdb_c_test];
-set trcpt2 [gdb_gettpnum gdb_asm_test];
-set trcpt3 [gdb_gettpnum $testline1];
+set trcpt1 [gdb_gettpnum gdb_c_test]
+set trcpt2 [gdb_gettpnum gdb_asm_test]
+set trcpt3 [gdb_gettpnum $testline1]
if { $trcpt1 <= 0 || $trcpt2 <= 0 || $trcpt3 <= 0 } then {
fail "setting tracepoints"
- return;
+ return
}
# 4.1 passcount of specified tracepoint
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-load_lib "trace-support.exp";
+load_lib "trace-support.exp"
if {[skip_shlib_tests]} {
return 0
if ![gdb_target_supports_trace] {
unsupported "Current target does not support trace"
- return -1;
+ return -1
}
# Run a trace session, stop it, and then inspect the resulting trace
if ![gdb_target_supports_trace] {
unsupported "target does not support trace"
- return -1;
+ return -1
}
# Check that range stepping works well with tracepoints.
# This file was written by Michael Snyder (msnyder@cygnus.com)
-load_lib "trace-support.exp";
+load_lib "trace-support.exp"
gdb_exit
set arg5 5
set arg6 6
-set gdb_recursion_test_baseline [gdb_find_recursion_test_baseline $srcfile];
+set gdb_recursion_test_baseline [gdb_find_recursion_test_baseline $srcfile]
if { $gdb_recursion_test_baseline == -1 } {
fail "Could not find gdb_recursion_test function"
- return;
+ return
}
set return_me 0
if { $tdp1 <= 0 || $tdp2 <= 0 || $tdp3 <= 0 || \
$tdp4 <= 0 || $tdp5 <= 0 || $tdp6 <= 0 } then {
fail "setting tracepoints failed"
- return;
+ return
}
gdb_trace_setactions "9.x: setup TP to collect regs" \
# This file was written by Michael Snyder (msnyder@cygnus.com)
-load_lib "trace-support.exp";
+load_lib "trace-support.exp"
gdb_exit
# define relative source line numbers:
# all subsequent line numbers are relative to this first one (baseline)
-set baseline [gdb_find_recursion_test_baseline $srcfile];
+set baseline [gdb_find_recursion_test_baseline $srcfile]
if { $baseline == -1 } then {
fail "Could not find gdb_recursion_test function"
- return;
+ return
}
set testline1 [expr $baseline + 4]
gdb_delete_tracepoints
foreach x { 1 2 3 4 5 6 } {
- set testline [expr \$testline$x];
- set trcpt [gdb_gettpnum $testline];
- set trcpt$x $trcpt;
+ set testline [expr \$testline$x]
+ set trcpt [gdb_gettpnum $testline]
+ set trcpt$x $trcpt
gdb_test "passcount $x" \
"Setting tracepoint $trcpt.* to $x" \
"10.x: set passcount for tracepoint $trcpt"
"10: set default-collect"
proc gdb_verify_tracepoints { testname } {
- global gdb_prompt;
+ global gdb_prompt
set ws "\[\t \]+"
set nl "\[\r\n\]+"
- set ourstate 1;
- set result "pass";
+ set ourstate 1
+ set result "pass"
gdb_test_multiple "info tracepoints" "$testname" {
-re "\[0-9\]+\[\t \]+tracepoint\[\t \]+keep y\[\t \]+0x\[0-9a-fA-F\]+ in gdb_recursion_test\[^\r\n\]+\r\n\[ \t]+trace only if \[0-9\] - 1 == \[0-9\] / 2" {
# if { $expect_out(1,string) != $ourstate } {
-# set result "fail";
+# set result "fail"
# }
- incr ourstate;
- exp_continue;
+ incr ourstate
+ exp_continue
}
-re "$gdb_prompt $" {
if { $ourstate >= 6 } {
- set result "pass";
+ set result "pass"
} else {
- set result "fail";
+ set result "fail"
}
}
default {
- set result "fail";
+ set result "fail"
}
}
- $result $testname;
+ $result $testname
gdb_test "show default-collect" \
"The list of expressions to collect by default is \"gdb_char_test, gdb_long_test - 100\"..*" \
"10: show default-collect"
}
-gdb_verify_tracepoints "10.x: verify trace setup";
+gdb_verify_tracepoints "10.x: verify trace setup"
# 10.1 Save current tracepoint definitions to a file
gdb_test "source savetrace.tr" \
"Tracepoint \[0-9\]+ at .*" \
"10.2: read back saved tracepoints"
-gdb_verify_tracepoints "10.2: verify recovered tracepoints";
+gdb_verify_tracepoints "10.2: verify recovered tracepoints"
remote_file host delete savetrace.tr
# 10.3 repeat with a path to the file
gdb_test "source $trace_file_name" \
"Tracepoint \[0-9\]+ at .*" \
"10.4: read saved tracepoints, full path"
-gdb_verify_tracepoints "10.3: verify recovered tracepoints, full path";
+gdb_verify_tracepoints "10.3: verify recovered tracepoints, full path"
remote_file host delete $trace_file_name
# 10.5 invalid filename
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-load_lib "trace-support.exp";
+load_lib "trace-support.exp"
standard_testfile
set executable $testfile
if ![gdb_target_supports_trace] {
unsupported "target does not support trace"
- return -1
+ return -1
}
# Verify that the sequence of commands "tstart tstop tstart" works well.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-load_lib "trace-support.exp";
+load_lib "trace-support.exp"
if {[skip_shlib_tests]} {
return 0
# ability to generate synthetic trace files directly, and the tfile
# target is available to all GDB configs.
-load_lib "trace-support.exp";
+load_lib "trace-support.exp"
gdb_exit
gdb_start
# This file was written by Michael Snyder (msnyder@cygnus.com)
-load_lib "trace-support.exp";
+load_lib "trace-support.exp"
gdb_exit
# define relative source line numbers:
# all subsequent line numbers are relative to this first one (baseline)
-set baseline [gdb_find_recursion_test_baseline $srcfile];
+set baseline [gdb_find_recursion_test_baseline $srcfile]
if { $baseline == -1 } then {
fail "Could not find gdb_recursion_test function"
- return;
+ return
}
set testline1 [expr $baseline + 1]
if { $tdp1 <= 0 || $tdp2 <= 0 || $tdp3 <= 0 || \
$tdp4 <= 0 || $tdp5 <= 0 } then {
fail "setting tracepoints"
- return;
+ return
}
# 6.1 test tstart command
"test tstatus off after tstop"
## record starting PC
-set save_pc [gdb_readexpr "(unsigned long) \$pc"];
+set save_pc [gdb_readexpr "(unsigned long) \$pc"]
if { $save_pc == -1 } then {
fail "could not read PC"
- return;
+ return
}
# 8.7 tfind start
## check $trace_frame == 0
-gdb_tfind_test "8.7: tfind start command" "start" "0";
+gdb_tfind_test "8.7: tfind start command" "start" "0"
## check $pc != startPC
gdb_test "printf \"x \%d x\\n\", \$pc != $save_pc" \
"x 1 x" \
# 8.8 tfind none
## check $trace_frame == -1
-gdb_tfind_test "8.8: tfind none" "none" "-1";
+gdb_tfind_test "8.8: tfind none" "none" "-1"
## check $pc == startPC
gdb_test "printf \"x \%d x\\n\", \$pc == $save_pc" \
"x 1 x" \
# 8.9 tfind end
## check $trace_frame == -1
-gdb_tfind_test "8.9: tfind end, selects no frame" "end" "-1";
+gdb_tfind_test "8.9: tfind end, selects no frame" "end" "-1"
## check $pc == startPC
gdb_test "printf \"x \%d x\\n\", \$pc == $save_pc" \
"x 1 x" \
# 8.10 tfind <no arg>
## check $trace_frame += 1
-gdb_tfind_test "8.10: tfind start" "start" "0";
+gdb_tfind_test "8.10: tfind start" "start" "0"
gdb_test "print \$trace_line" "$baseline" \
"8.10: tfind 0 (correct line $baseline)"
-gdb_tfind_test "8.10: tfind noargument 1" "" "1";
+gdb_tfind_test "8.10: tfind noargument 1" "" "1"
gdb_test "print \$trace_line" "$testline2" \
"8.10: tfind 1 (correct line $testline2)"
-gdb_tfind_test "8.10: tfind noargument 2" "" "2";
+gdb_tfind_test "8.10: tfind noargument 2" "" "2"
gdb_test "print \$trace_line" "$testline3" \
"8.10: tfind 2 (correct line $testline3)"
-gdb_tfind_test "8.10: tfind noargument 3" "" "3";
+gdb_tfind_test "8.10: tfind noargument 3" "" "3"
gdb_test "print \$trace_line" "$testline4" \
"8.10: tfind 3 (correct line $testline4)"
-gdb_tfind_test "8.11: tfind 3" "3" "3";
+gdb_tfind_test "8.11: tfind 3" "3" "3"
gdb_test "print \$trace_line" "$testline4" \
"8.11: tfind 3 (correct line $testline4)"
-gdb_tfind_test "8.11: tfind backward 2" "-" "2";
+gdb_tfind_test "8.11: tfind backward 2" "-" "2"
gdb_test "print \$trace_line" "$testline3" \
"8.11: tfind 2 (correct line $testline3)"
-gdb_tfind_test "8.11: tfind backward 1" "-" "1";
+gdb_tfind_test "8.11: tfind backward 1" "-" "1"
gdb_test "print \$trace_line" "$testline2" \
"8.11: tfind 1 (correct line $testline2)"
-gdb_tfind_test "8.11: tfind backward 0" "-" "0";
+gdb_tfind_test "8.11: tfind backward 0" "-" "0"
gdb_test "print \$trace_line" "$baseline" \
"8.11: tfind 0 (correct line $baseline)"
-gdb_tfind_test "8.12: tfind none" "none" "-1";
+gdb_tfind_test "8.12: tfind none" "none" "-1"
gdb_tfind_test "8.12: tfind tracepoint <n>" "tracepoint $tdp2" \
- "\$tracepoint" "$tdp2";
+ "\$tracepoint" "$tdp2"
gdb_test "print \$trace_line" "$testline2" \
"8.12: tfind tracepoint <n> (line $testline2)"
-gdb_tfind_test "8.25: tfind none" "none" "-1";
+gdb_tfind_test "8.25: tfind none" "none" "-1"
gdb_test "tfind tracepoint 0" "failed to find.*" \
"8.25: tfind tracepoint rejects zero"
gdb_test "tfind tracepoint 32767" "failed to find.*" \
# 8.37 tfind tracepoint n where n no longer exists (but used to)
gdb_test_no_output "delete trace $tdp2" ""
-gdb_tfind_test "8.37: tfind none" "none" "-1";
+gdb_tfind_test "8.37: tfind none" "none" "-1"
gdb_tfind_test "8.37: tfind deleted tracepoint" \
"tracepoint $tdp2" \
- "\$tracepoint" "$tdp2";
+ "\$tracepoint" "$tdp2"
gdb_test "print \$trace_line" "$testline2" \
"8.37: tfind deleted tracepoint (line $testline2)"
# 8.13 tfind tracepoint <no arg>
## check $tracepoint same before and after, $trace_frame changed
-gdb_tfind_test "8.13: tfind none" "none" "-1";
+gdb_tfind_test "8.13: tfind none" "none" "-1"
gdb_tfind_test "8.13: tracepoint $tdp1" "tracepoint $tdp1" \
- "\$tracepoint" "$tdp1";
+ "\$tracepoint" "$tdp1"
gdb_test "print \$trace_line" "$baseline" \
"8.13: tfind tracepoint $tdp1 (line $baseline)"
gdb_test_no_output "set \$save_frame = \$trace_frame" ""
gdb_tfind_test "8.13: tracepoint <no arg>" "tracepoint" \
- "\$tracepoint" "$tdp1";
+ "\$tracepoint" "$tdp1"
gdb_test "printf \"x \%d x\\n\", \$trace_frame == \$save_frame" \
"x 0 x" \
"8.13: tracepoint <no arg>, tracepoint number unchanged"
gdb_test_no_output "set \$test_pc = \$pc" ""
gdb_tfind_test "8.14: tfind none" "none" "-1"
-gdb_tfind_test "8.14: tfind pc" "pc \$test_pc" "\$trace_frame != -1" "1";
+gdb_tfind_test "8.14: tfind pc" "pc \$test_pc" "\$trace_frame != -1" "1"
gdb_test "print \$trace_line" "$testline4" \
"8.14: tfind pc x (line $testline4)"
gdb_test "printf \"x \%d x\\n\", \$pc == \$test_pc" \
gdb_test "tfind line 0" \
"out of range.*|failed to find.*|No line 0 in .*" \
- "8.18: tfind line 0";
+ "8.18: tfind line 0"
gdb_test "tfind line 32767" \
"out of range.*|failed to find.*|No line 32767 in .*" \
- "8.27: tfind line 32767";
+ "8.27: tfind line 32767"
gdb_test "tfind line NoSuChFiLe.c:$baseline" \
"No source file named.*" \
- "8.27: tfind line in bad source file";
+ "8.27: tfind line in bad source file"
# 8.32 tfind invalid subcommand (tfind foo)
## check error
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-load_lib "trace-support.exp";
+load_lib "trace-support.exp"
standard_testfile
set executable $testfile
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-load_lib "trace-support.exp";
+load_lib "trace-support.exp"
standard_testfile
set executable $testfile
# This file was written by Michael Snyder (msnyder@cygnus.com)
-load_lib "trace-support.exp";
+load_lib "trace-support.exp"
gdb_exit
# define relative source line numbers:
# all subsequent line numbers are relative to this first one (baseline)
-set baseline [gdb_find_recursion_test_baseline $srcfile];
+set baseline [gdb_find_recursion_test_baseline $srcfile]
if { $baseline == -1 } then {
fail "Could not find gdb_recursion_test function"
- return;
+ return
}
set testline1 [expr $baseline + 1]
# test "help tracepoints"
#
-set helpcnt 0;
+set helpcnt 0
test_class_help "tracepoints" {
"Tracing of program execution without stopping the program\.[\r\n\]+"
} "1.0: help tracepoints"
gdb_delete_tracepoints
- gdb_test "print iters = init_iters" ".* = .*";
+ gdb_test "print iters = init_iters" ".* = .*"
set testline [gdb_get_line_number "set tracepoint here"]
gdb_delete_tracepoints
- gdb_test "print iters = init_iters" ".* = .*";
+ gdb_test "print iters = init_iters" ".* = .*"
set run_ftrace 0
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-load_lib "trace-support.exp";
+load_lib "trace-support.exp"
gdb_exit
}
gdb_delete_tracepoints
-set trcpt1 [gdb_gettpnum gdb_c_test];
+set trcpt1 [gdb_gettpnum gdb_c_test]
if { $trcpt1 <= 0 } then {
fail "setting tracepoints"
- return;
+ return
}
gdb_test "tvariable \$tvar5 = 15" \
# This file was written by Michael Snyder (msnyder@cygnus.com)
-load_lib "trace-support.exp";
+load_lib "trace-support.exp"
gdb_exit
set trcpt1 [gdb_gettpnum gdb_c_test]
if { $trcpt1 <= 0 } then {
fail "Could not find gdb_c_test function"
- return;
+ return
}
# 5.12 basic while-stepping command (collect regs)
# [deferred to dynamic test section]
proc while_stepping_bogus_arg { bogus msgstring } {
- global gdb_prompt;
+ global gdb_prompt
gdb_trace_setactions "$msgstring" \
"" \
global GDB
if [info exists TOOL_EXECUTABLE] {
- set GDB $TOOL_EXECUTABLE;
+ set GDB $TOOL_EXECUTABLE
}
if ![info exists GDB] {
if ![is_remote host] {
set GDB [findfile $base_dir/../../gdb/gdb "$base_dir/../../gdb/gdb" [transform gdb]]
} else {
- set GDB [transform gdb];
+ set GDB [transform gdb]
}
}
verbose "using GDB = $GDB" 2
global INTERNAL_GDBFLAGS GDBFLAGS
global gdb_prompt
set output [remote_exec host "$GDB $INTERNAL_GDBFLAGS --version"]
- set tmp [lindex $output 1];
+ set tmp [lindex $output 1]
set version ""
regexp " \[0-9\]\[^ \t\n\r\]+" "$tmp" version
if ![is_remote host] {
send_gdb "delete breakpoints\n"
gdb_expect 100 {
-re "Delete all breakpoints.*y or n.*$" {
- send_gdb "y\n";
+ send_gdb "y\n"
exp_continue
}
-re "$gdb_prompt $" { # This happens if there were no breakpoints
-re "No breakpoints or watchpoints..*$gdb_prompt $" {}
-re "$gdb_prompt $" { perror "breakpoints not deleted" ; return }
-re "Delete all breakpoints.*or n.*$" {
- send_gdb "y\n";
+ send_gdb "y\n"
exp_continue
}
timeout { perror "info breakpoints (timeout)" ; return }
global gdb_prompt use_gdb_stub
if [target_info exists gdb_init_command] {
- send_gdb "[target_info gdb_init_command]\n";
+ send_gdb "[target_info gdb_init_command]\n"
gdb_expect 30 {
-re "$gdb_prompt $" { }
default {
- perror "gdb_init_command for target failed";
- return;
+ perror "gdb_init_command for target failed"
+ return
}
}
}
if $use_gdb_stub {
if [target_info exists gdb,do_reload_on_run] {
if { [gdb_reload] != 0 } {
- return;
+ return
}
- send_gdb "continue\n";
+ send_gdb "continue\n"
gdb_expect 60 {
-re "Continu\[^\r\n\]*\[\r\n\]" {}
default {}
}
- return;
+ return
}
if [target_info exists gdb,start_symbol] {
- set start [target_info gdb,start_symbol];
+ set start [target_info gdb,start_symbol]
} else {
- set start "start";
+ set start "start"
}
send_gdb "jump *$start\n"
- set start_attempt 1;
+ set start_attempt 1
while { $start_attempt } {
# Cap (re)start attempts at three to ensure that this loop
# always eventually fails. Don't worry about trying to be
# clever and not send a command when it has failed.
if [expr $start_attempt > 3] {
- perror "Jump to start() failed (retry count exceeded)";
- return;
+ perror "Jump to start() failed (retry count exceeded)"
+ return
}
- set start_attempt [expr $start_attempt + 1];
+ set start_attempt [expr $start_attempt + 1]
gdb_expect 30 {
-re "Continuing at \[^\r\n\]*\[\r\n\]" {
- set start_attempt 0;
+ set start_attempt 0
}
-re "No symbol \"_start\" in current.*$gdb_prompt $" {
- perror "Can't find start symbol to run in gdb_run";
- return;
+ perror "Can't find start symbol to run in gdb_run"
+ return
}
-re "No symbol \"start\" in current.*$gdb_prompt $" {
- send_gdb "jump *_start\n";
+ send_gdb "jump *_start\n"
}
-re "No symbol.*context.*$gdb_prompt $" {
- set start_attempt 0;
+ set start_attempt 0
}
-re "Line.* Jump anyway.*y or n. $" {
send_gdb "y\n"
}
-re "The program is not being run.*$gdb_prompt $" {
if { [gdb_reload] != 0 } {
- return;
+ return
}
- send_gdb "jump *$start\n";
+ send_gdb "jump *$start\n"
}
timeout {
- perror "Jump to start() failed (timeout)";
+ perror "Jump to start() failed (timeout)"
return
}
}
if [target_info exists gdb,do_reload_on_run] {
if { [gdb_reload] != 0 } {
- return;
+ return
}
}
send_gdb "run $args\n"
global gdb_prompt use_gdb_stub
if [target_info exists gdb_init_command] {
- send_gdb "[target_info gdb_init_command]\n";
+ send_gdb "[target_info gdb_init_command]\n"
gdb_expect 30 {
-re "$gdb_prompt $" { }
default {
- perror "gdb_init_command for target failed";
+ perror "gdb_init_command for target failed"
return -1
}
}
}
set result -1
- set string "${command}\n";
+ set string "${command}\n"
if { $command != "" } {
set multi_line_re "\[\r\n\] *>"
while { "$string" != "" } {
- set foo [string first "\n" "$string"];
- set len [string length "$string"];
+ set foo [string first "\n" "$string"]
+ set len [string length "$string"]
if { $foo < [expr $len - 1] } {
- set str [string range "$string" 0 $foo];
+ set str [string range "$string" 0 $foo]
if { [send_gdb "$str"] != "" } {
- global suppress_flag;
+ global suppress_flag
if { ! $suppress_flag } {
- perror "Couldn't send $command to GDB.";
+ perror "Couldn't send $command to GDB."
}
- fail "$message";
+ fail "$message"
return $result
}
# since we're checking if each line of the multi-line
-notransfer -re "$multi_line_re$" { verbose "partial: match" 3 }
timeout { verbose "partial: timeout" 3 }
}
- set string [string range "$string" [expr $foo + 1] end];
+ set string [string range "$string" [expr $foo + 1] end]
set multi_line_re "$multi_line_re.*\[\r\n\] *>"
} else {
- break;
+ break
}
}
if { "$string" != "" } {
if { [send_gdb "$string"] != "" } {
- global suppress_flag;
+ global suppress_flag
if { ! $suppress_flag } {
- perror "Couldn't send $command to GDB.";
+ perror "Couldn't send $command to GDB."
}
- fail "$message";
+ fail "$message"
return $result
}
}
}
if [target_info exists gdb,timeout] {
- set tmt [target_info gdb,timeout];
+ set tmt [target_info gdb,timeout]
} else {
if [info exists timeout] {
- set tmt $timeout;
+ set tmt $timeout
} else {
- global timeout;
+ global timeout
if [info exists timeout] {
- set tmt $timeout;
+ set tmt $timeout
} else {
- set tmt 60;
+ set tmt 60
}
}
}
}
-re "\\*\\*\\* DOSEXIT code.*" {
if { $message != "" } {
- fail "$message";
+ fail "$message"
}
- gdb_suppress_entire_file "GDB died";
- set result -1;
+ gdb_suppress_entire_file "GDB died"
+ set result -1
}
}
append code $processed_code
set result 0
set code [catch {gdb_expect $tmt $code} string]
if {$code == 1} {
- global errorInfo errorCode;
+ global errorInfo errorCode
return -code error -errorinfo $errorInfo -errorcode $errorCode $string
} elseif {$code > 1} {
return -code $code $string
set pattern [lindex $args 1]
if [llength $args]==5 {
- set question_string [lindex $args 3];
- set response_string [lindex $args 4];
+ set question_string [lindex $args 3]
+ set response_string [lindex $args 4]
} else {
set question_string "^FOOBAR$"
}
}
}
-re "(${question_string})$" {
- send_gdb "$response_string\n";
- exp_continue;
+ send_gdb "$response_string\n"
+ exp_continue
}
}]
}
global GDB
global INTERNAL_GDBFLAGS GDBFLAGS
global verbose
- global gdb_spawn_id;
+ global gdb_spawn_id
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
if ![info exists gdb_spawn_id] {
- return;
+ return
}
verbose "Quitting $GDB $INTERNAL_GDBFLAGS $GDBFLAGS"
if { [is_remote host] && [board_info host exists fileid] } {
- send_gdb "quit\n";
+ send_gdb "quit\n"
gdb_expect 10 {
-re "y or n" {
- send_gdb "y\n";
- exp_continue;
+ send_gdb "y\n"
+ exp_continue
}
-re "DOSEXIT code" { }
default { }
}
if ![is_remote host] {
- remote_close host;
+ remote_close host
}
unset gdb_spawn_id
}
global INTERNAL_GDBFLAGS GDBFLAGS
global gdb_prompt
global timeout
- global gdb_spawn_id;
+ global gdb_spawn_id
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
# Set the default value, it may be overriden later by specific testfile.
#
exit 1
}
}
- set res [remote_spawn host "$GDB $INTERNAL_GDBFLAGS $GDBFLAGS [host_info gdb_opts]"];
+ set res [remote_spawn host "$GDB $INTERNAL_GDBFLAGS $GDBFLAGS [host_info gdb_opts]"]
if { $res < 0 || $res == "" } {
perror "Spawning $GDB failed."
return 1
}
timeout {
perror "(timeout) GDB never initialized after 10 seconds."
- remote_close host;
+ remote_close host
return -1
}
}
- set gdb_spawn_id -1;
+ set gdb_spawn_id -1
# force the height to "unlimited", so no pagers get used
send_gdb "set height 0\n"
set gdb_wrapper_target ""
proc gdb_wrapper_init { args } {
- global gdb_wrapper_initialized;
- global gdb_wrapper_file;
- global gdb_wrapper_flags;
+ global gdb_wrapper_initialized
+ global gdb_wrapper_file
+ global gdb_wrapper_flags
global gdb_wrapper_target
if { $gdb_wrapper_initialized == 1 } { return; }
if {[target_info exists needs_status_wrapper] && \
[target_info needs_status_wrapper] != "0"} {
- set result [build_wrapper "testglue.o"];
+ set result [build_wrapper "testglue.o"]
if { $result != "" } {
- set gdb_wrapper_file [lindex $result 0];
- set gdb_wrapper_flags [lindex $result 1];
+ set gdb_wrapper_file [lindex $result 0]
+ set gdb_wrapper_flags [lindex $result 1]
} else {
warning "Status wrapper failed to build."
}
set gdb_saved_set_unbuffered_mode_obj ""
proc gdb_compile {source dest type options} {
- global GDB_TESTCASE_OPTIONS;
- global gdb_wrapper_file;
- global gdb_wrapper_flags;
- global gdb_wrapper_initialized;
+ global GDB_TESTCASE_OPTIONS
+ global gdb_wrapper_file
+ global gdb_wrapper_flags
+ global gdb_wrapper_initialized
global srcdir
global objdir
global gdb_saved_set_unbuffered_mode_obj
set options [concat $options2 $options]
}
if [info exists GDB_TESTCASE_OPTIONS] {
- lappend options "additional_flags=$GDB_TESTCASE_OPTIONS";
+ lappend options "additional_flags=$GDB_TESTCASE_OPTIONS"
}
verbose "options are $options"
verbose "source is $source $dest $type $options"
}
}
- set result [target_compile $source $dest $type $options];
+ set result [target_compile $source $dest $type $options]
# Prune uninteresting compiler (and linker) output.
regsub "Creating library file: \[^\r\n\]*\[\r\n\]+" $result "" result
- regsub "\[\r\n\]*$" "$result" "" result;
- regsub "^\[\r\n\]*" "$result" "" result;
+ regsub "\[\r\n\]*$" "$result" "" result
+ regsub "^\[\r\n\]*" "$result" "" result
if {[lsearch $options quiet] < 0} {
# We shall update this on a per language basis, to avoid
}
proc send_gdb { string } {
- global suppress_flag;
+ global suppress_flag
if { $suppress_flag } {
return "suppressed"
}
proc gdb_expect { args } {
if { [llength $args] == 2 && [lindex $args 0] != "-re" } {
- set atimeout [lindex $args 0];
- set expcode [list [lindex $args 1]];
+ set atimeout [lindex $args 0]
+ set expcode [list [lindex $args 1]]
} else {
- set expcode $args;
+ set expcode $args
}
- upvar timeout timeout;
+ upvar timeout timeout
if [target_info exists gdb,timeout] {
if [info exists timeout] {
if { $timeout < [target_info gdb,timeout] } {
- set gtimeout [target_info gdb,timeout];
+ set gtimeout [target_info gdb,timeout]
} else {
- set gtimeout $timeout;
+ set gtimeout $timeout
}
} else {
- set gtimeout [target_info gdb,timeout];
+ set gtimeout [target_info gdb,timeout]
}
}
if ![info exists gtimeout] {
- global timeout;
+ global timeout
if [info exists timeout] {
- set gtimeout $timeout;
+ set gtimeout $timeout
}
}
if [info exists atimeout] {
if { ![info exists gtimeout] || $gtimeout < $atimeout } {
- set gtimeout $atimeout;
+ set gtimeout $atimeout
}
} else {
if ![info exists gtimeout] {
# Eeeeew.
- set gtimeout 60;
+ set gtimeout 60
}
}
- global suppress_flag;
- global remote_suppress_flag;
+ global suppress_flag
+ global remote_suppress_flag
if [info exists remote_suppress_flag] {
- set old_val $remote_suppress_flag;
+ set old_val $remote_suppress_flag
}
if [info exists suppress_flag] {
if { $suppress_flag } {
- set remote_suppress_flag 1;
+ set remote_suppress_flag 1
}
}
set code [catch \
- {uplevel remote_expect host $gtimeout $expcode} string];
+ {uplevel remote_expect host $gtimeout $expcode} string]
if [info exists old_val] {
- set remote_suppress_flag $old_val;
+ set remote_suppress_flag $old_val
} else {
if [info exists remote_suppress_flag] {
- unset remote_suppress_flag;
+ unset remote_suppress_flag
}
}
if {$code == 1} {
- global errorInfo errorCode;
+ global errorInfo errorCode
return -code error -errorinfo $errorInfo -errorcode $errorCode $string
} else {
#
#
proc gdb_suppress_entire_file { reason } {
- global suppress_flag;
+ global suppress_flag
- warning "$reason\n";
- set suppress_flag -1;
+ warning "$reason\n"
+ set suppress_flag -1
}
#
# gdb_stop_suppressing_tests).
#
proc gdb_suppress_tests { args } {
- global suppress_flag;
+ global suppress_flag
return; # fnf - disable pending review of results where
# testsuite ran better without this
- incr suppress_flag;
+ incr suppress_flag
if { $suppress_flag == 1 } {
if { [llength $args] > 0 } {
- warning "[lindex $args 0]\n";
+ warning "[lindex $args 0]\n"
} else {
- warning "Because of previous failure, all subsequent tests in this group will automatically fail.\n";
+ warning "Because of previous failure, all subsequent tests in this group will automatically fail.\n"
}
}
}
# Clear suppress_flag.
#
proc gdb_stop_suppressing_tests { } {
- global suppress_flag;
+ global suppress_flag
if [info exists suppress_flag] {
if { $suppress_flag > 0 } {
- set suppress_flag 0;
- clone_output "Tests restarted.\n";
+ set suppress_flag 0
+ clone_output "Tests restarted.\n"
}
} else {
- set suppress_flag 0;
+ set suppress_flag 0
}
}
proc gdb_clear_suppressed { } {
- global suppress_flag;
+ global suppress_flag
- set suppress_flag 0;
+ set suppress_flag 0
}
proc gdb_start { } {
set cleanfiles {}
- gdb_clear_suppressed;
+ gdb_clear_suppressed
set gdb_test_file_name [file rootname [file tail [lindex $args 0]]]
if { [llength $args] > 0 } {
global pf_prefix
- set file [lindex $args 0];
+ set file [lindex $args 0]
- set pf_prefix "[file tail [file dirname $file]]/[file tail $file]:";
+ set pf_prefix "[file tail [file dirname $file]]/[file tail $file]:"
}
- global gdb_prompt;
+ global gdb_prompt
if [target_info exists gdb_prompt] {
- set gdb_prompt [target_info gdb_prompt];
+ set gdb_prompt [target_info gdb_prompt]
} else {
set gdb_prompt "\\(gdb\\)"
}
# expected to fail, 0 otherwise (or if it is unknown). Must have
# previously called get_debug_format.
proc setup_xfail_format { format } {
- set ret [test_debug_format $format];
+ set ret [test_debug_format $format]
if {$ret} then {
setup_xfail "*-*-*"
proc gdb_skip_float_test { msg } {
if [target_info exists gdb,skip_float_tests] {
- verbose "Skipping test '$msg': no float tests.";
+ verbose "Skipping test '$msg': no float tests."
return 1
}
return 0
proc gdb_skip_stdio_test { msg } {
if [target_info exists gdb,noinferiorio] {
- verbose "Skipping test '$msg': no inferior i/o.";
+ verbose "Skipping test '$msg': no inferior i/o."
return 1
}
return 0
global gdbserver_protocol
global gdbserver_gdbport
- global gdbserver_reconnect_p;
+ global gdbserver_reconnect_p
if {![info exists gdbserver_reconnect_p] || !$gdbserver_reconnect_p} {
error "gdbserver_reconnect_p is not set before gdbserver_reconnect"
return 0
# Build the status wrapper library as needed.
#
proc java_init { args } {
- global wrapper_file;
- global wrap_compile_flags;
+ global wrapper_file
+ global wrap_compile_flags
global java_initialized
global GCJ_UNDER_TEST
global TOOL_EXECUTABLE
if ![info exists GCJ_UNDER_TEST] {
if [info exists TOOL_EXECUTABLE] {
- set GCJ_UNDER_TEST $TOOL_EXECUTABLE;
+ set GCJ_UNDER_TEST $TOOL_EXECUTABLE
} else {
if { [info exists env(GCJ)] && $env(GCJ) != "" } {
set GCJ_UNDER_TEST $env(GCJ)
global target_alias
if ![is_remote host] {
- set file [lookfor_file $tool_root_dir gcj];
+ set file [lookfor_file $tool_root_dir gcj]
if { $file == "" } {
- set file [lookfor_file $tool_root_dir gcc/gcj];
+ set file [lookfor_file $tool_root_dir gcc/gcj]
}
if { $file != "" } {
- set CC "$file -B[file dirname $file]/ --specs=$tool_root_dir/$target_alias/libjava/libgcj-test.spec";
+ set CC "$file -B[file dirname $file]/ --specs=$tool_root_dir/$target_alias/libjava/libgcj-test.spec"
} else {
- set CC [transform gcj];
+ set CC [transform gcj]
}
} else {
set CC [transform gcj]
}
}
- set wrapper_file "";
- set wrap_compile_flags "";
+ set wrapper_file ""
+ set wrap_compile_flags ""
if [target_info exists needs_status_wrapper] {
- set result [build_wrapper "testglue.o"];
+ set result [build_wrapper "testglue.o"]
if { $result != "" } {
- set wrapper_file [lindex $result 0];
- set wrap_compile_flags [lindex $result 1];
+ set wrapper_file [lindex $result 0]
+ set wrap_compile_flags [lindex $result 1]
} else {
warning "Status wrapper failed to build."
}
global GDB
global INTERNAL_GDBFLAGS GDBFLAGS
global verbose
- global gdb_spawn_id;
+ global gdb_spawn_id
global gdb_prompt
global mi_gdb_prompt
global MIFLAGS
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
if { [info procs sid_exit] != "" } {
sid_exit
}
if ![info exists gdb_spawn_id] {
- return;
+ return
}
verbose "Quitting $GDB $INTERNAL_GDBFLAGS $GDBFLAGS $MIFLAGS"
if { [is_remote host] && [board_info host exists fileid] } {
- send_gdb "999-gdb-exit\n";
+ send_gdb "999-gdb-exit\n"
gdb_expect 10 {
-re "y or n" {
- send_gdb "y\n";
- exp_continue;
+ send_gdb "y\n"
+ exp_continue
}
-re "Undefined command.*$gdb_prompt $" {
send_gdb "quit\n"
- exp_continue;
+ exp_continue
}
-re "DOSEXIT code" { }
default { }
}
if ![is_remote host] {
- remote_close host;
+ remote_close host
}
unset gdb_spawn_id
}
global gdb_prompt
global mi_gdb_prompt
global timeout
- global gdb_spawn_id;
+ global gdb_spawn_id
global MIFLAGS
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
set inferior_pty no-tty
# Set the default value, it may be overriden later by specific testfile.
set mi_inferior_tty_name $spawn_out(slave,name)
}
- set res [remote_spawn host "$GDB $INTERNAL_GDBFLAGS $GDBFLAGS $MIFLAGS [host_info gdb_opts]"];
+ set res [remote_spawn host "$GDB $INTERNAL_GDBFLAGS $GDBFLAGS $MIFLAGS [host_info gdb_opts]"]
if { $res < 0 || $res == "" } {
perror "Spawning $GDB failed."
return 1
# using the old-style prompt.
if { $MIFLAGS == "-i=mi1" } {
perror "(mi startup) Got unexpected new mi prompt."
- remote_close host;
+ remote_close host
return -1
}
verbose "GDB initialized."
# using the new-style prompt.
if { $MIFLAGS != "-i=mi1" } {
perror "(mi startup) Got unexpected old mi prompt."
- remote_close host;
+ remote_close host
return -1
}
verbose "GDB initialized."
}
-re ".*unrecognized option.*for a complete list of options." {
untested "Skip mi tests (not compiled with mi support)."
- remote_close host;
+ remote_close host
return -1
}
-re ".*Interpreter `mi' unrecognized." {
untested "Skip mi tests (not compiled with mi support)."
- remote_close host;
+ remote_close host
return -1
}
timeout {
perror "(timeout) GDB never initialized after 10 seconds."
- remote_close host;
+ remote_close host
return -1
}
}
- set gdb_spawn_id -1;
+ set gdb_spawn_id -1
# FIXME: mi output does not go through pagers, so these can be removed.
# force the height to "unlimited", so no pagers get used
send_gdb "102-break-delete\n"
gdb_expect 30 {
-re "Delete all breakpoints.*y or n.*$" {
- send_gdb "y\n";
+ send_gdb "y\n"
exp_continue
}
-re "102-break-delete\r\n102\\\^done\r\n$mi_gdb_prompt$" {
-re "103-break-list\r\n103\\\^doneNo breakpoints or watchpoints.\r\n\r\n$mi_gdb_prompt$" {warning "Unexpected console text received"}
-re "$mi_gdb_prompt$" { perror "Breakpoints not deleted" ; return }
-re "Delete all breakpoints.*or n.*$" {
- warning "Unexpected prompt for breakpoints deletion";
- send_gdb "y\n";
+ warning "Unexpected prompt for breakpoints deletion"
+ send_gdb "y\n"
exp_continue
}
timeout { perror "-break-list (timeout)" ; return }
send_gdb "47-target-select $targetname $serialport\n"
gdb_expect 60 {
-re "47\\^connected.*$mi_gdb_prompt" {
- verbose "Set target to $targetname";
+ verbose "Set target to $targetname"
return 0
}
-re "unknown host.*$mi_gdb_prompt" {
verbose "Couldn't look up $serialport"
}
-re "Couldn't establish connection to remote.*$mi_gdb_prompt$" {
- verbose "Connection failed";
+ verbose "Connection failed"
}
-re "Remote MIPS debugging.*$mi_gdb_prompt$" {
- verbose "Set target to $targetname";
+ verbose "Set target to $targetname"
return 0
}
-re "Remote debugging using .*$serialport_re.*$mi_gdb_prompt$" {
- verbose "Set target to $targetname";
+ verbose "Set target to $targetname"
return 0
}
-re "Remote target $targetname connected to.*$mi_gdb_prompt$" {
- verbose "Set target to $targetname";
+ verbose "Set target to $targetname"
return 0
}
-re "Connected to.*$mi_gdb_prompt$" {
- verbose "Set target to $targetname";
+ verbose "Set target to $targetname"
return 0
}
-re "Ending remote.*$mi_gdb_prompt$" { }
return 1
}
-re "Timeout reading from remote system.*$mi_gdb_prompt$" {
- verbose "Got timeout error from gdb.";
+ verbose "Got timeout error from gdb."
}
timeout {
- send_gdb "\ 3";
+ send_gdb "\ 3"
break
}
}
set last_loaded_file $arg
if [is_remote host] {
- set arg [remote_download host $arg];
+ set arg [remote_download host $arg]
if { $arg == "" } {
error "download failed"
return -1
}
if [llength $args]==5 {
- set question_string [lindex $args 3];
- set response_string [lindex $args 4];
+ set question_string [lindex $args 3]
+ set response_string [lindex $args 4]
} else {
set question_string "^FOOBAR$"
}
}
set result -1
- set string "${command}\n";
+ set string "${command}\n"
set string_regex [string_to_regexp $command]
if { $command != "" } {
while { "$string" != "" } {
- set foo [string first "\n" "$string"];
- set len [string length "$string"];
+ set foo [string first "\n" "$string"]
+ set len [string length "$string"]
if { $foo < [expr $len - 1] } {
- set str [string range "$string" 0 $foo];
+ set str [string range "$string" 0 $foo]
if { [send_gdb "$str"] != "" } {
- global suppress_flag;
+ global suppress_flag
if { ! $suppress_flag } {
- perror "Couldn't send $command to GDB.";
+ perror "Couldn't send $command to GDB."
}
- fail "$message";
+ fail "$message"
return $result
}
gdb_expect 2 {
-re "\[\r\n\]" { }
timeout { }
}
- set string [string range "$string" [expr $foo + 1] end];
+ set string [string range "$string" [expr $foo + 1] end]
} else {
- break;
+ break
}
}
if { "$string" != "" } {
if { [send_gdb "$string"] != "" } {
- global suppress_flag;
+ global suppress_flag
if { ! $suppress_flag } {
- perror "Couldn't send $command to GDB.";
+ perror "Couldn't send $command to GDB."
}
- fail "$message";
+ fail "$message"
return $result
}
}
}
if [info exists timeout] {
- set tmt $timeout;
+ set tmt $timeout
} else {
- global timeout;
+ global timeout
if [info exists timeout] {
- set tmt $timeout;
+ set tmt $timeout
} else {
- set tmt 60;
+ set tmt 60
}
}
if {$async} {
gdb_expect $tmt {
-re "\\*\\*\\* DOSEXIT code.*" {
if { $message != "" } {
- fail "$message";
+ fail "$message"
}
- gdb_suppress_entire_file "GDB died";
+ gdb_suppress_entire_file "GDB died"
return -1
}
-re "Ending remote debugging.*$mi_gdb_prompt\[ \]*$" {
set result 0
}
-re "(${question_string})$" {
- send_gdb "$response_string\n";
- exp_continue;
+ send_gdb "$response_string\n"
+ exp_continue
}
-re "Undefined.* command:.*$mi_gdb_prompt\[ \]*$" {
perror "Undefined command \"$command\"."
}
if [target_info exists gdb_init_command] {
- send_gdb "[target_info gdb_init_command]\n";
+ send_gdb "[target_info gdb_init_command]\n"
gdb_expect 30 {
-re "$mi_gdb_prompt$" { }
default {
- perror "gdb_init_command for target failed";
+ perror "gdb_init_command for target failed"
return -1
}
}
if $use_gdb_stub {
if [target_info exists gdb,do_reload_on_run] {
- send_gdb "${run_prefix}continue\n";
+ send_gdb "${run_prefix}continue\n"
gdb_expect 60 {
-re "${run_match}\\^running\[\r\n\]+\\*running,thread-id=\"\[^\"\]+\"\r\n$mi_gdb_prompt" {}
default {}
}
if [target_info exists gdb,start_symbol] {
- set start [target_info gdb,start_symbol];
+ set start [target_info gdb,start_symbol]
} else {
- set start "start";
+ set start "start"
}
# HACK: Should either use 000-jump or fix the target code
foreach i $options {
if { $i == "debug" } {
if [board_info $dest exists debug_flags] {
- append add_flags " [board_info $dest debug_flags]";
+ append add_flags " [board_info $dest debug_flags]"
} else {
append add_flags " -g"
}
foreach i $options {
if { $i == "debug" } {
if [board_info $dest exists debug_flags] {
- append add_flags " [board_info $dest debug_flags]";
+ append add_flags " [board_info $dest debug_flags]"
} else {
append add_flags " -g"
}
global gdb_prompt
global gdb_prompt_fail
global timeout
- global gdb_spawn_id;
+ global gdb_spawn_id
- gdb_stop_suppressing_tests;
+ gdb_stop_suppressing_tests
verbose "Spawning $GDB $INTERNAL_GDBFLAGS $GDBFLAGS"
exit 1
}
}
- set res [remote_spawn host "$GDB $INTERNAL_GDBFLAGS $GDBFLAGS [host_info gdb_opts]"];
+ set res [remote_spawn host "$GDB $INTERNAL_GDBFLAGS $GDBFLAGS [host_info gdb_opts]"]
if { $res < 0 || $res == "" } {
perror "Spawning $GDB failed."
return 1
}
timeout {
perror "(timeout) GDB never initialized after 10 seconds."
- remote_close host;
+ remote_close host
return -1
}
}
- set gdb_spawn_id -1;
+ set gdb_spawn_id -1
return 0
}
send_gdb "delete tracepoints\n"
gdb_expect 30 {
-re "Delete all tracepoints.*y or n.*$" {
- send_gdb "y\n";
+ send_gdb "y\n"
exp_continue
}
-re ".*$gdb_prompt $" { # This happens if there were no tracepoints }
# non-zero -- failure
proc gdb_trace_setactions_command { actions_command testname tracepoint args } {
- global gdb_prompt;
+ global gdb_prompt
- set state 0;
- set passfail "pass";
- send_gdb "$actions_command $tracepoint\n";
- set expected_result "";
+ set state 0
+ set passfail "pass"
+ send_gdb "$actions_command $tracepoint\n"
+ set expected_result ""
gdb_expect 5 {
-re "No tracepoint number .*$gdb_prompt $" {
fail $testname
}
-re "Enter actions for tracepoint $tracepoint.*>" {
if { [llength $args] > 0 } {
- set lastcommand "[lindex $args $state]";
- send_gdb "[lindex $args $state]\n";
- incr state;
- set expected_result [lindex $args $state];
- incr state;
+ set lastcommand "[lindex $args $state]"
+ send_gdb "[lindex $args $state]\n"
+ incr state
+ set expected_result [lindex $args $state]
+ incr state
} else {
- send_gdb "end\n";
+ send_gdb "end\n"
}
- exp_continue;
+ exp_continue
}
-re "\(.*\)\[\r\n\]+\[ \t]*>$" {
if { $expected_result != "" } {
- regsub "^\[^\r\n\]+\[\r\n\]+" "$expect_out(1,string)" "" out;
+ regsub "^\[^\r\n\]+\[\r\n\]+" "$expect_out(1,string)" "" out
if ![regexp $expected_result $out] {
- set passfail "fail";
+ set passfail "fail"
}
- set expected_result "";
+ set expected_result ""
}
if { $state < [llength $args] } {
- send_gdb "[lindex $args $state]\n";
- incr state;
- set expected_result [lindex $args $state];
- incr state;
+ send_gdb "[lindex $args $state]\n"
+ incr state
+ set expected_result [lindex $args $state]
+ incr state
} else {
- send_gdb "end\n";
- set expected_result "";
+ send_gdb "end\n"
+ set expected_result ""
}
- exp_continue;
+ exp_continue
}
-re "\(.*\)$gdb_prompt $" {
if { $expected_result != "" } {
if ![regexp $expected_result $expect_out(1,string)] {
- set passfail "fail";
+ set passfail "fail"
}
- set expected_result "";
+ set expected_result ""
}
if { [llength $args] < $state } {
- set passfail "fail";
+ set passfail "fail"
}
}
default {
- set passfail "fail";
+ set passfail "fail"
}
}
if { $testname != "" } {
- $passfail $testname;
+ $passfail $testname
}
if { $passfail == "pass" } then {
return 0
#
proc gdb_tfind_test { testname tfind_arg exp_res args } {
- global gdb_prompt;
+ global gdb_prompt
if { "$args" != "" } {
- set expr "$exp_res";
- set exp_res "$args";
+ set expr "$exp_res"
+ set exp_res "$args"
} else {
- set expr "(int) \$trace_frame";
+ set expr "(int) \$trace_frame"
}
- set passfail "fail";
+ set passfail "fail"
gdb_test "tfind $tfind_arg" "" ""
- send_gdb "printf \"x \%d x\\n\", $expr\n";
+ send_gdb "printf \"x \%d x\\n\", $expr\n"
gdb_expect 10 {
-re "x (-*\[0-9\]+) x" {
if { $expect_out(1,string) == $exp_res } {
- set passfail "pass";
+ set passfail "pass"
}
- exp_continue;
+ exp_continue
}
-re "$gdb_prompt $" { }
}
- $passfail "$testname";
+ $passfail "$testname"
if { $passfail == "pass" } then {
return 0
} else {
#
proc gdb_readexpr { gdb_expr } {
- global gdb_prompt;
+ global gdb_prompt
- set result -1;
+ set result -1
send_gdb "print $gdb_expr\n"
gdb_expect 5 {
-re "\[$\].*= (\[0-9\]+).*$gdb_prompt $" {
- set result $expect_out(1,string);
+ set result $expect_out(1,string)
}
-re "$gdb_prompt $" { }
default { }
#
proc gdb_gettpnum { tracepoint } {
- global gdb_prompt;
+ global gdb_prompt
if { $tracepoint != "" } {
gdb_test "trace $tracepoint" "" ""
#
proc gdb_find_function_baseline { func_name } {
- global gdb_prompt;
+ global gdb_prompt
- set baseline -1;
+ set baseline -1
send_gdb "list $func_name\n"
# gdb_expect {
#
proc gdb_find_recursion_test_baseline { filename } {
- global gdb_prompt;
+ global gdb_prompt
- set baseline -1;
+ set baseline -1
gdb_test "list $filename:1" "" ""
send_gdb "search gdb_recursion_test line 0\n"
gdb_expect {
-re "(\[0-9\]+)\[\t \]+\{.*line 0.*$gdb_prompt $" {
- set baseline $expect_out(1,string);
+ set baseline $expect_out(1,string)
}
-re "$gdb_prompt $" { }
default { }