44 #include "filenames.h"
60 #include "readline/readline.h"
61 #include "readline/history.h"
76 #define MAX_AGENT_EXPR_LEN 184
122 static int next_tsv_number = 1;
125 static int traceframe_number;
128 static int tracepoint_number;
134 static struct traceframe_info *traceframe_info;
142 static int disconnected_tracing;
147 static int circular_trace_buffer;
152 static int trace_buffer_size = -1;
156 char *trace_user = NULL;
160 char *trace_notes = NULL;
164 char *trace_stop_notes = NULL;
231 traceframe_info = NULL;
238 traceframe_number = num;
246 tracepoint_number = num;
257 struct symbol *traceframe_fun;
261 if (trace_frame != NULL
270 traceframe_sal.
line);
275 traceframe_fun = NULL;
281 if (traceframe_fun == NULL
290 if (traceframe_sal.
symtab == NULL)
304 memset (&tsv, 0,
sizeof (tsv));
305 tsv.
name = xstrdup (name);
306 tsv.
number = next_tsv_number++;
319 if (strcmp (name, tsv->
name) == 0)
335 if (tsv->
number == number)
348 if (strcmp (name, tsv->
name) == 0)
358 warning (
_(
"No trace variable named \"$%s\", not deleting"), name);
370 error (
_(
"Must supply a non-empty variable name"));
374 for (p = name; isdigit (*p); p++)
377 error (
_(
"$%s is not a valid trace state variable name"), name);
379 for (p = name; isalnum (*p) || *p ==
'_'; p++)
382 error (
_(
"$%s is not a valid trace state variable name"), name);
403 error (
_(
"Name of trace variable should start with '$'"));
406 while (isalnum (*p) || *p ==
'_')
412 if (*p !=
'=' && *p !=
'\0')
413 error (
_(
"Syntax must be $NAME [ = EXPR ]"));
430 "now has initial value %s.\n"),
443 "created, with initial value %s.\n"),
458 if (
query (
_(
"Delete all trace state variables? ")))
468 for (ix = 0; argv[ix] != NULL; ix++)
470 if (*argv[ix] ==
'$')
473 warning (
_(
"Name \"%s\" not prefixed with '$', ignoring"), argv[ix]);
502 count,
"trace-variables");
517 name = concat (
"$", tsv->
name, (
char *) NULL);
584 error (
_(
"This command cannot be used at the top level."));
590 error (
_(
"This command can only be used in a tracepoint actions list."));
596 error (
_(
"This command can only be used in a tracepoint actions list."));
602 error (
_(
"This command can only be used in a tracepoint actions list."));
631 if (*exp >=
'0' && *exp <=
'9')
632 *trace_string = atoi (exp);
633 while (*exp >=
'0' && *exp <=
'9')
637 error (
_(
"Target does not support \"/s\" option for string tracing."));
640 error (
_(
"Undefined collection format \"%c\"."), *exp);
658 xstrprintf (
"Enter actions for tracepoint %d, one per line.",
685 _(
"expression has min height < 0"));
694 error (
_(
"Expression is too complicated."));
703 struct cleanup *old_chain = NULL;
725 error (
_(
"`%s' is not a tracepoint action, or is ambiguous."), p);
729 int trace_string = 0;
741 if (0 == strncasecmp (
"reg", p + 1, 3)
742 || 0 == strncasecmp (
"arg", p + 1, 3)
743 || 0 == strncasecmp (
"loc", p + 1, 3)
744 || 0 == strncasecmp (
"_ret", p + 1, 4)
745 || 0 == strncasecmp (
"_sdata", p + 1, 6))
764 error (
_(
"constant `%s' (value %s) "
765 "will not be collected."),
772 error (
_(
"`%s' is optimized away "
773 "and cannot be collected."),
785 error (
_(
"Expression is too complicated."));
794 while (p && *p++ ==
',');
821 error (
_(
"Expression is too complicated."));
829 while (p && *p++ ==
',');
839 error (
_(
"while-stepping step count `%s' is malformed."), line);
847 error (
_(
"`%s' is not a supported tracepoint action."), line);
862 const struct memrange *a = va, *b = vb;
864 if (a->
type < b->type)
866 if (a->
type > b->type)
870 if ((bfd_vma) a->
start < (bfd_vma) b->start)
872 if ((bfd_vma) a->
start > (bfd_vma) b->start)
877 if (a->
start < b->start)
879 if (a->
start > b->start)
908 memcpy (&memranges->
list[a], &memranges->
list[b],
921 if (regno >= (8 *
sizeof (collection->
regs_mask)))
922 error (
_(
"Internal: register number %d too large for tracepoint"),
924 collection->
regs_mask[regno / 8] |= 1 << (regno % 8);
930 int type, bfd_signed_vma base,
963 long frame_regno,
long frame_offset,
970 int treat_as_expr = 0;
990 sprintf_vma (tmp, offset);
1026 printf_vma (offset);
1038 printf_vma (offset);
1050 printf_vma (offset);
1074 struct cleanup *old_chain1 = NULL;
1108 for (ndx2 = 0; ndx2 < 8; ndx2++)
1109 if (aexpr->
reg_mask[ndx1] & (1 << ndx2))
1146 xstrdup (print_name));
1172 warning (
_(
"Can't collect locals; "
1173 "no symbol table info available.\n"));
1178 if (cb_data.
count == 0)
1179 warning (
_(
"No locals found in scope."));
1187 warning (
_(
"Can't collect args; no symbol table info available."));
1192 if (cb_data.
count == 0)
1193 warning (
_(
"No args found in scope."));
1243 memset (clist, 0,
sizeof *clist);
1258 char temp_buf[2048];
1262 char *(*str_list)[];
1267 str_list = (
char *(*)[])
xmalloc (count *
sizeof (
char *));
1275 (*str_list)[ndx] =
savestring (temp_buf, end - temp_buf);
1279 for (i =
sizeof (list->
regs_mask) - 1; i > 0; i--)
1293 sprintf (end,
"%02X", list->
regs_mask[i]);
1296 (*str_list)[ndx] = xstrdup (temp_buf);
1303 for (i = 0, count = 0, end = temp_buf; i < list->
next_memrange; i++)
1306 sprintf_vma (tmp2, list->
list[i].
start);
1316 (*str_list)[ndx] =
savestring (temp_buf, count);
1330 sprintf (end,
"M-1,%s,%lX", tmp2, (
long) length);
1332 sprintf (end,
"M%X,%s,%lX", list->
list[i].
type, tmp2, (
long) length);
1335 count += strlen (end);
1336 end = temp_buf + count;
1344 (*str_list)[ndx] =
savestring (temp_buf, count);
1360 (*str_list)[ndx] =
savestring (temp_buf, count);
1365 (*str_list)[ndx] = NULL;
1400 const char *action_exp;
1403 struct value *tempval;
1407 for (; action; action = action->
next)
1410 action_exp = action->
line;
1415 error (
_(
"Bad action list item: %s"), action_exp);
1421 if (*action_exp ==
'/')
1429 if (0 == strncasecmp (
"$reg", action_exp, 4))
1433 action_exp = strchr (action_exp,
',');
1435 else if (0 == strncasecmp (
"$arg", action_exp, 4))
1444 action_exp = strchr (action_exp,
',');
1446 else if (0 == strncasecmp (
"$loc", action_exp, 4))
1455 action_exp = strchr (action_exp,
',');
1457 else if (0 == strncasecmp (
"$_ret", action_exp, 5))
1459 struct cleanup *old_chain1 = NULL;
1484 for (ndx2 = 0; ndx2 < 8; ndx2++)
1485 if (aexpr->
reg_mask[ndx1] & (1 << ndx2))
1493 action_exp = strchr (action_exp,
',');
1495 else if (0 == strncasecmp (
"$_sdata", action_exp, 7))
1498 action_exp = strchr (action_exp,
',');
1503 struct cleanup *old_chain = NULL;
1504 struct cleanup *old_chain1 = NULL;
1517 name, strlen (name));
1520 _(
"Register $%s not available"),
1552 collect->wholly_collected,
1582 for (ndx2 = 0; ndx2 < 8; ndx2++)
1583 if (aexpr->
reg_mask[ndx1] & (1 << ndx2))
1597 while (action_exp && *action_exp++ ==
',');
1607 struct cleanup *old_chain = NULL;
1608 struct cleanup *old_chain1 = NULL;
1628 while (action_exp && *action_exp++ ==
',');
1638 frame_offset, stepping_list, NULL);
1641 error (
_(
"Invalid tracepoint command '%s'"), action->
line);
1654 char *default_collect_line = NULL;
1659 struct cleanup *back_to, *return_chain;
1670 tloc->
address, &frame_reg, &frame_offset);
1675 tracepoint_list, stepping_list);
1681 return return_chain;
1688 char ***stepping_actions)
1693 *tdp_actions = NULL;
1694 *stepping_actions = NULL;
1725 int has_pending_p = 0;
1729 tp_vec = all_tracepoints ();
1741 for (loc1 = b->
loc; loc1; loc1 = loc1->
next)
1757 warning (
_(
"Pending tracepoints will not be resolved while"
1758 " GDB is disconnected\n"));
1779 int any_enabled = 0, num_to_download = 0;
1782 tp_vec = all_tracepoints ();
1788 error (
_(
"No tracepoints defined, not starting trace"));
1804 warning (
_(
"May not insert %stracepoints, skipping tracepoint %d"),
1811 warning (
_(
"No tracepoints enabled"));
1817 error (
_(
"No tracepoints enabled, not starting trace"));
1821 if (num_to_download <= 0)
1824 error (
_(
"No tracepoints that may be downloaded, not starting trace"));
1833 int bp_location_downloaded = 0;
1836 for (loc = b->
loc; loc; loc = loc->
next)
1846 for (loc = b->
loc; loc; loc = loc->
next)
1855 bp_location_downloaded = 1;
1860 for (loc = b->
loc; loc; loc = loc->
next)
1867 if (bp_location_downloaded)
1886 notes = trace_notes;
1889 if (!ret && (trace_user || notes))
1890 warning (
_(
"Target does not support trace user/notes, info ignored"));
1914 && !
query (
_(
"A trace is running already. Start a new run? ")))
1915 error (
_(
"New trace run not started."));
1930 error (
_(
"Trace is not running."));
1945 tp_vec = all_tracepoints ();
1955 for (loc = t->
loc; loc; loc = loc->
next)
1972 note = trace_stop_notes;
1976 warning (
_(
"Target does not support trace notes, note ignored"));
2039 "error (%s, tracepoint %d).\n"),
2059 "frames (of %d created total).\n"),
2101 if (traceframe_number >= 0)
2103 traceframe_number, tracepoint_number);
2115 printf_filtered (
_(
"Trace started at %ld.%06ld secs, stopped %ld.%06ld secs later.\n"),
2118 (
long int) (run_time / 1000000),
2119 (
long int) (run_time % 1000000));
2132 tp_vec = all_tracepoints ();
2155 if (status == -1 && ts->
filename == NULL)
2197 stop_reason =
"request";
2200 stop_reason =
"overflow";
2203 stop_reason =
"disconnection";
2206 stop_reason =
"passcount";
2210 stop_reason =
"error";
2218 if (stopping_tracepoint != -1)
2220 stopping_tracepoint);
2246 xsnprintf (buf,
sizeof buf,
"%ld.%06ld",
2250 xsnprintf (buf,
sizeof buf,
"%ld.%06ld",
2284 if (!
query (
_(
"Trace is running and will "
2285 "continue after detach; detach anyway? ")))
2286 error (
_(
"Not confirmed."));
2290 if (!
query (
_(
"Trace is running but will "
2291 "stop on detach; detach anyway? ")))
2292 error (
_(
"Not confirmed."));
2317 int target_frameno = -1, target_tracept = -1;
2337 && target_frameno == -1)
2341 else if (target_frameno == -1)
2365 error (
_(
"Target failed to find requested trace frame."));
2390 if (target_frameno == -1)
2395 if (traceframe_number >= 0)
2408 traceframe_number, tracepoint_number);
2452 error (
_(
"May not look at trace frames while trace is running."));
2477 if (args == 0 || *args == 0)
2479 if (traceframe_number == -1)
2482 frameno = traceframe_number + 1;
2484 else if (0 == strcmp (args,
"-"))
2486 if (traceframe_number == -1)
2487 error (
_(
"not debugging trace buffer"));
2488 else if (from_tty && traceframe_number == 0)
2489 error (
_(
"already at start of trace buffer"));
2491 frameno = traceframe_number - 1;
2494 else if (0 == strcmp (args,
"-1"))
2500 error (
_(
"invalid input (%d is less than zero)"), frameno);
2527 if (args == 0 || *args == 0)
2544 if (args == 0 || *args == 0)
2546 if (tracepoint_number == -1)
2547 error (
_(
"No current tracepoint -- please supply an argument."));
2549 tdp = tracepoint_number;
2582 if (args == 0 || *args == 0)
2598 error (
_(
"No line number information available."));
2602 if (start_pc == end_pc)
2615 && start_pc != end_pc)
2619 error (
_(
"Cannot find a good line."));
2626 error (
_(
"Line number %d is out of range for \"%s\"."),
2646 if (args == 0 || *args == 0)
2652 if (0 != (tmp = strchr (args,
',')))
2677 error (
_(
"May not look at trace frames while trace is running."));
2679 if (args == 0 || *args == 0)
2685 if (0 != (tmp = strchr (args,
',')))
2709 const char *symname;
2710 char *save_args = args;
2716 if (args == 0 || *args == 0)
2717 error (
_(
"requires an argument (function, "
2718 "line or *addr) to define a scope"));
2721 if (sals.
nelts == 0)
2739 if (symname == NULL || *symname ==
'\0')
2869 int stepping_actions,
int stepping_frame,
2872 const char *action_exp, *next_comma;
2874 for (; action != NULL; action = action->
next)
2879 action_exp = action->
line;
2885 if (*action_exp ==
'#')
2890 error (
_(
"Bad action list item: %s"), action_exp);
2898 1, stepping_frame, from_tty);
2908 if (stepping_frame == stepping_actions)
2913 int trace_string = 0;
2915 if (*action_exp ==
'/')
2921 if (*action_exp ==
',')
2925 next_comma = strchr (action_exp,
',');
2927 if (0 == strncasecmp (action_exp,
"$reg", 4))
2929 else if (0 == strncasecmp (action_exp,
"$_ret", 5))
2931 else if (0 == strncasecmp (action_exp,
"$loc", 4))
2933 else if (0 == strncasecmp (action_exp,
"$arg", 4))
2937 if (next_comma != NULL)
2939 size_t len = next_comma - action_exp;
2942 memcpy (cmd, action_exp, len);
2947 size_t len = strlen (action_exp);
2950 memcpy (cmd, action_exp, len + 1);
2957 action_exp = next_comma;
2959 while (action_exp && *action_exp ==
',');
2978 if (tracepoint_number == -1)
2979 error (
_(
"No current trace frame."));
2984 error (
_(
"No known tracepoint matches 'current' tracepoint #%d."),
2999 *stepping_frame_p = 0;
3005 *stepping_frame_p = 1;
3025 if (*default_collect)
3028 char *default_collect_line;
3030 default_collect_line =
xstrprintf (
"collect %s", default_collect);
3036 default_collect_action->
next = actions;
3037 default_collect_action->
line = default_collect_line;
3038 actions = default_collect_action;
3049 int stepping_frame = 0;
3057 printf_filtered (
"Data collected at tracepoint %d, trace frame %d:\n",
3058 tracepoint_number, traceframe_number);
3081 char *srctype,
char *src,
char *buf,
int buf_size)
3083 if (80 + strlen (srctype) > buf_size)
3084 error (
_(
"Buffer too small for source encoding"));
3085 sprintf (buf,
"%x:%s:%s:%x:%x:",
3086 tpnum,
phex_nz (addr,
sizeof (addr)),
3087 srctype, 0, (
int) strlen (src));
3088 if (strlen (buf) + strlen (src) * 2 >= buf_size)
3089 error (
_(
"Source string too long for buffer"));
3127 warning (
_(
"Target does not support trace notes, user ignored"));
3139 warning (
_(
"Target does not support trace notes, note ignored"));
3151 warning (
_(
"Target does not support trace notes, stop note ignored"));
3159 static const char hexchars[] =
"0123456789abcdef";
3170 *buf++ = hexchars[ch >> 4];
3171 *buf++ = hexchars[ch & 0xf];
3182 return traceframe_number;
3188 return tracepoint_number;
3199 if (traceframe_number == num)
3208 warning (
_(
"could not change traceframe"));
3263 for (utp = *utpp; utp; utp = utp->
next)
3270 utp->actions = NULL;
3271 utp->step_actions = NULL;
3272 utp->cmd_strings = NULL;
3285 next_one = (*utpp)->
next;
3299 for (utsv = *utsvp; utsv; utsv = utsv->
next)
3305 utsv->
next = *utsvp;
3317 next_one = (*utsvp)->
next;
3330 if (str1 == NULL || str2 == NULL)
3331 return (str1 == str2);
3333 return (strcmp (str1, str2) == 0);
3361 for (loc = b->
loc; loc; loc = loc->
next)
3385 for (utp = *uploaded_tps; utp; utp = utp->
next)
3399 "as target's tracepoint %d at %s.\n"),
3411 if (b == loc->
owner)
3424 "target's tracepoint %d at %s.\n"),
3429 "tracepoint %d at %s, skipping it.\n"),
3464 const char *namebase;
3472 namebase = utsv->
name;
3478 buf =
xstrprintf (
"%s_%d", namebase, try_num++);
3486 buf =
xstrprintf (
"%s_%d", namebase, try_num++);
3519 for (utsv = *uploaded_tsvs; utsv; utsv = utsv->
next)
3526 "is same as target's variable %d.\n"),
3534 "$%s for target's variable %d.\n"),
3545 if (tsv->
number > highest)
3562 char *p =
line, *p1, *p2, *p3, *p_temp;
3585 p1 = strchr (p,
':');
3587 error (
_(
"Malformed trace status, at %s\n\
3588 Status line: '%s'\n"), p, line);
3589 p3 = strchr (p,
';');
3591 p3 = p + strlen (p);
3597 else if (strncmp (p, stop_reason_names[
trace_never_run], p1 - p) == 0)
3609 else if (strncmp (p, stop_reason_names[
tstop_command], p1 - p) == 0)
3611 p2 = strchr (++p1,
':');
3636 p2 = strchr (++p1,
':');
3650 else if (strncmp (p,
"tframes", p1 - p) == 0)
3655 else if (strncmp (p,
"tcreated", p1 - p) == 0)
3660 else if (strncmp (p,
"tfree", p1 - p) == 0)
3665 else if (strncmp (p,
"tsize", p1 - p) == 0)
3670 else if (strncmp (p,
"disconn", p1 - p) == 0)
3675 else if (strncmp (p,
"circular", p1 - p) == 0)
3680 else if (strncmp (p,
"starttime", p1 - p) == 0)
3685 else if (strncmp (p,
"stoptime", p1 - p) == 0)
3690 else if (strncmp (p,
"username", p1 - p) == 0)
3698 else if (strncmp (p,
"notes", p1 - p) == 0)
3703 ts->
notes[end] =
'\0';
3709 p_temp = strchr (p1 + 1,
';');
3747 ULONGEST num, addr, step, pass, orig_size, xlen, start;
3750 char *cond, *srctype, *buf;
3763 enabled = (*p++ ==
'E');
3790 cond = (
char *)
xmalloc (2 * xlen + 1);
3791 strncpy (cond, p, 2 * xlen);
3792 cond[2 * xlen] =
'\0';
3796 warning (
_(
"Unrecognized char '%c' in tracepoint "
3797 "definition, skipping rest"), *p);
3806 else if (piece ==
'A')
3811 else if (piece ==
'S')
3816 else if (piece ==
'Z')
3821 p = strchr (p,
':');
3828 buf = alloca (strlen (line));
3840 else if (piece ==
'V')
3850 warning (
_(
"Unrecognized tracepoint piece '%c', ignoring"), piece);
3865 buf = alloca (strlen (line));
3880 utsv->
name = xstrdup (buf);
3888 if (*marker_p != NULL)
3917 endp = strchr (p,
':');
3919 error (
_(
"bad marker definition: %s"), line);
3923 marker->
str_id[end] =
'\0';
3930 marker->
extra[end] =
'\0';
3957 char extra_field_indent[80];
3968 tracepoints = static_tracepoints_here (marker->
address);
3982 strcpy (wrap_indent,
" ");
3985 strcat (wrap_indent,
" ");
3987 strcat (wrap_indent,
" ");
3989 strcpy (extra_field_indent,
" ");
4045 ui_out_text (uiout,
_(
"Probed by static tracepoints: "));
4084 "StaticTracepointMarkersTable");
4104 markers, i, marker);
4124 static struct value *
4151 #if !defined(HAVE_LIBEXPAT)
4153 struct traceframe_info *
4156 static int have_warned;
4161 warning (
_(
"Can not parse XML trace frame info; XML support "
4162 "was disabled at compile time"));
4179 struct traceframe_info *info = user_data;
4186 r->
start = *start_p;
4198 struct traceframe_info *info = user_data;
4210 struct traceframe_info *result = p;
4246 struct traceframe_info *
4249 struct traceframe_info *result;
4252 result = XCNEW (
struct traceframe_info);
4256 "traceframe-info.dtd", traceframe_info_elements,
4257 tframe_info, result) == 0)
4275 struct traceframe_info *
4278 if (traceframe_info == NULL)
4281 return traceframe_info;
4310 hi1 = memaddr +
len;
4349 traceframe_number = -1;
4350 tracepoint_number = -1;
4353 _(
"List the variables local to a scope"));
4356 _(
"Tracing of program execution without stopping the program."),
4360 _(
"Print everything collected at the current tracepoint."));
4363 Define a trace state variable.\n\
4364 Argument is a $-prefixed name, optionally followed\n\
4365 by '=' and an expression that sets the initial value\n\
4366 at the start of tracing."));
4370 Delete one or more trace state variables.\n\
4371 Arguments are the names of the variables to delete.\n\
4372 If no arguments are supplied, delete all variables."), &
deletelist);
4376 Status of trace state variables and their values.\n\
4379 add_info (
"static-tracepoint-markers",
4381 List target static tracepoints markers.\n\
4385 Select a trace frame;\n\
4386 No argument means forward by one frame; '-' means backward by one frame."),
4387 &tfindlist,
"tfind ", 1, &
cmdlist);
4390 Select a trace frame whose PC is outside the given range (exclusive).\n\
4391 Usage: tfind outside addr1, addr2"),
4395 Select a trace frame whose PC is in the given range (inclusive).\n\
4396 Usage: tfind range addr1,addr2"),
4400 Select a trace frame by source line.\n\
4401 Argument can be a line number (with optional source file),\n\
4402 a function name, or '*' followed by an address.\n\
4403 Default argument is 'the next source line that was traced'."),
4407 Select a trace frame by tracepoint number.\n\
4408 Default is the tracepoint for the current trace frame."),
4412 Select a trace frame by PC.\n\
4413 Default is the current PC, or the PC of the current trace frame."),
4417 De-select any trace frame and resume 'live' debugging."),
4423 _(
"Select the first trace frame in the trace buffer."),
4427 _(
"Display the status of the current trace data collection."));
4430 Stop trace data collection.\n\
4431 Usage: tstop [ <notes> ... ]\n\
4432 Any arguments supplied are recorded with the trace as a stop reason and\n\
4433 reported by tstatus (if the target supports trace notes)."));
4436 Start trace data collection.\n\
4437 Usage: tstart [ <notes> ... ]\n\
4438 Any arguments supplied are recorded with the trace as a note and\n\
4439 reported by tstatus (if the target supports trace notes)."));
4442 Ends a list of commands or actions.\n\
4443 Several GDB commands allow you to enter a list of commands or actions.\n\
4444 Entering \"end\" on a line by itself is the normal way to terminate\n\
4446 Note: the \"end\" command cannot be used at the gdb prompt."));
4449 Specify single-stepping behavior at a tracepoint.\n\
4450 Argument is number of instructions to trace in single-step mode\n\
4451 following the tracepoint. This command is normally followed by\n\
4452 one or more \"collect\" commands, to specify what to collect\n\
4453 while single-stepping.\n\n\
4454 Note: this command can only be used in a tracepoint \"actions\" list."));
4460 Specify one or more data items to be collected at a tracepoint.\n\
4461 Accepts a comma-separated list of (one or more) expressions. GDB will\n\
4462 collect all data (variables, registers) referenced by that expression.\n\
4463 Also accepts the following special arguments:\n\
4464 $regs -- all registers.\n\
4465 $args -- all function arguments.\n\
4466 $locals -- all variables local to the block/function scope.\n\
4467 $_sdata -- static tracepoint data (ignored for non-static tracepoints).\n\
4468 Note: this command can only be used in a tracepoint \"actions\" list."));
4471 Specify one or more expressions to be evaluated at a tracepoint.\n\
4472 Accepts a comma-separated list of (one or more) expressions.\n\
4473 The result of each evaluation will be discarded.\n\
4474 Note: this command can only be used in a tracepoint \"actions\" list."));
4477 Specify the actions to be taken at a tracepoint.\n\
4478 Tracepoint actions may include collecting of specified data,\n\
4479 single-stepping, or enabling/disabling other tracepoints,\n\
4480 depending on target's capabilities."));
4482 default_collect = xstrdup (
"");
4484 &default_collect,
_(
"\
4485 Set the list of expressions to collect by default"),
_(
"\
4486 Show the list of expressions to collect by default"), NULL,
4491 &disconnected_tracing,
_(
"\
4492 Set whether tracing continues after GDB disconnects."),
_(
"\
4493 Show whether tracing continues after GDB disconnects."),
_(
"\
4494 Use this to continue a tracing run even if GDB disconnects\n\
4495 or detaches from the target. You can reconnect later and look at\n\
4496 trace data collected in the meantime."),
4503 &circular_trace_buffer,
_(
"\
4504 Set target's use of circular trace buffer."),
_(
"\
4505 Show target's use of circular trace buffer."),
_(
"\
4506 Use this to make the trace buffer into a circular buffer,\n\
4507 which will discard traceframes (oldest first) instead of filling\n\
4508 up and stopping the trace run."),
4515 &trace_buffer_size,
_(
"\
4516 Set requested size of trace buffer."),
_(
"\
4517 Show requested size of trace buffer."),
_(
"\
4518 Use this to choose a size for the trace buffer. Some targets\n\
4519 may have fixed or limited buffer sizes. Specifying \"unlimited\" or -1\n\
4520 disables any attempt to set the buffer size and lets the target choose."),
4526 Set the user name to use for current and future trace runs"),
_(
"\
4527 Show the user name to use for current and future trace runs"), NULL,
4533 Set notes string to use for current and future trace runs"),
_(
"\
4534 Show the notes string to use for current and future trace runs"), NULL,
4539 &trace_stop_notes,
_(
"\
4540 Set notes string to use for future tstop commands"),
_(
"\
4541 Show the notes string to use for future tstop commands"), NULL,
void error_no_arg(const char *why)
struct gdbarch * target_gdbarch(void)
struct cleanup * make_cleanup_freeargv(char **arg)
static void free_traceframe_info(struct traceframe_info *info)
void free_agent_expr(struct agent_expr *x)
struct cleanup * make_cleanup_free_agent_expr(struct agent_expr *x)
union exp_element elts[1]
char * hex_string(LONGEST num)
struct cmd_list_element * add_prefix_cmd(const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc, struct cmd_list_element **prefixlist, const char *prefixname, int allow_unknown, struct cmd_list_element **list)
struct traceframe_info * get_traceframe_info(void)
void release_static_tracepoint_marker(struct static_tracepoint_marker *marker)
const char * symtab_to_filename_for_display(struct symtab *symtab)
static void delete_trace_variable_command(char *args, int from_tty)
struct command_line * breakpoint_commands(struct breakpoint *b)
static void encode_actions_1(struct command_line *action, struct bp_location *tloc, int frame_reg, LONGEST frame_offset, struct collection_list *collect, struct collection_list *stepping_list)
void registers_info(char *addr_exp, int fpregs)
struct frame_info * get_selected_frame(const char *message)
CORE_ADDR get_frame_pc(struct frame_info *frame)
#define SYMBOL_PRINT_NAME(symbol)
void ui_out_wrap_hint(struct ui_out *uiout, char *identstring)
static char ** stringify_collection_list(struct collection_list *list)
void check_tracepoint_command(char *line, void *closure)
void ui_out_field_int(struct ui_out *uiout, const char *fldname, int value)
struct frame_info * get_current_frame(void)
static int memrange_cmp(const void *, const void *)
void ax_reqs(struct agent_expr *ax)
static void trace_find_end_command(char *args, int from_tty)
static void print_one_static_tracepoint_marker(int count, struct static_tracepoint_marker *marker)
void print_address(struct gdbarch *, CORE_ADDR, struct ui_file *)
void ui_out_spaces(struct ui_out *uiout, int numspaces)
struct cleanup * make_cleanup_restore_current_traceframe(void)
int may_insert_fast_tracepoints
static struct cleanup * cleanup_chain
void parse_tracepoint_definition(char *line, struct uploaded_tp **utpp)
LONGEST value_as_long(struct value *val)
#define BMSYMBOL_VALUE_ADDRESS(symbol)
void warning(const char *fmt,...)
const char * decode_agent_options(const char *exp, int *trace_string)
int query(const char *ctlstr,...)
static struct bp_location * find_matching_tracepoint_location(struct uploaded_tp *utp)
#define target_supports_enable_disable_tracepoint()
struct symbol * find_pc_sect_function(CORE_ADDR pc, struct obj_section *section)
char * ui_file_xstrdup(struct ui_file *file, long *length)
struct cleanup * make_cleanup_ui_out_table_begin_end(struct ui_out *ui_out, int nr_cols, int nr_rows, const char *tblid)
char * plongest(LONGEST l)
int bin2hex(const gdb_byte *bin, char *hex, int count)
LONGEST target_read_alloc(struct target_ops *ops, enum target_object object, const char *annex, gdb_byte **buf_p)
void ui_file_delete(struct ui_file *file)
struct ui_file * gdb_stdout
void free_uploaded_tps(struct uploaded_tp **utpp)
static const struct gdb_xml_element traceframe_info_children[]
void select_frame(struct frame_info *fi)
void(* deprecated_trace_find_hook)(char *arg, int from_tty)
#define SYMBOL_CLASS(symbol)
void internal_error(const char *file, int line, const char *fmt,...)
const struct frame_id null_frame_id
static void trace_find_line_command(char *args, int from_tty)
void init_sal(struct symtab_and_line *sal)
#define target_set_trace_buffer_size(val)
int ui_out_is_mi_like_p(struct ui_out *uiout)
int get_frame_pc_if_available(struct frame_info *frame, CORE_ADDR *pc)
struct cmd_list_element * deletelist
#define VEC_unordered_remove(T, V, I)
static struct trace_state_variable * find_matching_tsv(struct uploaded_tsv *utsv)
void parse_static_tracepoint_marker_definition(char *line, char **pp, struct static_tracepoint_marker *marker)
void(* deprecated_trace_start_stop_hook)(int start, int from_tty)
int traceframe_available_memory(VEC(mem_range_s)**result, CORE_ADDR memaddr, ULONGEST len)
void(* set_semaphore)(struct probe *probe, struct objfile *objfile, struct gdbarch *gdbarch)
void trace_status_mi(int on_stop)
static void do_clear_collection_list(void *list)
static const struct gdb_xml_attribute tvar_attributes[]
struct gdbarch * symbol_arch(const struct symbol *symbol)
static void report_agent_reqs_errors(struct agent_expr *aexpr)
static struct command_line * all_tracepoint_actions_and_cleanup(struct breakpoint *t)
void validate_actionline(const char *line, struct breakpoint *b)
struct bp_location * get_traceframe_location(int *stepping_frame_p)
static void add_memrange(struct collection_list *memranges, int type, bfd_signed_vma base, unsigned long len)
#define VEC_safe_push(T, V, O)
static void set_disconnected_tracing(char *args, int from_tty, struct cmd_list_element *c)
static void do_restore_current_traceframe_cleanup(void *arg)
struct cmd_list_element * cmdlist
void save_trace_state_variables(struct ui_file *fp)
int gdbarch_num_regs(struct gdbarch *gdbarch)
struct tracepoint * get_tracepoint(int num)
struct collection_list * collect
struct internalvar * lookup_internalvar(const char *name)
char * skip_spaces(char *chp)
ULONGEST traceframe_usage
static void trace_find_tracepoint_command(char *args, int from_tty)
struct cmd_list_element * lookup_cmd(const char **line, struct cmd_list_element *list, char *cmdtype, int allow_unknown, int ignore_help_classes)
#define target_get_tracepoint_status(tp, utp)
struct agent_expr * gen_trace_for_var(CORE_ADDR scope, struct gdbarch *gdbarch, struct symbol *var, int trace_string)
static void add_static_trace_data(struct collection_list *collection)
void ui_out_field_fmt(struct ui_out *uiout, const char *fldname, const char *format,...)
struct value * allocate_value(struct type *type)
static void process_tracepoint_on_disconnect(void)
struct regcache * get_current_regcache(void)
void ui_out_text(struct ui_out *uiout, const char *string)
const struct block * block_for_pc(CORE_ADDR pc)
void free_uploaded_tsvs(struct uploaded_tsv **utsvp)
int may_insert_tracepoints
void printf_filtered(const char *format,...)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
static void trace_start_command(char *args, int from_tty)
#define target_set_circular_trace_buffer(val)
static void set_tracepoint_num(int num)
void observer_notify_traceframe_changed(int tfnum, int tpnum)
#define BLOCK_FUNCTION(bl)
unsigned char regs_mask[32]
int cmd_cfunc_eq(struct cmd_list_element *cmd, cmd_cfunc_ftype *cfunc)
void parse_tsv_definition(char *line, struct uploaded_tsv **utsvp)
const char * symtab_to_fullname(struct symtab *s)
struct trace_status * current_trace_status(void)
void null_cleanup(void *arg)
#define target_get_trace_state_variable_value(tsv, val)
struct value * evaluate_expression(struct expression *exp)
static void trace_variable_command(char *args, int from_tty)
static void trace_stop_command(char *args, int from_tty)
int frame_id_eq(struct frame_id l, struct frame_id r)
struct uploaded_tp * get_uploaded_tp(int num, ULONGEST addr, struct uploaded_tp **utpp)
static void add_register(struct collection_list *collection, unsigned int regno)
static void traceframe_info_start_tvar(struct gdb_xml_parser *parser, const struct gdb_xml_element *element, void *user_data, VEC(gdb_xml_value_s)*attributes)
void(* clear_semaphore)(struct probe *probe, struct objfile *objfile, struct gdbarch *gdbarch)
struct cmd_list_element * setlist
#define VEC_iterate(T, V, I, P)
int mem_ranges_overlap(CORE_ADDR start1, int len1, CORE_ADDR start2, int len2)
#define target_trace_find(type, num, addr1, addr2, tpp)
struct tracepoint * get_tracepoint_by_number_on_target(int num)
void breakpoint_set_commands(struct breakpoint *b, struct command_line *commands)
struct frame_id get_frame_id(struct frame_info *fi)
static void set_trace_user(char *args, int from_tty, struct cmd_list_element *c)
struct bp_location * next
struct type * check_typedef(struct type *type)
static void trace_find_outside_command(char *args, int from_tty)
#define SYMBOL_VALUE_ADDRESS(symbol)
void target_dcache_invalidate(void)
static void trace_status_command(char *args, int from_tty)
#define MAX_AGENT_EXPR_LEN
static void clear_collection_list(struct collection_list *list)
struct cleanup * make_cleanup_dtor(make_cleanup_ftype *function, void *arg, make_cleanup_dtor_ftype *dtor)
void merge_uploaded_tracepoints(struct uploaded_tp **uploaded_tps)
static void init_collection_list(struct collection_list *clist)
void ui_out_field_skip(struct ui_out *uiout, const char *fldname)
struct tracepoint * create_tracepoint_from_upload(struct uploaded_tp *utp)
struct uploaded_tsv * get_uploaded_tsv(int num, struct uploaded_tsv **utsvp)
static void trace_find_range_command(char *args, int from_tty)
int gdb_xml_parse_quick(const char *name, const char *dtd_name, const struct gdb_xml_element *elements, const char *document, void *user_data)
static void traceframe_info_start_memory(struct gdb_xml_parser *parser, const struct gdb_xml_element *element, void *user_data, VEC(gdb_xml_value_s)*attributes)
struct target_ops current_target
struct symtab_and_line find_pc_line(CORE_ADDR pc, int notcurrent)
struct cleanup * make_cleanup_ui_out_tuple_begin_end(struct ui_out *uiout, const char *id)
struct uploaded_tsv * next
void merge_uploaded_trace_state_variables(struct uploaded_tsv **uploaded_tsvs)
void fprintf_filtered(struct ui_file *stream, const char *format,...)
static void set_trace_buffer_size(char *args, int from_tty, struct cmd_list_element *c)
void free_current_marker(void *arg)
const char * skip_spaces_const(const char *chp)
struct symbol * find_pc_function(CORE_ADDR pc)
static void collect_pseudocommand(char *args, int from_tty)
void set_cmd_completer(struct cmd_list_element *cmd, completer_ftype *completer)
void trace_reset_local_state(void)
static const struct gdb_xml_attribute memory_attributes[]
void fprintf_unfiltered(struct ui_file *stream, const char *format,...)
mach_port_t mach_port_t name mach_port_t mach_port_t name error_t int status
void print_expression(struct expression *exp, struct ui_file *stream)
struct cmd_list_element * showlist
struct cmd_list_element * add_com_alias(const char *name, const char *oldname, enum command_class theclass, int abbrev_flag)
struct uploaded_tp * next
static char * mem2hex(gdb_byte *mem, char *buf, int count)
enum trace_stop_reason stop_reason
struct expression * parse_exp_1(const char **, CORE_ADDR pc, const struct block *, int)
int encode_source_string(int tpnum, ULONGEST addr, char *srctype, char *src, char *buf, int buf_size)
static void while_stepping_pseudocommand(char *args, int from_tty)
#define gdb_assert_not_reached(message)
struct symtabs_and_lines decode_line_1(char **argptr, int flags, struct symtab *default_symtab, int default_line)
static void trace_dump_actions(struct command_line *action, int stepping_actions, int stepping_frame, int from_tty)
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc, struct cmd_list_element **list)
void free_current_contents(void *ptr)
static void memrange_sortmerge(struct collection_list *memranges)
#define SYMBOL_REGISTER_OPS(symbol)
#define SYMBOL_COMPUTED_OPS(symbol)
int get_traceframe_number(void)
void iterate_over_block_local_vars(const struct block *block, iterate_over_block_arg_local_vars_cb cb, void *cb_data)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
struct type * init_vector_type(struct type *elt_type, int n)
static void info_static_tracepoint_markers_command(char *arg, int from_tty)
#define BLOCK_SUPERBLOCK(bl)
void add_setshow_string_cmd(const char *name, enum command_class theclass, char **var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
struct cmd_list_element * add_info(const char *name, cmd_cfunc_ftype *fun, const char *doc)
struct gdbarch * get_current_arch(void)
#define SYMBOL_LINKAGE_NAME(symbol)
const char * gdbarch_register_name(struct gdbarch *gdbarch, int regnr)
#define target_static_tracepoint_markers_by_strid(marker_id)
#define target_download_tracepoint(t)
static void append_exp(struct expression *exp, VEC(char_ptr)**list)
static int startswith(const char *string, const char *pattern)
static void trace_actions_command(char *args, int from_tty)
void stop_tracing(char *note)
struct cleanup * encode_actions_and_make_cleanup(struct bp_location *tloc, struct collection_list *tracepoint_list, struct collection_list *stepping_list)
void observer_notify_tsv_modified(const struct trace_state_variable *tsv)
struct cmd_list_element * add_alias_cmd(const char *name, const char *oldname, enum command_class theclass, int abbrev_flag, struct cmd_list_element **list)
static void add_local_symbols(struct collection_list *collect, struct gdbarch *gdbarch, CORE_ADDR pc, long frame_regno, long frame_offset, int type, int trace_string)
#define target_set_trace_notes(user, notes, stopnotes)
int gdbarch_addr_bit(struct gdbarch *gdbarch)
struct agent_expr * gen_eval_for_expr(CORE_ADDR scope, struct expression *expr)
char * xstrprintf(const char *format,...)
char * unpack_varlen_hex(char *buff, ULONGEST *result)
void validate_trace_state_variable_name(const char *name)
void wrap_here(char *indent)
void printf_unfiltered(const char *format,...)
void check_trace_running(struct trace_status *status)
struct traceframe_info * parse_traceframe_info(const char *tframe_info)
int user_reg_map_name_to_regnum(struct gdbarch *gdbarch, const char *name, int len)
ULONGEST gdb_xml_parse_ulongest(struct gdb_xml_parser *parser, const char *value)
const char * stop_reason_names[]
struct ui_file * mem_fileopen(void)
#define target_download_trace_state_variable(tsv)
void args_info(char *, int)
void start_tracing(char *notes)
static struct value * sdata_make_value(struct gdbarch *gdbarch, struct internalvar *var, void *ignore)
#define SYMBOL_VALUE(symbol)
static struct trace_state_variable * create_tsv_from_upload(struct uploaded_tsv *utsv)
#define target_traceframe_info()
static void trace_find_pc_command(char *args, int from_tty)
PTR xrealloc(PTR ptr, size_t size)
void print_stack_frame(struct frame_info *, int print_level, enum print_what print_what, int set_current_sal)
#define target_get_trace_status(ts)
struct tracepoint * get_tracepoint_by_number(char **arg, struct get_number_or_range_state *state)
static void restore_current_traceframe_cleanup_dtor(void *arg)
void observer_notify_tsv_deleted(const struct trace_state_variable *tsv)
struct command_line * next
static void set_trace_notes(char *args, int from_tty, struct cmd_list_element *c)
int find_line_pc_range(struct symtab_and_line sal, CORE_ADDR *startptr, CORE_ADDR *endptr)
static void collect_symbol(struct collection_list *collect, struct symbol *sym, struct gdbarch *gdbarch, long frame_regno, long frame_offset, CORE_ADDR scope, int trace_string)
struct gdb_xml_value * xml_find_attribute(VEC(gdb_xml_value_s)*attributes, const char *name)
void discard_cleanups(struct cleanup *old_chain)
int get_tracepoint_number(void)
static void free_result(void *p)
void parse_tracepoint_status(char *p, struct breakpoint *bp, struct uploaded_tp *utp)
static int cond_string_is_same(char *str1, char *str2)
void encode_actions_rsp(struct bp_location *tloc, char ***tdp_actions, char ***stepping_actions)
char * phex_nz(ULONGEST l, int sizeof_l)
void add_setshow_zuinteger_unlimited_cmd(const char *name, enum command_class theclass, int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void tfind_1(enum trace_find_type type, int num, CORE_ADDR addr1, CORE_ADDR addr2, int from_tty)
static void do_collect_symbol(const char *print_name, struct symbol *sym, void *cb_data)
ULONGEST traceframe_usage
int xsnprintf(char *str, size_t size, const char *format,...)
#define SYMBOL_BLOCK_VALUE(symbol)
CORE_ADDR parse_and_eval_address(const char *exp)
static void trace_find_start_command(char *args, int from_tty)
#define TYPE_CODE(thistype)
void set_internalvar_string(struct internalvar *var, const char *string)
CORE_ADDR regcache_read_pc(struct regcache *regcache)
struct minimal_symbol * minsym
static void teval_pseudocommand(char *args, int from_tty)
void set_internalvar_integer(struct internalvar *var, LONGEST l)
struct cleanup * make_cleanup_restore_current_thread(void)
void get_user_print_options(struct value_print_options *opts)
void set_current_traceframe(int num)
void tvariables_info_1(void)
void registers_changed(void)
static void set_traceframe_num(int num)
char ** gdb_buildargv(const char *s)
void ui_out_table_header(struct ui_out *uiout, int width, enum ui_align alignment, const char *col_name, const char *colhdr)
struct trace_state_variable * create_trace_state_variable(const char *name)
void clear_internalvar(struct internalvar *var)
static void delete_trace_state_variable(const char *name)
void normalize_mem_ranges(VEC(mem_range_s)*ranges)
void _initialize_tracepoint(void)
void locals_info(char *, int)
#define SYMBOL_NATURAL_NAME(symbol)
gdb_xml_attribute_handler gdb_xml_parse_attr_ulongest
const struct probe_ops * pops
struct symtabs_and_lines decode_line_with_current_source(char *string, int flags)
void ui_out_field_core_addr(struct ui_out *uiout, const char *fldname, struct gdbarch *gdbarch, CORE_ADDR address)
struct value * parse_and_eval(const char *exp)
unsigned long long ULONGEST
#define target_trace_start()
#define target_set_disconnected_tracing(val)
static int ignore(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
char * savestring(const char *ptr, size_t len)
#define target_trace_set_readonly_regions()
int register_size(struct gdbarch *gdbarch, int regnum)
static void set_circular_trace_buffer(char *args, int from_tty, struct cmd_list_element *c)
void disconnect_tracing(void)
void iterate_over_block_arg_vars(const struct block *b, iterate_over_block_arg_local_vars_cb cb, void *cb_data)
struct trace_state_variable * find_trace_state_variable(const char *name)
#define SYMBOL_TYPE(symbol)
void ui_out_field_string(struct ui_out *uiout, const char *fldname, const char *string)
struct trace_state_variable * find_trace_state_variable_by_number(int number)
struct symtab_and_line * sals
int hex2bin(const char *hex, gdb_byte *bin, int count)
gdb_byte * value_contents_raw(struct value *value)
#define TYPE_LENGTH(thistype)
static void clear_traceframe_info(void)
void ui_out_table_body(struct ui_out *uiout)
void output_command_const(const char *exp, int from_tty)
struct agent_expr ** aexpr_list
void reinit_frame_cache(void)
CORE_ADDR get_pc_function_start(CORE_ADDR pc)
struct ui_out * current_uiout
#define SYMBOL_VALUE_BYTES(symbol)
static void trace_dump_command(char *args, int from_tty)
void resolve_sal_pc(struct symtab_and_line *sal)
static void set_traceframe_context(struct frame_info *trace_frame)
static char * wrap_indent
enum enable_state enable_state
static void tvariables_info(char *args, int from_tty)
CORE_ADDR value_address(const struct value *value)
struct bound_minimal_symbol lookup_minimal_symbol(const char *name, const char *sfile, struct objfile *objf)
PTR xcalloc(size_t number, size_t size)
struct command_line ** body_list
static void set_trace_stop_notes(char *args, int from_tty, struct cmd_list_element *c)
void query_if_trace_running(int from_tty)
static void end_actions_pseudocommand(char *args, int from_tty)
struct breakpoint * owner
int has_stack_frames(void)
#define target_trace_stop()
void gdbarch_virtual_frame_pointer(struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset)
struct internalvar * create_internalvar_type_lazy(const char *name, const struct internalvar_funcs *funcs, void *data)
#define target_trace_init()
void parse_trace_status(char *line, struct trace_status *ts)
void error(const char *fmt,...)
static void scope_info(char *args, int from_tty)
struct cmd_list_element * add_com(const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc)
#define ALL_BLOCK_SYMBOLS(block, iter, sym)
struct agent_expr * gen_trace_for_return_address(CORE_ADDR scope, struct gdbarch *gdbarch, int trace_string)
void do_cleanups(struct cleanup *old_chain)
void observer_notify_tsv_created(const struct trace_state_variable *tsv)
void add_setshow_boolean_cmd(const char *name, enum command_class theclass, int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
static void trace_find_command(char *args, int from_tty)
struct agent_expr * gen_trace_for_expr(CORE_ADDR scope, struct expression *expr, int trace_string)
struct command_line * read_command_lines(char *prompt_arg, int from_tty, int parse_commands, void(*validator)(char *, void *), void *closure)
#define SYMBOL_IS_ARGUMENT(symbol)
void observer_notify_breakpoint_modified(struct breakpoint *b)
#define target_supports_string_tracing()
const ULONGEST const LONGEST len
static void add_aexpr(struct collection_list *collect, struct agent_expr *aexpr)
LONGEST parse_and_eval_long(const char *exp)