diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 6205b2d7641..234a0b0f1a2 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2015-04-08 Pedro Alves + + * gdb.trace/actions.exp: Use gdb_load before gdb_run_cmd. + * gdb.trace/infotrace.exp: Use gdb_load before gdb_run_cmd. Use + gdb_breakpoint instead of gdb_test that doesn't expect anything. + Return early if running to main fails. + * gdb.trace/while-stepping.exp: Likewise. + 2015-04-07 Pedro Alves * gdb.base/interrupt.exp: Don't skip if $inferior_spawn_id != diff --git a/gdb/testsuite/gdb.trace/actions.exp b/gdb/testsuite/gdb.trace/actions.exp index 913a2ec7cb2..f786aedc31d 100644 --- a/gdb/testsuite/gdb.trace/actions.exp +++ b/gdb/testsuite/gdb.trace/actions.exp @@ -235,6 +235,9 @@ gdb_test "info tracepoints" \ \[\t \]+not installed on target." \ "5.10a: verify teval actions set for two tracepoints" +# Load the binary to the target too. +gdb_load $binfile + # Can't use runto_main here, because that would delete the tracepoints # created above. gdb_breakpoint "main" diff --git a/gdb/testsuite/gdb.trace/infotrace.exp b/gdb/testsuite/gdb.trace/infotrace.exp index 4e96ea288cb..3b861ead5b2 100644 --- a/gdb/testsuite/gdb.trace/infotrace.exp +++ b/gdb/testsuite/gdb.trace/infotrace.exp @@ -91,11 +91,20 @@ gdb_test "help info tracepoints" \ # 2.6 info tracepoints (check trace buffer usage). We need a live # tracing. + +# Load the binary to the target too. +gdb_load $binfile + +# Can't use runto_main here, because that would delete the tracepoints +# created above. gdb_breakpoint "main" gdb_trace_setactions "collect on tracepoint 1" "1" \ "collect gdb_struct1_test" "^$" gdb_run_cmd -gdb_test "" "Breakpoint ${decimal}, main.*" +if {[gdb_test "" "Breakpoint ${decimal}, main.*"] != 0} { + fail "Can't run to main" + return -1 +} if { ![gdb_target_supports_trace] } then { unsupported "Current target does not support trace" diff --git a/gdb/testsuite/gdb.trace/while-stepping.exp b/gdb/testsuite/gdb.trace/while-stepping.exp index 340bf27592c..519d6af46e3 100644 --- a/gdb/testsuite/gdb.trace/while-stepping.exp +++ b/gdb/testsuite/gdb.trace/while-stepping.exp @@ -99,9 +99,19 @@ gdb_test "info tracepoints" \ .*end.*" \ "5.16: confirm actions, step without collecting anything" -gdb_test "break main" +# Can't use runto_main here, because that would delete the tracepoints +# created above. + +# Load the binary to the target too. +gdb_load $binfile + +gdb_breakpoint "main" gdb_run_cmd -gdb_test "" "Breakpoint .*" +if {[gdb_test "" "Breakpoint .*"] != 0} { + fail "Can't run to main" + return -1 +} + if ![gdb_target_supports_trace] { unsupported "target does not support trace" return -1