/* SystemTap probe support for GDB.
- Copyright (C) 2012-2015 Free Software Foundation, Inc.
+ Copyright (C) 2012-2017 Free Software Foundation, Inc.
This file is part of GDB.
len = p->arg - start;
- regname = alloca (len + gdb_reg_prefix_len + gdb_reg_suffix_len + 1);
+ regname = (char *) alloca (len + gdb_reg_prefix_len + gdb_reg_suffix_len + 1);
regname[0] = '\0';
/* We only add the GDB's register prefix/suffix if we are dealing with
We handle the register displacement here, and the other cases
recursively. */
if (p->inside_paren_p)
- tmp = skip_spaces_const (tmp);
+ tmp = skip_spaces (tmp);
while (isdigit (*tmp))
{
tmp = endp;
if (p->inside_paren_p)
- tmp = skip_spaces_const (tmp);
+ tmp = skip_spaces (tmp);
/* If "stap_is_integer_prefix" returns true, it means we can
accept integers without a prefix here. But we also need to
have to parse it as it was a separate expression, without
left-side or precedence. */
++p->arg;
- p->arg = skip_spaces_const (p->arg);
+ p->arg = skip_spaces (p->arg);
++p->inside_paren_p;
stap_parse_argument_1 (p, 0, STAP_OPERAND_PREC_NONE);
++p->arg;
if (p->inside_paren_p)
- p->arg = skip_spaces_const (p->arg);
+ p->arg = skip_spaces (p->arg);
}
else
error (_("Cannot parse expression `%s'."), p->saved_arg);
gdb_assert (p->arg != NULL);
if (p->inside_paren_p)
- p->arg = skip_spaces_const (p->arg);
+ p->arg = skip_spaces (p->arg);
if (!has_lhs)
{
p->arg = tmp_exp_buf;
if (p->inside_paren_p)
- p->arg = skip_spaces_const (p->arg);
+ p->arg = skip_spaces (p->arg);
/* Parse the right-side of the expression. */
stap_parse_argument_conditionally (p);
reallocate_expout (&p.pstate);
- p.arg = skip_spaces_const (p.arg);
+ p.arg = skip_spaces (p.arg);
*arg = p.arg;
/* We can safely return EXPOUT here. */
arg.aexpr = expr;
/* Start it over again. */
- cur = skip_spaces_const (cur);
+ cur = skip_spaces (cur);
VEC_safe_push (stap_probe_arg_s, probe->args_u.vec, &arg);
}
static void
handle_stap_probe (struct objfile *objfile, struct sdt_note *el,
- VEC (probe_p) **probesp, CORE_ADDR base)
+ std::vector<probe *> *probesp, CORE_ADDR base)
{
bfd *abfd = objfile->obfd;
int size = bfd_get_arch_size (abfd) / 8;
/* Provider and the name of the probe. */
ret->p.provider = (char *) &el->data[3 * size];
- ret->p.name = memchr (ret->p.provider, '\0',
- (char *) el->data + el->size - ret->p.provider);
+ ret->p.name = ((const char *)
+ memchr (ret->p.provider, '\0',
+ (char *) el->data + el->size - ret->p.provider));
/* Making sure there is a name. */
if (ret->p.name == NULL)
{
/* Arguments. We can only extract the argument format if there is a valid
name for this probe. */
- probe_args = memchr (ret->p.name, '\0',
- (char *) el->data + el->size - ret->p.name);
+ probe_args = ((const char*)
+ memchr (ret->p.name, '\0',
+ (char *) el->data + el->size - ret->p.name));
if (probe_args != NULL)
++probe_args;
ret->args_u.text = probe_args;
/* Successfully created probe. */
- VEC_safe_push (probe_p, *probesp, (struct probe *) ret);
+ probesp->push_back ((struct probe *) ret);
}
/* Helper function which tries to find the base address of the SystemTap
static void
get_stap_base_address_1 (bfd *abfd, asection *sect, void *obj)
{
- asection **ret = obj;
+ asection **ret = (asection **) obj;
if ((sect->flags & (SEC_DATA | SEC_ALLOC | SEC_HAS_CONTENTS))
&& sect->name && !strcmp (sect->name, STAP_BASE_SECTION_NAME))
SystemTap probes from OBJFILE. */
static void
-stap_get_probes (VEC (probe_p) **probesp, struct objfile *objfile)
+stap_get_probes (std::vector<probe *> *probesp, struct objfile *objfile)
{
/* If we are here, then this is the first time we are parsing the
SystemTap probe's information. We basically have to count how many
bfd *obfd = objfile->obfd;
bfd_vma base;
struct sdt_note *iter;
- unsigned save_probesp_len = VEC_length (probe_p, *probesp);
+ unsigned save_probesp_len = probesp->size ();
if (objfile->separate_debug_objfile_backlink != NULL)
{
handle_stap_probe (objfile, iter, probesp, base);
}
- if (save_probesp_len == VEC_length (probe_p, *probesp))
+ if (save_probesp_len == probesp->size ())
{
/* If we are here, it means we have failed to parse every known
probe. */
/* Implementation of the `info probes stap' command. */
static void
-info_probes_stap_command (char *arg, int from_tty)
+info_probes_stap_command (const char *arg, int from_tty)
{
info_probes_for_ops (arg, from_tty, &stap_probe_ops);
}
-void _initialize_stap_probe (void);
-
void
_initialize_stap_probe (void)
{
- VEC_safe_push (probe_ops_cp, all_probe_ops, &stap_probe_ops);
+ all_probe_ops.push_back (&stap_probe_ops);
add_setshow_zuinteger_cmd ("stap-expression", class_maintenance,
&stap_expression_debug,