44 #include "filenames.h" 62 #include "readline/readline.h" 63 #include "readline/history.h" 78 #define MAX_AGENT_EXPR_LEN 184 124 static int next_tsv_number = 1;
127 static int traceframe_number;
130 static int tracepoint_number;
144 static int disconnected_tracing;
149 static int circular_trace_buffer;
154 static int trace_buffer_size = -1;
158 char *trace_user = NULL;
162 char *trace_notes = NULL;
166 char *trace_stop_notes = NULL;
200 current_traceframe_info = NULL;
207 traceframe_number = num;
215 tracepoint_number = num;
226 struct symbol *traceframe_fun;
230 if (trace_frame != NULL
239 traceframe_sal.
line);
243 traceframe_fun = NULL;
249 if (traceframe_fun == NULL
258 if (traceframe_sal.
symtab == NULL)
272 memset (&tsv, 0,
sizeof (tsv));
274 tsv.
number = next_tsv_number++;
326 warning (
_(
"No trace variable named \"$%s\", not deleting"),
name);
338 error (
_(
"Must supply a non-empty variable name"));
342 for (p =
name; isdigit (*p); p++)
345 error (
_(
"$%s is not a valid trace state variable name"),
name);
347 for (p =
name; isalnum (*p) || *p ==
'_'; p++)
350 error (
_(
"$%s is not a valid trace state variable name"),
name);
361 const char *name_start, *p;
370 error (
_(
"Name of trace variable should start with '$'"));
373 while (isalnum (*p) || *p ==
'_')
378 if (*p !=
'=' && *p !=
'\0')
379 error (
_(
"Syntax must be $NAME [ = EXPR ]"));
396 "now has initial value %s.\n"),
408 "created, with initial value %s.\n"),
417 if (
query (
_(
"Delete all trace state variables? ")))
426 for (
char *arg :
argv)
431 warning (
_(
"Name \"%s\" not prefixed with '$', ignoring"), arg);
531 error (
_(
"This command cannot be used at the top level."));
537 error (
_(
"This command can only be used in a tracepoint actions list."));
543 error (
_(
"This command can only be used in a tracepoint actions list."));
549 error (
_(
"This command can only be used in a tracepoint actions list."));
578 if (*exp >=
'0' && *exp <=
'9')
579 *trace_string = atoi (exp);
580 while (*exp >=
'0' && *exp <=
'9')
584 error (
_(
"Target does not support \"/s\" option for string tracing."));
587 error (
_(
"Undefined collection format \"%c\"."), *exp);
604 string_printf (
"Enter actions for tracepoint %d, one per line.",
629 _(
"expression has min height < 0"));
638 error (
_(
"Expression is too complicated."));
666 error (
_(
"`%s' is not a tracepoint action, or is ambiguous."), p);
670 int trace_string = 0;
682 if (0 == strncasecmp (
"reg", p + 1, 3)
683 || 0 == strncasecmp (
"arg", p + 1, 3)
684 || 0 == strncasecmp (
"loc", p + 1, 3)
685 || 0 == strncasecmp (
"_ret", p + 1, 4)
686 || 0 == strncasecmp (
"_sdata", p + 1, 6))
700 if (exp->elts[0].opcode == OP_VAR_VALUE)
704 error (
_(
"constant `%s' (value %s) " 705 "will not be collected."),
712 error (
_(
"`%s' is optimized away " 713 "and cannot be collected."),
726 error (
_(
"Expression is too complicated."));
733 while (p && *p++ ==
',');
758 error (
_(
"Expression is too complicated."));
764 while (p && *p++ ==
',');
774 error (
_(
"while-stepping step count `%s' is malformed."), line);
782 error (
_(
"`%s' is not a supported tracepoint action."), line);
812 if (!memranges.empty ())
816 std::sort (memranges.begin (), memranges.end (),
memrange_comp);
818 for (a = 0, b = 1; b < memranges.size (); b++)
822 if (memranges[a].
type == memranges[b].
type 823 && memranges[b].start <= memranges[a].end)
825 if (memranges[b].end > memranges[a].end)
826 memranges[a].end = memranges[b].end;
831 memranges[a] = memranges[b];
833 memranges.resize (a + 1);
845 error (
_(
"Internal: register number %d too large for tracepoint"),
854 int type, bfd_signed_vma base,
874 long frame_regno,
long frame_offset,
881 int treat_as_expr = 0;
933 " from frame ptr reg %d\n",
957 " from frame ptr reg %d\n",
999 if (aexpr->reg_mask_len > 0)
1001 for (
int ndx1 = 0; ndx1 < aexpr->reg_mask_len; ndx1++)
1004 if (aexpr->reg_mask[ndx1] != 0)
1007 for (
int ndx2 = 0; ndx2 < 8; ndx2++)
1008 if (aexpr->reg_mask[ndx1] & (1 << ndx2))
1078 warning (
_(
"Can't collect locals; " 1079 "no symbol table info available.\n"));
1084 if (cb_data.
count == 0)
1085 warning (
_(
"No locals found in scope."));
1093 warning (
_(
"Can't collect args; no symbol table info available."));
1098 if (cb_data.
count == 0)
1099 warning (
_(
"No args found in scope."));
1113 m_strace_data (false)
1121 std::vector<std::string>
1124 char temp_buf[2048];
1128 std::vector<std::string> str_list;
1136 str_list.emplace_back (temp_buf, end - temp_buf);
1156 str_list.emplace_back (temp_buf);
1176 str_list.emplace_back (temp_buf,
count);
1182 bfd_signed_vma length
1197 count += strlen (end);
1198 end = temp_buf +
count;
1201 for (i = 0; i <
m_aexprs.size (); i++)
1206 str_list.emplace_back (temp_buf,
count);
1210 sprintf (end,
"X%08X,",
m_aexprs[i]->len);
1220 str_list.emplace_back (temp_buf,
count);
1254 const char *action_exp;
1256 struct value *tempval;
1259 for (; action; action = action->
next)
1262 action_exp = action->
line;
1267 error (
_(
"Bad action list item: %s"), action_exp);
1271 int trace_string = 0;
1273 if (*action_exp ==
'/')
1281 if (0 == strncasecmp (
"$reg", action_exp, 4))
1285 action_exp = strchr (action_exp,
',');
1287 else if (0 == strncasecmp (
"$arg", action_exp, 4))
1295 action_exp = strchr (action_exp,
',');
1297 else if (0 == strncasecmp (
"$loc", action_exp, 4))
1305 action_exp = strchr (action_exp,
',');
1307 else if (0 == strncasecmp (
"$_ret", action_exp, 5))
1318 if (aexpr->reg_mask_len > 0)
1320 for (
int ndx1 = 0; ndx1 < aexpr->reg_mask_len; ndx1++)
1323 if (aexpr->reg_mask[ndx1] != 0)
1326 for (
int ndx2 = 0; ndx2 < 8; ndx2++)
1327 if (aexpr->reg_mask[ndx1] & (1 << ndx2))
1337 action_exp = strchr (action_exp,
',');
1339 else if (0 == strncasecmp (
"$_sdata", action_exp, 7))
1342 action_exp = strchr (action_exp,
',');
1352 switch (exp->elts[0].opcode)
1356 const char *
name = &exp->elts[2].string;
1362 _(
"Register $%s not available"),
1384 struct symbol *sym = exp->elts[2].symbol;
1407 if (aexpr->reg_mask_len > 0)
1409 for (
int ndx1 = 0; ndx1 < aexpr->reg_mask_len; ndx1++)
1412 if (aexpr->reg_mask[ndx1] != 0)
1415 for (
int ndx2 = 0; ndx2 < 8; ndx2++)
1416 if (aexpr->reg_mask[ndx1] & (1 << ndx2))
1431 while (action_exp && *action_exp++ ==
',');
1456 while (action_exp && *action_exp++ ==
',');
1466 frame_offset, stepping_list, NULL);
1469 error (
_(
"Invalid tracepoint command '%s'"), action->
line);
1486 tloc->
address, &frame_reg, &frame_offset);
1491 tracepoint_list, stepping_list);
1493 tracepoint_list->
finish ();
1494 stepping_list->
finish ();
1501 std::vector<std::string> *tdp_actions,
1502 std::vector<std::string> *stepping_actions)
1508 *tdp_actions = tracepoint_list.
stringify ();
1509 *stepping_actions = stepping_list.
stringify ();
1515 m_aexprs.push_back (std::move (aexpr));
1524 int has_pending_p = 0;
1528 tp_vec = all_tracepoints ();
1540 for (loc1 = b->
loc; loc1; loc1 = loc1->
next)
1556 warning (
_(
"Pending tracepoints will not be resolved while" 1557 " GDB is disconnected\n"));
1578 int any_enabled = 0, num_to_download = 0;
1581 tp_vec = all_tracepoints ();
1587 error (
_(
"No tracepoints defined, not starting trace"));
1600 warning (
_(
"May not insert %stracepoints, skipping tracepoint %d"),
1607 warning (
_(
"No tracepoints enabled"));
1613 error (
_(
"No tracepoints enabled, not starting trace"));
1617 if (num_to_download <= 0)
1620 error (
_(
"No tracepoints that may be downloaded, not starting trace"));
1629 int bp_location_downloaded = 0;
1651 bp_location_downloaded = 1;
1657 if (
loc->probe.prob != NULL)
1658 loc->probe.prob->set_semaphore (
loc->probe.objfile,
1661 if (bp_location_downloaded)
1680 notes = trace_notes;
1683 if (!ret && (trace_user || notes))
1684 warning (
_(
"Target does not support trace user/notes, info ignored"));
1708 && !
query (
_(
"A trace is running already. Start a new run? ")))
1709 error (
_(
"New trace run not started."));
1724 error (
_(
"Trace is not running."));
1739 tp_vec = all_tracepoints ();
1755 if (
loc->probe.prob != NULL)
1756 loc->probe.prob->clear_semaphore (
loc->probe.objfile,
1764 note = trace_stop_notes;
1768 warning (
_(
"Target does not support trace notes, note ignored"));
1831 "error (%s, tracepoint %d).\n"),
1851 "frames (of %d created total).\n"),
1893 if (traceframe_number >= 0)
1895 traceframe_number, tracepoint_number);
1907 printf_filtered (
_(
"Trace started at %ld.%06ld secs, stopped %ld.%06ld secs later.\n"),
1910 (
long int) (run_time / 1000000),
1911 (
long int) (run_time % 1000000));
1924 tp_vec = all_tracepoints ();
2011 uiout->
field_int (
"stopping-tracepoint",
2038 xsnprintf (buf,
sizeof buf,
"%ld.%06ld",
2042 xsnprintf (buf,
sizeof buf,
"%ld.%06ld",
2076 if (!
query (
_(
"Trace is running and will " 2077 "continue after detach; detach anyway? ")))
2078 error (
_(
"Not confirmed."));
2082 if (!
query (
_(
"Trace is running but will " 2083 "stop on detach; detach anyway? ")))
2084 error (
_(
"Not confirmed."));
2109 int target_frameno = -1, target_tracept = -1;
2129 && target_frameno == -1)
2133 else if (target_frameno == -1)
2157 error (
_(
"Target failed to find requested trace frame."));
2182 if (target_frameno == -1)
2187 if (traceframe_number >= 0)
2194 uiout->
field_int (
"tracepoint", tracepoint_number);
2195 uiout->
field_int (
"traceframe", traceframe_number);
2200 traceframe_number, tracepoint_number);
2244 error (
_(
"May not look at trace frames while trace is running."));
2269 if (args == 0 || *args == 0)
2271 if (traceframe_number == -1)
2274 frameno = traceframe_number + 1;
2276 else if (0 == strcmp (args,
"-"))
2278 if (traceframe_number == -1)
2279 error (
_(
"not debugging trace buffer"));
2280 else if (from_tty && traceframe_number == 0)
2281 error (
_(
"already at start of trace buffer"));
2283 frameno = traceframe_number - 1;
2286 else if (0 == strcmp (args,
"-1"))
2292 error (
_(
"invalid input (%d is less than zero)"), frameno);
2325 if (args == 0 || *args == 0)
2342 if (args == 0 || *args == 0)
2344 if (tracepoint_number == -1)
2345 error (
_(
"No current tracepoint -- please supply an argument."));
2347 tdp = tracepoint_number;
2376 if (args == 0 || *args == 0)
2382 std::vector<symtab_and_line> sals
2388 error (
_(
"No line number information available."));
2393 if (start_pc == end_pc)
2406 && start_pc != end_pc)
2410 error (
_(
"Cannot find a good line."));
2417 error (
_(
"Line number %d is out of range for \"%s\"."),
2436 if (args == 0 || *args == 0)
2442 if (0 != (tmp = strchr (args,
',')))
2468 error (
_(
"May not look at trace frames while trace is running."));
2470 if (args == 0 || *args == 0)
2476 if (0 != (tmp = strchr (args,
',')))
2500 const char *symname;
2501 const char *save_args = args_in;
2506 const char *args = args_in;
2508 if (args == 0 || *args == 0)
2509 error (
_(
"requires an argument (function, " 2510 "line or *addr) to define a scope"));
2514 std::vector<symtab_and_line> sals
2538 if (symname == NULL || *symname ==
'\0')
2668 int stepping_actions,
int stepping_frame,
2671 const char *action_exp, *next_comma;
2673 for (; action != NULL; action = action->
next)
2678 action_exp = action->
line;
2684 if (*action_exp ==
'#')
2689 error (
_(
"Bad action list item: %s"), action_exp);
2697 1, stepping_frame, from_tty);
2707 if (stepping_frame == stepping_actions)
2712 int trace_string = 0;
2714 if (*action_exp ==
'/')
2720 if (*action_exp ==
',')
2724 next_comma = strchr (action_exp,
',');
2726 if (0 == strncasecmp (action_exp,
"$reg", 4))
2728 else if (0 == strncasecmp (action_exp,
"$_ret", 5))
2730 else if (0 == strncasecmp (action_exp,
"$loc", 4))
2732 else if (0 == strncasecmp (action_exp,
"$arg", 4))
2736 if (next_comma != NULL)
2738 size_t len = next_comma - action_exp;
2740 cmd = (
char *)
xrealloc (cmd, len + 1);
2741 memcpy (cmd, action_exp, len);
2746 size_t len = strlen (action_exp);
2748 cmd = (
char *)
xrealloc (cmd, len + 1);
2749 memcpy (cmd, action_exp, len + 1);
2756 action_exp = next_comma;
2758 while (action_exp && *action_exp ==
',');
2777 if (tracepoint_number == -1)
2778 error (
_(
"No current trace frame."));
2783 error (
_(
"No known tracepoint matches 'current' tracepoint #%d."),
2795 for (tloc = t->
loc; tloc; tloc = tloc->
next)
2798 *stepping_frame_p = 0;
2804 *stepping_frame_p = 1;
2827 char *default_collect_line;
2835 default_collect_action->
next = actions;
2836 default_collect_action->
line = default_collect_line;
2837 actions = default_collect_action;
2848 int stepping_frame = 0;
2855 printf_filtered (
"Data collected at tracepoint %d, trace frame %d:\n",
2856 tracepoint_number, traceframe_number);
2876 const char *srctype,
const char *src,
2877 char *buf,
int buf_size)
2879 if (80 + strlen (srctype) > buf_size)
2880 error (
_(
"Buffer too small for source encoding"));
2881 sprintf (buf,
"%x:%s:%s:%x:%x:",
2882 tpnum,
phex_nz (addr,
sizeof (addr)),
2883 srctype, 0, (
int) strlen (src));
2884 if (strlen (buf) + strlen (src) * 2 >= buf_size)
2885 error (
_(
"Source string too long for buffer"));
2923 warning (
_(
"Target does not support trace notes, user ignored"));
2935 warning (
_(
"Target does not support trace notes, note ignored"));
2947 warning (
_(
"Target does not support trace notes, stop note ignored"));
2978 return traceframe_number;
2984 return tracepoint_number;
2995 if (traceframe_number == num)
3004 warning (
_(
"could not change traceframe"));
3061 for (utp = *utpp; utp; utp = utp->
next)
3068 utp->actions = NULL;
3069 utp->step_actions = NULL;
3070 utp->cmd_strings = NULL;
3084 next_one = (*utpp)->
next;
3098 for (utsv = *utsvp; utsv; utsv = utsv->
next)
3104 utsv->
next = *utsvp;
3117 next_one = (*utsvp)->
next;
3130 if (str1 == NULL || str2 == NULL)
3131 return (str1 == str2);
3133 return (strcmp (str1, str2) == 0);
3185 for (utp = *uploaded_tps; utp; utp = utp->
next)
3199 "as target's tracepoint %d at %s.\n"),
3224 "target's tracepoint %d at %s.\n"),
3229 "tracepoint %d at %s, skipping it.\n"),
3264 const char *namebase;
3271 namebase = utsv->
name;
3311 for (utsv = *uploaded_tsvs; utsv; utsv = utsv->
next)
3318 "is same as target's variable %d.\n"),
3326 "$%s for target's variable %d.\n"),
3337 if (tsv->
number > highest)
3354 const char *p = line, *p1, *p2, *p3, *p_temp;
3377 p1 = strchr (p,
':');
3379 error (
_(
"Malformed trace status, at %s\n\ 3380 Status line: '%s'\n"), p, line);
3381 p3 = strchr (p,
';');
3383 p3 = p + strlen (p);
3403 p2 = strchr (++p1,
':');
3428 p2 = strchr (++p1,
':');
3442 else if (strncmp (p,
"tframes", p1 - p) == 0)
3447 else if (strncmp (p,
"tcreated", p1 - p) == 0)
3452 else if (strncmp (p,
"tfree", p1 - p) == 0)
3457 else if (strncmp (p,
"tsize", p1 - p) == 0)
3462 else if (strncmp (p,
"disconn", p1 - p) == 0)
3467 else if (strncmp (p,
"circular", p1 - p) == 0)
3472 else if (strncmp (p,
"starttime", p1 - p) == 0)
3477 else if (strncmp (p,
"stoptime", p1 - p) == 0)
3482 else if (strncmp (p,
"username", p1 - p) == 0)
3490 else if (strncmp (p,
"notes", p1 - p) == 0)
3495 ts->
notes[end] =
'\0';
3501 p_temp = strchr (p1 + 1,
';');
3539 ULONGEST num, addr, step, pass, orig_size, xlen, start;
3542 const char *srctype;
3584 strncpy (
cond, p, 2 * xlen);
3585 cond[2 * xlen] =
'\0';
3589 warning (
_(
"Unrecognized char '%c' in tracepoint " 3590 "definition, skipping rest"), *p);
3599 else if (piece ==
'A')
3604 else if (piece ==
'S')
3609 else if (piece ==
'Z')
3614 p = strchr (p,
':');
3621 buf = (
char *) alloca (strlen (line));
3633 else if (piece ==
'V')
3643 warning (
_(
"Unrecognized tracepoint piece '%c', ignoring"), piece);
3659 buf = (
char *) alloca (strlen (line));
3674 utsv->
name = xstrdup (buf);
3683 if (*marker_p != NULL)
3701 const char *p, *endp;
3712 endp = strchr (p,
':');
3714 error (
_(
"bad marker definition: %s"), line);
3718 marker->
str_id[end] =
'\0';
3725 marker->
extra[end] =
'\0';
3751 char extra_field_indent[80];
3758 tracepoints = static_tracepoints_here (marker->
address);
3779 strcpy (extra_field_indent,
" ");
3787 uiout->
text (
"in ");
3791 uiout->
text (
" at ");
3820 uiout->
text (extra_field_indent);
3821 uiout->
text (
_(
"Data: \""));
3823 uiout->
text (
"\"\n");
3833 uiout->
text (extra_field_indent);
3834 uiout->
text (
_(
"Probed by static tracepoints: "));
3845 uiout->
field_int (
"number-of-tracepoints",
3869 "StaticTracepointMarkersTable");
3889 markers, i, marker);
3909 static struct value *
3936 #if !defined(HAVE_LIBEXPAT) 3941 static int have_warned;
3946 warning (
_(
"Can not parse XML trace frame info; XML support " 3947 "was disabled at compile time"));
3972 info->
memory.emplace_back (*start_p, *length_p);
3984 const char *id_attrib
3988 info->
tvars.push_back (
id);
4029 tframe_info, result.get ()) == 0)
4044 if (current_traceframe_info == NULL)
4047 return current_traceframe_info.get ();
4072 hi1 = memaddr + len;
4078 int length = std::min (hi1, hi2) - start;
4080 result->emplace_back (start, length);
4111 traceframe_number = -1;
4112 tracepoint_number = -1;
4115 _(
"List the variables local to a scope"));
4118 _(
"Tracing of program execution without stopping the program."),
4122 _(
"Print everything collected at the current tracepoint."));
4125 Define a trace state variable.\n\ 4126 Argument is a $-prefixed name, optionally followed\n\ 4127 by '=' and an expression that sets the initial value\n\ 4128 at the start of tracing."));
4132 Delete one or more trace state variables.\n\ 4133 Arguments are the names of the variables to delete.\n\ 4134 If no arguments are supplied, delete all variables."), &
deletelist);
4138 Status of trace state variables and their values.\n\ 4141 add_info (
"static-tracepoint-markers",
4143 List target static tracepoints markers.\n\ 4147 Select a trace frame;\n\ 4148 No argument means forward by one frame; '-' means backward by one frame."),
4149 &tfindlist,
"tfind ", 1, &
cmdlist);
4152 Select a trace frame whose PC is outside the given range (exclusive).\n\ 4153 Usage: tfind outside addr1, addr2"),
4157 Select a trace frame whose PC is in the given range (inclusive).\n\ 4158 Usage: tfind range addr1,addr2"),
4162 Select a trace frame by source line.\n\ 4163 Argument can be a line number (with optional source file),\n\ 4164 a function name, or '*' followed by an address.\n\ 4165 Default argument is 'the next source line that was traced'."),
4169 Select a trace frame by tracepoint number.\n\ 4170 Default is the tracepoint for the current trace frame."),
4174 Select a trace frame by PC.\n\ 4175 Default is the current PC, or the PC of the current trace frame."),
4179 De-select any trace frame and resume 'live' debugging."),
4185 _(
"Select the first trace frame in the trace buffer."),
4189 _(
"Display the status of the current trace data collection."));
4192 Stop trace data collection.\n\ 4193 Usage: tstop [ <notes> ... ]\n\ 4194 Any arguments supplied are recorded with the trace as a stop reason and\n\ 4195 reported by tstatus (if the target supports trace notes)."));
4198 Start trace data collection.\n\ 4199 Usage: tstart [ <notes> ... ]\n\ 4200 Any arguments supplied are recorded with the trace as a note and\n\ 4201 reported by tstatus (if the target supports trace notes)."));
4204 Ends a list of commands or actions.\n\ 4205 Several GDB commands allow you to enter a list of commands or actions.\n\ 4206 Entering \"end\" on a line by itself is the normal way to terminate\n\ 4208 Note: the \"end\" command cannot be used at the gdb prompt."));
4211 Specify single-stepping behavior at a tracepoint.\n\ 4212 Argument is number of instructions to trace in single-step mode\n\ 4213 following the tracepoint. This command is normally followed by\n\ 4214 one or more \"collect\" commands, to specify what to collect\n\ 4215 while single-stepping.\n\n\ 4216 Note: this command can only be used in a tracepoint \"actions\" list."));
4222 Specify one or more data items to be collected at a tracepoint.\n\ 4223 Accepts a comma-separated list of (one or more) expressions. GDB will\n\ 4224 collect all data (variables, registers) referenced by that expression.\n\ 4225 Also accepts the following special arguments:\n\ 4226 $regs -- all registers.\n\ 4227 $args -- all function arguments.\n\ 4228 $locals -- all variables local to the block/function scope.\n\ 4229 $_sdata -- static tracepoint data (ignored for non-static tracepoints).\n\ 4230 Note: this command can only be used in a tracepoint \"actions\" list."));
4233 Specify one or more expressions to be evaluated at a tracepoint.\n\ 4234 Accepts a comma-separated list of (one or more) expressions.\n\ 4235 The result of each evaluation will be discarded.\n\ 4236 Note: this command can only be used in a tracepoint \"actions\" list."));
4239 Specify the actions to be taken at a tracepoint.\n\ 4240 Tracepoint actions may include collecting of specified data,\n\ 4241 single-stepping, or enabling/disabling other tracepoints,\n\ 4242 depending on target's capabilities."));
4247 Set the list of expressions to collect by default"),
_(
"\ 4248 Show the list of expressions to collect by default"), NULL,
4253 &disconnected_tracing,
_(
"\ 4254 Set whether tracing continues after GDB disconnects."),
_(
"\ 4255 Show whether tracing continues after GDB disconnects."),
_(
"\ 4256 Use this to continue a tracing run even if GDB disconnects\n\ 4257 or detaches from the target. You can reconnect later and look at\n\ 4258 trace data collected in the meantime."),
4265 &circular_trace_buffer,
_(
"\ 4266 Set target's use of circular trace buffer."),
_(
"\ 4267 Show target's use of circular trace buffer."),
_(
"\ 4268 Use this to make the trace buffer into a circular buffer,\n\ 4269 which will discard traceframes (oldest first) instead of filling\n\ 4270 up and stopping the trace run."),
4277 &trace_buffer_size,
_(
"\ 4278 Set requested size of trace buffer."),
_(
"\ 4279 Show requested size of trace buffer."),
_(
"\ 4280 Use this to choose a size for the trace buffer. Some targets\n\ 4281 may have fixed or limited buffer sizes. Specifying \"unlimited\" or -1\n\ 4282 disables any attempt to set the buffer size and lets the target choose."),
4288 Set the user name to use for current and future trace runs"),
_(
"\ 4289 Show the user name to use for current and future trace runs"), NULL,
4295 Set notes string to use for current and future trace runs"),
_(
"\ 4296 Show the notes string to use for current and future trace runs"), NULL,
4301 &trace_stop_notes,
_(
"\ 4302 Set notes string to use for future tstop commands"),
_(
"\ 4303 Show the notes string to use for future tstop commands"), NULL,
void error_no_arg(const char *why)
struct gdbarch * target_gdbarch(void)
static void set_trace_user(const char *args, int from_tty, struct cmd_list_element *c)
static void tstatus_command(const char *args, int from_tty)
std::vector< std::string > m_wholly_collected
char * hex_string(LONGEST num)
std::vector< mem_range > memory
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)
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)
struct frame_info * get_selected_frame(const char *message)
static const char hexchars[]
void field_core_addr(const char *fldname, struct gdbarch *gdbarch, CORE_ADDR address)
CORE_ADDR get_frame_pc(struct frame_info *frame)
#define SYMBOL_PRINT_NAME(symbol)
std::unique_ptr< agent_expr > agent_expr_up
void check_tracepoint_command(char *line, void *closure)
struct frame_info * get_current_frame(void)
void field_string(const char *fldname, const char *string)
void ax_reqs(struct agent_expr *ax)
static void print_one_static_tracepoint_marker(int count, struct static_tracepoint_marker *marker)
void print_address(struct gdbarch *, CORE_ADDR, struct ui_file *)
struct cleanup * make_cleanup_restore_current_traceframe(void)
gdb::unique_xmalloc_ptr< expression > expression_up
int may_insert_fast_tracepoints
static void info_static_tracepoint_markers_command(const char *arg, int from_tty)
LONGEST value_as_long(struct value *val)
static const struct internalvar_funcs sdata_funcs
#define BMSYMBOL_VALUE_ADDRESS(symbol)
void stop_tracing(const char *note)
void warning(const char *fmt,...)
void void wrap_hint(const char *identstring)
regcache(gdbarch *gdbarch)
void add_aexpr(agent_expr_up aexpr)
int cmd_cfunc_eq(struct cmd_list_element *cmd, cmd_const_cfunc_ftype *cfunc)
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 * 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)
static void tfind_tracepoint_command(const char *args, int from_tty)
void field_skip(const char *fldname)
static void set_trace_stop_notes(const char *args, int from_tty, struct cmd_list_element *c)
struct cmd_list_element * add_info(const char *name, cmd_const_cfunc_ftype *fun, const char *doc)
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 * memset(T *s, int c, size_t n)=delete
void internal_error(const char *file, int line, const char *fmt,...)
const struct frame_id null_frame_id
void table_header(int width, ui_align align, const std::string &col_name, const std::string &col_hdr)
static void collect_pseudocommand(const char *args, int from_tty)
struct cmd_list_element * lookup_cmd(const char **line, struct cmd_list_element *list, const char *cmdtype, int allow_unknown, int ignore_help_classes)
#define target_set_trace_buffer_size(val)
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(* deprecated_trace_start_stop_hook)(int start, int from_tty)
void trace_status_mi(int on_stop)
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **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)
expression_up parse_exp_1(const char **, CORE_ADDR pc, const struct block *, int)
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)
#define VEC_safe_push(T, V, O)
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)
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)
ULONGEST traceframe_usage
#define target_get_tracepoint_status(tp, utp)
static void teval_pseudocommand(const char *args, int from_tty)
command_line_up read_command_lines(char *prompt_arg, int from_tty, int parse_commands, void(*validator)(char *, void *), void *closure)
struct value * allocate_value(struct type *type)
void text(const char *string)
static void process_tracepoint_on_disconnect(void)
struct regcache * get_current_regcache(void)
const struct block * block_for_pc(CORE_ADDR pc)
static void actions_command(const char *args, int from_tty)
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 info_tvariables_command(const 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)
const char * symtab_to_fullname(struct symtab *s)
struct cmd_list_element * add_prefix_cmd(const char *name, enum command_class theclass, cmd_const_cfunc_ftype *fun, const char *doc, struct cmd_list_element **prefixlist, const char *prefixname, int allow_unknown, struct cmd_list_element **list)
struct trace_status * current_trace_status(void)
#define target_get_trace_state_variable_value(tsv, val)
struct value * evaluate_expression(struct expression *exp)
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)
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)
struct frame_id get_frame_id(struct frame_info *fi)
std::vector< std::string > m_computed
struct type * check_typedef(struct type *type)
#define SYMBOL_VALUE_ADDRESS(symbol)
void target_dcache_invalidate(void)
#define MAX_AGENT_EXPR_LEN
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)
void info_locals_command(const char *, int)
static void end_actions_pseudocommand(const char *args, int from_tty)
struct tracepoint * create_tracepoint_from_upload(struct uploaded_tp *utp)
struct uploaded_tsv * get_uploaded_tsv(int num, struct uploaded_tsv **utsvp)
int gdb_xml_parse_quick(const char *name, const char *dtd_name, const struct gdb_xml_element *elements, const char *document, void *user_data)
struct target_ops current_target
struct gdb_xml_value * xml_find_attribute(VEC(gdb_xml_value_s) *attributes, const char *name)
static const char * wrap_indent
struct symtab_and_line find_pc_line(CORE_ADDR pc, int notcurrent)
struct tracepoint * get_tracepoint_by_number(const char **arg, number_or_range_parser *parser)
struct uploaded_tsv * next
static void set_trace_buffer_size(const char *args, int from_tty, struct cmd_list_element *c)
void merge_uploaded_trace_state_variables(struct uploaded_tsv **uploaded_tsvs)
void fprintf_filtered(struct ui_file *stream, const char *format,...)
void free_current_marker(void *arg)
struct symbol * find_pc_function(CORE_ADDR pc)
void set_cmd_completer(struct cmd_list_element *cmd, completer_ftype *completer)
static void set_trace_notes(const char *args, int from_tty, struct cmd_list_element *c)
void add_static_trace_data()
static void tfind_outside_command(const char *args, int from_tty)
void trace_reset_local_state(void)
static const struct gdb_xml_attribute memory_attributes[]
void fprintf_unfiltered(struct ui_file *stream, const char *format,...)
void append_exp(struct expression *exp)
static void tfind_end_command(const char *args, int from_tty)
int traceframe_available_memory(std::vector< mem_range > *result, CORE_ADDR memaddr, ULONGEST len)
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
#define gdb_assert_not_reached(message)
static void trace_dump_actions(struct command_line *action, int stepping_actions, int stepping_frame, int from_tty)
void free_current_contents(void *ptr)
void parse_tracepoint_status(const char *p, struct breakpoint *bp, struct uploaded_tp *utp)
void collect_symbol(struct symbol *sym, struct gdbarch *gdbarch, long frame_regno, long frame_offset, CORE_ADDR scope, int trace_string)
#define SYMBOL_REGISTER_OPS(symbol)
#define SYMBOL_COMPUTED_OPS(symbol)
void normalize_mem_ranges(std::vector< mem_range > *memory)
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)
void parse_trace_status(const char *line, struct trace_status *ts)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
traceframe_info_up parse_traceframe_info(const char *tframe_info)
static void trace_variable_command(const char *args, int from_tty)
static void tdump_command(const char *args, int from_tty)
struct type * init_vector_type(struct type *elt_type, int n)
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_const_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
static void tfind_start_command(const char *args, int from_tty)
#define BLOCK_SUPERBLOCK(bl)
struct gdbarch * get_current_arch(void)
unsigned char m_regs_mask[32]
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)
#define SYMBOL_LINKAGE_NAME(symbol)
const char * gdbarch_register_name(struct gdbarch *gdbarch, int regnr)
#define target_static_tracepoint_markers_by_strid(marker_id)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int status
static void tfind_range_command(const char *args, int from_tty)
#define target_download_tracepoint(t)
static int startswith(const char *string, const char *pattern)
void observer_notify_tsv_modified(const struct trace_state_variable *tsv)
void start_tracing(const char *notes)
void add_wholly_collected(const char *print_name)
static void set_disconnected_tracing(const char *args, int from_tty, struct cmd_list_element *c)
std::unique_ptr< event_location, event_location_deleter > event_location_up
#define target_set_trace_notes(user, notes, stopnotes)
int gdbarch_addr_bit(struct gdbarch *gdbarch)
std::vector< memrange > m_memranges
char * xstrprintf(const char *format,...)
void validate_trace_state_variable_name(const char *name)
void printf_unfiltered(const char *format,...)
void check_trace_running(struct trace_status *status)
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[]
agent_expr_up gen_trace_for_expr(CORE_ADDR scope, struct expression *expr, int trace_string)
#define target_download_trace_state_variable(tsv)
void breakpoint_set_commands(struct breakpoint *b, command_line_up &&commands)
std::vector< std::string > stringify()
struct cmd_list_element * add_alias_cmd(const char *name, cmd_list_element *old, enum command_class theclass, int abbrev_flag, struct cmd_list_element **list)
static struct value * sdata_make_value(struct gdbarch *gdbarch, struct internalvar *var, void *ignore)
#define SYMBOL_VALUE(symbol)
void void spaces(int numspaces)
static struct trace_state_variable * create_tsv_from_upload(struct uploaded_tsv *utsv)
std::vector< symtab_and_line > decode_line_1(const struct event_location *location, int flags, struct program_space *search_pspace, struct symtab *default_symtab, int default_line)
#define target_traceframe_info()
agent_expr_up gen_trace_for_return_address(CORE_ADDR scope, struct gdbarch *gdbarch, int trace_string)
void wrap_here(const char *indent)
static void tfind_command_1(const 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)
static void restore_current_traceframe_cleanup_dtor(void *arg)
void observer_notify_tsv_deleted(const struct trace_state_variable *tsv)
struct command_line * next
int find_line_pc_range(struct symtab_and_line sal, CORE_ADDR *startptr, CORE_ADDR *endptr)
std::unique_ptr< traceframe_info > traceframe_info_up
int get_tracepoint_number(void)
const struct language_defn * current_language
static int cond_string_is_same(char *str1, char *str2)
char * phex_nz(ULONGEST l, int sizeof_l)
int encode_source_string(int tpnum, ULONGEST addr, const char *srctype, const char *src, char *buf, int buf_size)
void tfind_1(enum trace_find_type type, int num, CORE_ADDR addr1, CORE_ADDR addr2, int from_tty)
static bool memrange_comp(const memrange &a, const memrange &b)
agent_expr_up gen_trace_for_var(CORE_ADDR scope, struct gdbarch *gdbarch, struct symbol *var, int trace_string)
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)
#define TYPE_CODE(thistype)
void set_internalvar_string(struct internalvar *var, const char *string)
void field_int(const char *fldname, int value)
void expression_completer(struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *word)
CORE_ADDR regcache_read_pc(struct regcache *regcache)
struct minimal_symbol * minsym
void set_internalvar_integer(struct internalvar *var, LONGEST l)
std::vector< symtab_and_line > decode_line_with_current_source(const char *string, int flags)
void get_user_print_options(struct value_print_options *opts)
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_const_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void set_current_traceframe(int num)
void tvariables_info_1(void)
void registers_changed(void)
static void set_traceframe_num(int num)
static void tfind_line_command(const char *args, int from_tty)
void parse_tsv_definition(const char *line, struct uploaded_tsv **utsvp)
static void tfind_pc_command(const char *args, int from_tty)
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 _initialize_tracepoint(void)
std::string string_printf(const char *fmt,...)
#define SYMBOL_NATURAL_NAME(symbol)
gdb_xml_attribute_handler gdb_xml_parse_attr_ulongest
void add_memrange(struct gdbarch *gdbarch, int type, bfd_signed_vma base, unsigned long len)
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)
void encode_actions(struct bp_location *tloc, struct collection_list *tracepoint_list, struct collection_list *stepping_list)
#define target_trace_set_readonly_regions()
static void tfind_command(const char *args, int from_tty)
int register_size(struct gdbarch *gdbarch, int regnum)
static void delete_trace_variable_command(const char *args, int from_tty)
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)
void add_register(unsigned int regno)
struct trace_state_variable * find_trace_state_variable(const char *name)
#define SYMBOL_TYPE(symbol)
struct trace_state_variable * find_trace_state_variable_by_number(int number)
agent_expr_up gen_eval_for_expr(CORE_ADDR scope, struct expression *expr)
void registers_info(const char *addr_exp, int fpregs)
int hex2bin(const char *hex, gdb_byte *bin, int count)
std::unique_ptr< command_line, command_lines_deleter > command_line_up
gdb_byte * value_contents_raw(struct value *value)
static void info_scope_command(const char *args_in, int from_tty)
#define TYPE_LENGTH(thistype)
const char * unpack_varlen_hex(const char *buff, ULONGEST *result)
static void clear_traceframe_info(void)
void output_command_const(const char *exp, int from_tty)
void reinit_frame_cache(void)
CORE_ADDR get_pc_function_start(CORE_ADDR pc)
static void tstart_command(const char *args, int from_tty)
#define SYMBOL_VALUE_BYTES(symbol)
void resolve_sal_pc(struct symtab_and_line *sal)
static void set_traceframe_context(struct frame_info *trace_frame)
struct cmd_list_element * add_com(const char *name, enum command_class theclass, cmd_const_cfunc_ftype *fun, const char *doc)
enum enable_state enable_state
void info_args_command(const char *, int)
CORE_ADDR value_address(const struct value *value)
struct bound_minimal_symbol lookup_minimal_symbol(const char *name, const char *sfile, struct objfile *objf)
static void tstop_command(const char *args, int from_tty)
struct command_line ** body_list
void query_if_trace_running(int from_tty)
int has_stack_frames(void)
#define target_trace_stop()
void add_local_symbols(struct gdbarch *gdbarch, CORE_ADDR pc, long frame_regno, long frame_offset, int type, int trace_string)
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)
void parse_static_tracepoint_marker_definition(const char *line, const char **pp, struct static_tracepoint_marker *marker)
#define target_trace_init()
event_location_up string_to_event_location(const char **stringp, const struct language_defn *language, symbol_name_match_type match_type)
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_const_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void error(const char *fmt,...)
#define ALL_BLOCK_SYMBOLS(block, iter, sym)
void parse_tracepoint_definition(const char *line, struct uploaded_tp **utpp)
std::vector< agent_expr_up > m_aexprs
static void set_circular_trace_buffer(const char *args, int from_tty, struct cmd_list_element *c)
static void memrange_sortmerge(std::vector< memrange > &memranges)
void do_cleanups(struct cleanup *old_chain)
void observer_notify_tsv_created(const struct trace_state_variable *tsv)
#define SYMBOL_IS_ARGUMENT(symbol)
void field_fmt(const char *fldname, const char *format,...) ATTRIBUTE_PRINTF(3
void observer_notify_breakpoint_modified(struct breakpoint *b)
void encode_actions_rsp(struct bp_location *tloc, std::vector< std::string > *tdp_actions, std::vector< std::string > *stepping_actions)
#define target_supports_string_tracing()
static void while_stepping_pseudocommand(const char *args, int from_tty)
static const struct gdb_xml_element traceframe_info_elements[]
LONGEST parse_and_eval_long(const char *exp)