struct tracepoint *t;
struct command_line *l;
- t = get_tracepoint_by_number (&args, NULL, 1);
+ t = get_tracepoint_by_number (&args, NULL);
if (t)
{
char *tmpbuf =
}
}
+/* Error on looking at traceframes while trace is running. */
+
+void
+check_trace_running (struct trace_status *status)
+{
+ if (status->running && status->filename == NULL)
+ error (_("May not look at trace frames while trace is running."));
+}
+
/* trace_find_command takes a trace frame number n,
sends "QTFrame:<n>" to the target,
and accepts a reply that may contain several optional pieces
{ /* This should only be called with a numeric argument. */
int frameno = -1;
- if (current_trace_status ()->running
- && current_trace_status ()->filename == NULL)
- error (_("May not look at trace frames while trace is running."));
+ check_trace_running (current_trace_status ());
if (args == 0 || *args == 0)
{ /* TFIND with no args means find NEXT trace frame. */
{
CORE_ADDR pc;
- if (current_trace_status ()->running
- && current_trace_status ()->filename == NULL)
- error (_("May not look at trace frames while trace is running."));
+ check_trace_running (current_trace_status ());
if (args == 0 || *args == 0)
pc = regcache_read_pc (get_current_regcache ());
int tdp;
struct tracepoint *tp;
- if (current_trace_status ()->running
- && current_trace_status ()->filename == NULL)
- error (_("May not look at trace frames while trace is running."));
+ check_trace_running (current_trace_status ());
if (args == 0 || *args == 0)
{
struct symtab_and_line sal;
struct cleanup *old_chain;
- if (current_trace_status ()->running
- && current_trace_status ()->filename == NULL)
- error (_("May not look at trace frames while trace is running."));
+ check_trace_running (current_trace_status ());
if (args == 0 || *args == 0)
{
static CORE_ADDR start, stop;
char *tmp;
- if (current_trace_status ()->running
- && current_trace_status ()->filename == NULL)
- error (_("May not look at trace frames while trace is running."));
+ check_trace_running (current_trace_status ());
if (args == 0 || *args == 0)
{ /* XXX FIXME: what should default behavior be? */