-# Copyright 1998-2013 Free Software Foundation, Inc.
+# Copyright 1998-2015 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# 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)
# 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"