delete
};
-static void free_actions PARAMS((struct tracepoint *));
-
/* This function implements enable, disable and delete. */
static void
tracepoint_operation (t, from_tty, opcode)
switch (opcode) {
case enable:
t->enabled = enabled;
+ if (modify_tracepoint_hook)
+ modify_tracepoint_hook (t);
break;
case disable:
t->enabled = disabled;
+ if (modify_tracepoint_hook)
+ modify_tracepoint_hook (t);
break;
case delete:
if (tracepoint_chain == t)
if (t1 == (struct tracepoint *) -1 || t1 == t2)
{
t2->pass_count = count;
+ if (modify_tracepoint_hook)
+ modify_tracepoint_hook (t2);
if (from_tty)
printf_filtered ("Setting tracepoint %d's passcount to %d\n",
t2->number, count);
if (linetype == BADLINE)
continue; /* already warned -- collect another line */
- temp = xmalloc (sizeof (struct action_line));
+ temp = (struct action_line *) xmalloc (sizeof (struct action_line));
temp->next = NULL;
temp->action = line;
}
/* worker function */
-static void
+void
free_actions (t)
struct tracepoint *t;
{
/* compare memranges for qsort */
static int
-memrange_cmp (a, b)
- struct memrange *a, *b;
+memrange_cmp (voidpa, voidpb)
+ void *voidpa, *voidpb;
{
+ struct memrange *a, *b;
+
+ a = (struct memrange *) voidpa;
+ b = (struct memrange *) voidpb;
+
if (a->type < b->type) return -1;
if (a->type > b->type) return 1;
if (a->type == 0)
if (memranges->next_memrange >= memranges->listsize)
{
memranges->listsize *= 2;
- memranges->list = xrealloc (memranges->list,
+ memranges->list = (struct memrange *) xrealloc (memranges->list,
memranges->listsize);
}
case LOC_STATIC:
offset = SYMBOL_VALUE_ADDRESS (sym);
if (info_verbose)
- printf_filtered ("LOC_STATIC %s: collect %d bytes "
- "at 0x%08x\n",
+ printf_filtered ("LOC_STATIC %s: collect %d bytes at 0x%08x\n",
SYMBOL_NAME (sym), len, offset);
add_memrange (collect, -1, offset, len); /* 0 == memory */
break;
memrange_sortmerge (&tracepoint_list);
memrange_sortmerge (&stepping_list);
- *tdp_actions = stringify_collection_list (&tracepoint_list, &tdp_buff);
- *stepping_actions = stringify_collection_list (&stepping_list, &step_buff);
+ *tdp_actions = stringify_collection_list (&tracepoint_list, tdp_buff);
+ *stepping_actions = stringify_collection_list (&stepping_list, step_buff);
}
static char target_buf[2048];
if (tdp_actions)
{
if (strlen (buf) + strlen (tdp_actions) >= sizeof (buf))
- error ("Actions for tracepoint %d too complex; "
- "please simplify.", t->number);
+ error ("Actions for tracepoint %d too complex; please simplify.",
+ t->number);
strcat (buf, tdp_actions);
}
if (stepping_actions)
{
strcat (buf, "S");
if (strlen (buf) + strlen (stepping_actions) >= sizeof (buf))
- error ("Actions for tracepoint %d too complex; "
- "please simplify.", t->number);
+ error ("Actions for tracepoint %d too complex; please simplify.",
+ t->number);
strcat (buf, stepping_actions);
}
}
set_traceframe_num (-1); /* all old traceframes invalidated */
set_tracepoint_num (-1);
set_traceframe_context(-1);
+ trace_running_p = 1;
}
else
printf_filtered ("Trace can only be run on remote targets.\n");
remote_get_noisy_reply (target_buf);
if (strcmp (target_buf, "OK"))
error ("Bogus reply from target: %s", target_buf);
+ trace_running_p = 0;
}
else
error ("Trace can only be run on remote targets.");
}
+unsigned long trace_running_p;
+
/* tstatus command */
static void
trace_status_command (args, from_tty)
{
putpkt ("qTStatus");
remote_get_noisy_reply (target_buf);
- if (strcmp (target_buf, "OK"))
- error ("Bogus reply from target: %s", target_buf);
+
+ if (target_buf[0] != 'T' ||
+ (target_buf[1] != '0' && target_buf[1] != '1'))
+ error ("Bogus reply from target: %s", target_buf);
+
+ /* exported for use by the GUI */
+ trace_running_p = (target_buf[1] == '1');
}
else
error ("Trace can only be run on remote targets.");
if (tracepoint_list.list == NULL)
{
tracepoint_list.listsize = 128;
- tracepoint_list.list = xmalloc
+ tracepoint_list.list = (struct memrange *) xmalloc
(tracepoint_list.listsize * sizeof (struct memrange));
}
if (stepping_list.list == NULL)
{
stepping_list.listsize = 128;
- stepping_list.list = xmalloc
+ stepping_list.list = (struct memrange *) xmalloc
(stepping_list.listsize * sizeof (struct memrange));
}