struct tracepoint *tpoint;
struct tracepoint *prev_stpoint;
+ pause_all (1);
+ cancel_breakpoints ();
+
prev_stpoint = NULL;
/* Restore any bytes overwritten by tracepoints. */
delete_breakpoint (tpoint->handle);
tpoint->handle = NULL;
}
+
+ unpause_all (1);
}
/* Parse a packet that defines a tracepoint. */
*packet = '\0';
+ /* Pause all threads temporarily while we patch tracepoints. */
+ pause_all (1);
+
/* Install tracepoints. */
for (tpoint = tracepoints; tpoint; tpoint = tpoint->next)
{
clear_installed_tracepoints ();
if (*packet == '\0')
write_enn (packet);
+ unpause_all (1);
return;
}
/* Tracing is now active, hits will now start being logged. */
tracing = 1;
+ unpause_all (1);
+
write_ok (packet);
}
trace_debug ("Stopping the trace");
+ /* Pause all threads before removing breakpoints from memory. */
+ pause_all (1);
+ /* Since we're removing breakpoints, cancel breakpoint hits,
+ possibly related to the breakpoints we're about to delete. */
+ cancel_breakpoints ();
+
/* Stop logging. Tracepoints can still be hit, but they will not be
recorded. */
tracing = 0;
/* Clear out the tracepoints. */
clear_installed_tracepoints ();
+
+ unpause_all (1);
}
static void