Index: tracepoint.c =================================================================== RCS file: /cvs/src/src/gdb/tracepoint.c,v retrieving revision 1.159 diff -p -r1.159 tracepoint.c *** tracepoint.c 26 Mar 2010 15:26:29 -0000 1.159 --- tracepoint.c 26 Mar 2010 20:46:05 -0000 *************** start_tracing (void) *** 1449,1472 **** int ix; struct breakpoint *t; struct trace_state_variable *tsv; ! int any_downloaded = 0; ! ! target_trace_init (); tp_vec = all_tracepoints (); for (ix = 0; VEC_iterate (breakpoint_p, tp_vec, ix, t); ix++) { t->number_on_target = 0; target_download_tracepoint (t); t->number_on_target = t->number; - any_downloaded = 1; } VEC_free (breakpoint_p, tp_vec); ! ! /* No point in tracing without any tracepoints... */ ! if (!any_downloaded) ! error ("No tracepoints downloaded, not starting trace"); ! /* Send down all the trace state variables too. */ for (ix = 0; VEC_iterate (tsv_s, tvariables, ix, tsv); ++ix) { --- 1449,1491 ---- int ix; struct breakpoint *t; struct trace_state_variable *tsv; ! int any_enabled = 0; tp_vec = all_tracepoints (); + + /* No point in tracing without any tracepoints... */ + if (VEC_length (breakpoint_p, tp_vec) == 0) + { + VEC_free (breakpoint_p, tp_vec); + error (_("No tracepoints defined, not starting trace")); + } + + for (ix = 0; VEC_iterate (breakpoint_p, tp_vec, ix, t); ix++) + { + if (t->enable_state == bp_enabled) + { + any_enabled = 1; + break; + } + } + + /* No point in tracing with only disabled tracepoints. */ + if (!any_enabled) + { + VEC_free (breakpoint_p, tp_vec); + error (_("No tracepoints enabled, not starting trace")); + } + + target_trace_init (); + for (ix = 0; VEC_iterate (breakpoint_p, tp_vec, ix, t); ix++) { t->number_on_target = 0; target_download_tracepoint (t); t->number_on_target = t->number; } VEC_free (breakpoint_p, tp_vec); ! /* Send down all the trace state variables too. */ for (ix = 0; VEC_iterate (tsv_s, tvariables, ix, tsv); ++ix) {