/* SystemTap probe support for GDB.
- Copyright (C) 2012 Free Software Foundation, Inc.
+ Copyright (C) 2012-2013 Free Software Foundation, Inc.
This file is part of GDB.
/* Should we display debug information for the probe's argument expression
parsing? */
-static int stap_expression_debug = 0;
+static unsigned int stap_expression_debug = 0;
/* The various possibilities of bitness defined for a probe's argument.
{
/* The value of the displacement. */
long displacement;
+ char *endp;
disp_p = 1;
- displacement = strtol (p->arg, (char **) &p->arg, 10);
+ displacement = strtol (p->arg, &endp, 10);
+ p->arg = endp;
/* Generating the expression for the displacement. */
write_exp_elt_opcode (OP_LONG);
tmp = skip_spaces_const (tmp);
if (isdigit (*tmp))
- number = strtol (tmp, (char **) &tmp, 10);
+ {
+ char *endp;
+
+ number = strtol (tmp, &endp, 10);
+ tmp = endp;
+ }
if (!reg_ind_prefix
|| strncmp (tmp, reg_ind_prefix, reg_ind_prefix_len) != 0)
{
/* A temporary variable, needed for lookahead. */
const char *tmp = p->arg;
+ char *endp;
long number;
/* We can be dealing with a numeric constant (if `const_prefix' is
NULL), or with a register displacement. */
- number = strtol (tmp, (char **) &tmp, 10);
+ number = strtol (tmp, &endp, 10);
+ tmp = endp;
if (p->inside_paren_p)
tmp = skip_spaces_const (tmp);
{
/* We are dealing with a numeric constant. */
long number;
+ char *endp;
p->arg += const_prefix_len;
- number = strtol (p->arg, (char **) &p->arg, 10);
+ number = strtol (p->arg, &endp, 10);
+ p->arg = endp;
write_exp_elt_opcode (OP_LONG);
write_exp_elt_type (builtin_type (gdbarch)->builtin_long);
int sel = (int) (uintptr_t) data;
struct probe *pc_probe;
const struct sym_probe_fns *pc_probe_fns;
- int n_probes;
+ int n_args;
/* SEL == -1 means "_probe_argc". */
gdb_assert (sel >= -1);
pc_probe_fns = pc_probe->objfile->sf->sym_probe_fns;
- n_probes = pc_probe_fns->sym_get_probe_argument_count (pc_probe);
+ n_args = pc_probe_fns->sym_get_probe_argument_count (pc_probe);
if (sel == -1)
{
value->kind = axs_rvalue;
value->type = builtin_type (expr->gdbarch)->builtin_int;
- ax_const_l (expr, n_probes);
+ ax_const_l (expr, n_args);
return;
}
gdb_assert (sel >= 0);
- if (sel >= n_probes)
+ if (sel >= n_args)
error (_("Invalid probe argument %d -- probe has %d arguments available"),
- sel, n_probes);
+ sel, n_args);
pc_probe_fns->sym_compile_to_ax (pc_probe, expr, value, sel);
}
ret->p.objfile = objfile;
/* Provider and the name of the probe. */
- ret->p.provider = &el->data[3 * size];
+ ret->p.provider = (char *) &el->data[3 * size];
ret->p.name = memchr (ret->p.provider, '\0',
(char *) el->data + el->size - ret->p.provider);
/* Making sure there is a name. */
{
VEC_safe_push (probe_ops_cp, all_probe_ops, &stap_probe_ops);
- add_setshow_zinteger_cmd ("stap-expression", class_maintenance,
- &stap_expression_debug,
- _("Set SystemTap expression debugging."),
- _("Show SystemTap expression debugging."),
- _("When non-zero, the internal representation "
- "of SystemTap expressions will be printed."),
- NULL,
- show_stapexpressiondebug,
- &setdebuglist, &showdebuglist);
+ add_setshow_zuinteger_cmd ("stap-expression", class_maintenance,
+ &stap_expression_debug,
+ _("Set SystemTap expression debugging."),
+ _("Show SystemTap expression debugging."),
+ _("When non-zero, the internal representation "
+ "of SystemTap expressions will be printed."),
+ NULL,
+ show_stapexpressiondebug,
+ &setdebuglist, &showdebuglist);
create_internalvar_type_lazy ("_probe_argc", &probe_funcs,
(void *) (uintptr_t) -1);