40 if (val->
type ()->
code () == TYPE_CODE_INT)
43 error (_(
"History value must have integer type."));
49 const char *start = ++p;
50 while (isalnum (*p) || *p ==
'_')
52 std::string varname (start, p - start);
55 error (_(
"Convenience variable $%s does not have integer value."),
62 retval = strtoulst (p, &end, 0);
66 error (_(
"Expected integer at: %s"), p);
71 if (!(isspace (*p) || *p ==
'\0' || *p == trailer))
72 error (_(
"Trailing junk at: %s"), p);
85 bool negative =
false;
99 if (val->
type ()->
code () == TYPE_CODE_INT)
103 gdb_printf (_(
"History value must have integer type.\n"));
112 const char *start = ++p;
115 while (isalnum (*p) || *p ==
'_')
117 varname = (
char *) alloca (p - start + 1);
118 strncpy (varname, start, p - start);
119 varname[p - start] =
'\0';
122 retval = (int) longest_val;
126 "have integer value.\n"));
134 while (*p >=
'0' && *p <=
'9')
140 while (*p && !isspace((
int) *p))
148 if (!(isspace (*p) || *p ==
'\0' || *p == trailer))
151 while (!(isspace (*p) || *p ==
'\0' || *p == trailer))
157 return negative ? -retval : retval;
188 error (_(
"Unrecognized option '%s' to %s command. "
189 "Try \"help %s\"."), option.c_str (),
197 const char *entity_kind,
198 bool document_n_flag)
200 return xstrprintf (_(
"\
201%sIf NAMEREGEXP is provided, only prints the %s whose name\n\
202matches NAMEREGEXP.\n\
203If -t TYPEREGEXP is provided, only prints the %s whose type\n\
204matches TYPEREGEXP. Note that the matching is done with the type\n\
205printed by the 'whatis' command.\n\
206By default, the command might produce headers and/or messages indicating\n\
207why no %s can be printed.\n\
208The flag -q disables the production of these headers and messages.%s"),
209 prefix, entity_kind, entity_kind, entity_kind,
210 (document_n_flag ? _(
"\n\
211By default, the command will include non-debug symbols in the output;\n\
212these can be excluded using the -n flag.") :
"")).release ();
282 error (_(
"inverted range"));
298 error (_(
"negative value"));
304 error (_(
"negative value"));
316 gdb_assert (start_value > 0);
350 if (list == NULL || *list ==
'\0')
356 error (_(
"Arguments must be numbers or '$' variables."));
362 error (_(
"Arguments must be numbers or '$' variables."));
363 if (gotnum == number)
374 while (s > start && isspace (*(s - 1)))
388 return std::string ();
391 *arg = skip_spaces (*arg);
393 return std::string ();
397 *arg = skip_to_space (*arg + 1);
400 return std::string ();
402 return std::string (result, *arg - result);
410 const char *arg_const = *arg;
414 *arg += arg_const - *arg;
423 if (strncmp (*str, arg, arg_len) == 0
424 && ((*str)[arg_len] ==
'\0' || isspace ((*str)[arg_len])))
427 *str = skip_spaces (*str);
439 error (_(
"%s: -c and -s are mutually exclusive"), which_command);
void init(const char *string)
void setup_range(int start_value, int end_value, const char *end_ptr)
const char * info_print_args_help(const char *prefix, const char *entity_kind, bool document_n_flag)
void report_unrecognized_option_error(const char *command, const char *args)
int get_number(const char **pp)
int number_is_in_list(const char *list, int number)
ULONGEST get_ulongest(const char **pp, int trailer)
void validate_flags_qcs(const char *which_command, qcs_flags *flags)
int check_for_argument(const char **str, const char *arg, int arg_len)
const char * remove_trailing_whitespace(const char *start, const char *s)
std::string extract_arg(const char **arg)
int get_number_trailer(const char **pp, int trailer)
int get_number_trailer(const char **pp, int trailer)
mach_port_t kern_return_t mach_port_t mach_msg_type_name_t msgportsPoly mach_port_t kern_return_t pid_t pid mach_port_t kern_return_t mach_port_t task mach_port_t kern_return_t int flags
#define prefix(a, b, R, do)
struct type * type() const
void gdb_printf(struct ui_file *stream, const char *format,...)
struct value * value_from_history_ref(const char *h, const char **endp)
struct internalvar * lookup_internalvar(const char *name)
LONGEST value_as_long(struct value *val)
int get_internalvar_integer(struct internalvar *var, LONGEST *result)