fields (and no data) marks the end of trace data. */
#define TRACEFRAME_EOB_MARKER_SIZE offsetof (struct traceframe, data)
-/* The traceframe to be used as the source of data to send back to
- GDB. A value of -1 means to get data from the live program. */
-
-int current_traceframe = -1;
-
/* This flag is true if the trace buffer is circular, meaning that
when it fills, the oldest trace frames are discarded in order to
make room. */
find_next_traceframe_in_range (CORE_ADDR lo, CORE_ADDR hi, int inside_p,
int *tfnump)
{
+ client_state &cs = get_client_state ();
struct traceframe *tframe;
CORE_ADDR tfaddr;
- *tfnump = current_traceframe + 1;
+ *tfnump = cs.current_traceframe + 1;
tframe = find_traceframe (*tfnump);
/* The search is not supposed to wrap around. */
if (!tframe)
static struct traceframe *
find_next_traceframe_by_tracepoint (int num, int *tfnump)
{
+ client_state &cs = get_client_state ();
struct traceframe *tframe;
- *tfnump = current_traceframe + 1;
+ *tfnump = cs.current_traceframe + 1;
tframe = find_traceframe (*tfnump);
/* The search is not supposed to wrap around. */
if (!tframe)
static void
cmd_qtinit (char *packet)
{
+ client_state &cs = get_client_state ();
struct trace_state_variable *tsv, *prev, *next;
/* Can't do this command without a pid attached. */
}
/* Make sure we don't try to read from a trace frame. */
- current_traceframe = -1;
+ cs.current_traceframe = -1;
stop_tracing ();
static void
cmd_qtv (char *own_buf)
{
+ client_state &cs = get_client_state ();
ULONGEST num;
LONGEST val = 0;
int err;
packet += strlen ("qTV:");
unpack_varlen_hex (packet, &num);
- if (current_traceframe >= 0)
+ if (cs.current_traceframe >= 0)
{
err = traceframe_read_tsv ((int) num, &val);
if (err)
static void
cmd_qtframe (char *own_buf)
{
+ client_state &cs = get_client_state ();
ULONGEST frame, pc, lo, hi, num;
int tfnum, tpnum;
struct traceframe *tframe;
if (tfnum == -1)
{
trace_debug ("Want to stop looking at traceframes");
- current_traceframe = -1;
+ cs.current_traceframe = -1;
write_ok (own_buf);
return;
}
if (tframe)
{
- current_traceframe = tfnum;
+ cs.current_traceframe = tfnum;
sprintf (own_buf, "F%xT%x", tfnum, tframe->tpnum);
}
else
static int
traceframe_read_tsv (int tsvnum, LONGEST *val)
{
+ client_state &cs = get_client_state ();
int tfnum;
struct traceframe *tframe;
unsigned char *database, *dataptr;
trace_debug ("traceframe_read_tsv");
- tfnum = current_traceframe;
+ tfnum = cs.current_traceframe;
if (tfnum < 0)
{