pointer to expression string to parse_exp_1.
(create_excep_cond_exprs): Likewise.
* ax-gdb.c (agent_eval_command_one): Likewise.
(maint_agent_printf_command): Likewise.
Constify much of the string handling/parsing.
* breakpoint.c (set_breakpoint_condition): Pass const
pointer to expression string to parse_exp_1.
(update_watchpoint): Likewise.
(parse_cmd_to_aexpr): Constify string handling.
Pass const pointer to parse_exp_1.
(init_breakpoint_sal): Pass const pointer to parse_exp_1.
(find_condition_and_thread): Likewise.
Make TOK const.
(watch_command_1): Make "arg" const.
Constify string handling.
Copy the expression string instead of changing the input
string.
(update_breakpoint_location): Pass const pointer to
parse_exp_1.
* eval.c (parse_and_eval_address): Make "exp" const.
(parse_to_comma_and_eval): Make "expp" const.
(parse_and_eval): Make "exp" const.
* expression.h (parse_expression): Make argument const.
(parse_exp_1): Make first argument const.
* findcmd.c (parse_find_args): Treat "args" as const.
* linespec.c (parse_linespec): Pass const pointer to
linespec_expression_to_pc.
(linespec_expression_to_pc): Make "exp_ptr" const.
* parse.c (parse_exp_1): Make "stringptr" const.
Make a copy of the expression to pass to parse_exp_in_context until
this whole interface can be constified.
(parse_expression): Make "string" const.
* printcmd.c (ui_printf): Treat "arg" as const.
Handle const strings.
* tracepoint.c (validate_actionline): Pass const pointer to
all calls to parse_exp_1.
(encode_actions_1): Likewise.
* value.h (parse_to_comma_and_eval): Make argument const.
(parse_and_eval_address): Likewise.
(parse_and_eval): Likewise.
* varobj.c (varobj_create): Pass const pointer to parse_exp_1.
(varobj_set_value): Likewise.
* cli/cli-cmds.c (disassemble_command): Treat "arg" as const and
constify string handling.
Pass const pointers to parse_and_eval_address and
parse_to_comman_and_eval.
* cli/cli-utils.c (skip_to_space): Rename to ...
(skip_to_space_const): ... this. Handle const strings.
* cli/cli-utils.h (skip_to_space): Turn into macro which invokes
skip_to_space_const.
(skip_to_space_const): Declare.
* common/format.c (parse_format_string): Make "arg" const.
Handle const strings.
* common/format.h (parse_format_string): Make "arg" const.
* gdbserver/ax.c (ax_printf): Make "format" const.
* python/python.c (gdbpy_parse_and_eval): Do not make a copy
of the expression string.
+2013-03-12 Keith Seitz <keiths@redhat.com>
+
+ * ada-lang.c (ada_read_renaming_var_value): Pass const
+ pointer to expression string to parse_exp_1.
+ (create_excep_cond_exprs): Likewise.
+ * ax-gdb.c (agent_eval_command_one): Likewise.
+ (maint_agent_printf_command): Likewise.
+ Constify much of the string handling/parsing.
+ * breakpoint.c (set_breakpoint_condition): Pass const
+ pointer to expression string to parse_exp_1.
+ (update_watchpoint): Likewise.
+ (parse_cmd_to_aexpr): Constify string handling.
+ Pass const pointer to parse_exp_1.
+ (init_breakpoint_sal): Pass const pointer to parse_exp_1.
+ (find_condition_and_thread): Likewise.
+ Make TOK const.
+ (watch_command_1): Make "arg" const.
+ Constify string handling.
+ Copy the expression string instead of changing the input
+ string.
+ (update_breakpoint_location): Pass const pointer to
+ parse_exp_1.
+ * eval.c (parse_and_eval_address): Make "exp" const.
+ (parse_to_comma_and_eval): Make "expp" const.
+ (parse_and_eval): Make "exp" const.
+ * expression.h (parse_expression): Make argument const.
+ (parse_exp_1): Make first argument const.
+ * findcmd.c (parse_find_args): Treat "args" as const.
+ * linespec.c (parse_linespec): Pass const pointer to
+ linespec_expression_to_pc.
+ (linespec_expression_to_pc): Make "exp_ptr" const.
+ * parse.c (parse_exp_1): Make "stringptr" const.
+ Make a copy of the expression to pass to parse_exp_in_context until
+ this whole interface can be constified.
+ (parse_expression): Make "string" const.
+ * printcmd.c (ui_printf): Treat "arg" as const.
+ Handle const strings.
+ * tracepoint.c (validate_actionline): Pass const pointer to
+ all calls to parse_exp_1.
+ (encode_actions_1): Likewise.
+ * value.h (parse_to_comma_and_eval): Make argument const.
+ (parse_and_eval_address): Likewise.
+ (parse_and_eval): Likewise.
+ * varobj.c (varobj_create): Pass const pointer to parse_exp_1.
+ (varobj_set_value): Likewise.
+ * cli/cli-cmds.c (disassemble_command): Treat "arg" as const and
+ constify string handling.
+ Pass const pointers to parse_and_eval_address and
+ parse_to_comman_and_eval.
+ * cli/cli-utils.c (skip_to_space): Rename to ...
+ (skip_to_space_const): ... this. Handle const strings.
+ * cli/cli-utils.h (skip_to_space): Turn into macro which invokes
+ skip_to_space_const.
+ (skip_to_space_const): Declare.
+ * common/format.c (parse_format_string): Make "arg" const.
+ Handle const strings.
+ * common/format.h (parse_format_string): Make "arg" const.
+ * gdbserver/ax.c (ax_printf): Make "format" const.
+ * python/python.c (gdbpy_parse_and_eval): Do not make a copy
+ of the expression string.
+
2013-03-12 Hui Zhu <hui@codesourcery.com>
* dwarf2loc.c (dwarf2_compile_expr_to_ax): Update error message.
ada_read_renaming_var_value (struct symbol *renaming_sym,
struct block *block)
{
- char *sym_name;
+ const char *sym_name;
struct expression *expr;
struct value *value;
struct cleanup *old_chain = NULL;
- sym_name = xstrdup (SYMBOL_LINKAGE_NAME (renaming_sym));
- old_chain = make_cleanup (xfree, sym_name);
+ sym_name = SYMBOL_LINKAGE_NAME (renaming_sym);
expr = parse_exp_1 (&sym_name, 0, block, 0);
- make_cleanup (free_current_contents, &expr);
+ old_chain = make_cleanup (free_current_contents, &expr);
value = evaluate_expression (expr);
do_cleanups (old_chain);
if (!bl->shlib_disabled)
{
volatile struct gdb_exception e;
- char *s;
+ const char *s;
s = cond_string;
TRY_CATCH (e, RETURN_MASK_ERROR)
struct cleanup *old_chain = 0;
struct expression *expr;
struct agent_expr *agent;
+ const char *arg;
if (!eval)
{
exp = decode_agent_options (exp);
}
- if (!eval && strcmp (exp, "$_ret") == 0)
+ arg = exp;
+ if (!eval && strcmp (arg, "$_ret") == 0)
{
agent = gen_trace_for_return_address (pc, get_current_arch ());
old_chain = make_cleanup_free_agent_expr (agent);
}
else
{
- expr = parse_exp_1 (&exp, pc, block_for_pc (pc), 0);
+ expr = parse_exp_1 (&arg, pc, block_for_pc (pc), 0);
old_chain = make_cleanup (free_current_contents, &expr);
if (eval)
agent = gen_eval_for_expr (pc, expr);
struct expression *argvec[100];
struct agent_expr *agent;
struct frame_info *fi = get_current_frame (); /* need current scope */
- char *cmdrest;
- char *format_start, *format_end;
+ const char *cmdrest;
+ const char *format_start, *format_end;
struct format_piece *fpieces;
int nargs;
cmdrest = exp;
- cmdrest = skip_spaces (cmdrest);
+ cmdrest = skip_spaces_const (cmdrest);
if (*cmdrest++ != '"')
error (_("Must start with a format string."));
if (*cmdrest++ != '"')
error (_("Bad format string, non-terminated '\"'."));
- cmdrest = skip_spaces (cmdrest);
+ cmdrest = skip_spaces_const (cmdrest);
if (*cmdrest != ',' && *cmdrest != 0)
error (_("Invalid argument syntax"));
if (*cmdrest == ',')
cmdrest++;
- cmdrest = skip_spaces (cmdrest);
+ cmdrest = skip_spaces_const (cmdrest);
nargs = 0;
while (*cmdrest != '\0')
{
- char *cmd1;
+ const char *cmd1;
cmd1 = cmdrest;
expr = parse_exp_1 (&cmd1, 0, (struct block *) 0, 1);
}
else
{
- char *arg = exp;
+ const char *arg = exp;
/* I don't know if it matters whether this is the string the user
typed in or the decompiled expression. */
if (within_current_scope && reparse)
{
- char *s;
+ const char *s;
if (b->exp)
{
struct agent_expr *aexpr = NULL;
struct cleanup *old_chain = NULL;
volatile struct gdb_exception ex;
- char *cmdrest;
- char *format_start, *format_end;
+ const char *cmdrest;
+ const char *format_start, *format_end;
struct format_piece *fpieces;
int nargs;
struct gdbarch *gdbarch = get_current_arch ();
if (*cmdrest == ',')
++cmdrest;
- cmdrest = skip_spaces (cmdrest);
+ cmdrest = skip_spaces_const (cmdrest);
if (*cmdrest++ != '"')
error (_("No format string following the location"));
if (*cmdrest++ != '"')
error (_("Bad format string, non-terminated '\"'."));
- cmdrest = skip_spaces (cmdrest);
+ cmdrest = skip_spaces_const (cmdrest);
if (!(*cmdrest == ',' || *cmdrest == '\0'))
error (_("Invalid argument syntax"));
if (*cmdrest == ',')
cmdrest++;
- cmdrest = skip_spaces (cmdrest);
+ cmdrest = skip_spaces_const (cmdrest);
/* For each argument, make an expression. */
nargs = 0;
while (*cmdrest != '\0')
{
- char *cmd1;
+ const char *cmd1;
cmd1 = cmdrest;
expr = parse_exp_1 (&cmd1, scope, block_for_pc (scope), 1);
if (b->cond_string)
{
- char *arg = b->cond_string;
+ const char *arg = b->cond_string;
+
loc->cond = parse_exp_1 (&arg, loc->address,
block_for_pc (loc->address), 0);
if (*arg)
If no thread is found, *THREAD is set to -1. */
static void
-find_condition_and_thread (char *tok, CORE_ADDR pc,
+find_condition_and_thread (const char *tok, CORE_ADDR pc,
char **cond_string, int *thread, int *task,
char **rest)
{
while (tok && *tok)
{
- char *end_tok;
+ const char *end_tok;
int toklen;
- char *cond_start = NULL;
- char *cond_end = NULL;
+ const char *cond_start = NULL;
+ const char *cond_end = NULL;
- tok = skip_spaces (tok);
+ tok = skip_spaces_const (tok);
if ((*tok == '"' || *tok == ',') && rest)
{
return;
}
- end_tok = skip_to_space (tok);
+ end_tok = skip_to_space_const (tok);
toklen = end_tok - tok;
char *tmptok;
tok = end_tok + 1;
- tmptok = tok;
- *thread = strtol (tok, &tok, 0);
+ *thread = strtol (tok, &tmptok, 0);
if (tok == tmptok)
error (_("Junk after thread keyword."));
if (!valid_thread_id (*thread))
invalid_thread_id_error (*thread);
+ tok = tmptok;
}
else if (toklen >= 1 && strncmp (tok, "task", toklen) == 0)
{
char *tmptok;
tok = end_tok + 1;
- tmptok = tok;
- *task = strtol (tok, &tok, 0);
+ *task = strtol (tok, &tmptok, 0);
if (tok == tmptok)
error (_("Junk after task keyword."));
if (!valid_task_id (*task))
error (_("Unknown task %d."), *task);
+ tok = tmptok;
}
else if (rest)
{
hw_read: watch read,
hw_access: watch access (read or write) */
static void
-watch_command_1 (char *arg, int accessflag, int from_tty,
+watch_command_1 (const char *arg, int accessflag, int from_tty,
int just_location, int internal)
{
volatile struct gdb_exception e;
const struct block *exp_valid_block = NULL, *cond_exp_valid_block = NULL;
struct value *val, *mark, *result;
struct frame_info *frame;
- char *exp_start = NULL;
- char *exp_end = NULL;
- char *tok, *end_tok;
+ const char *exp_start = NULL;
+ const char *exp_end = NULL;
+ const char *tok, *end_tok;
int toklen = -1;
- char *cond_start = NULL;
- char *cond_end = NULL;
+ const char *cond_start = NULL;
+ const char *cond_end = NULL;
enum bptype bp_type;
int thread = -1;
int pc = 0;
int use_mask = 0;
CORE_ADDR mask = 0;
struct watchpoint *w;
+ char *expression;
+ struct cleanup *back_to;
/* Make sure that we actually have parameters to parse. */
if (arg != NULL && arg[0] != '\0')
{
- char *value_start;
+ const char *value_start;
+
+ exp_end = arg + strlen (arg);
/* Look for "parameter value" pairs at the end
of the arguments string. */
- for (tok = arg + strlen (arg) - 1; tok > arg; tok--)
+ for (tok = exp_end - 1; tok > arg; tok--)
{
/* Skip whitespace at the end of the argument list. */
while (tok > arg && (*tok == ' ' || *tok == '\t'))
/* Truncate the string and get rid of the "parameter value" pair before
the arguments string is parsed by the parse_exp_1 function. */
- *tok = '\0';
+ exp_end = tok;
}
}
+ else
+ exp_end = arg;
- /* Parse the rest of the arguments. */
+ /* Parse the rest of the arguments. From here on out, everything
+ is in terms of a newly allocated string instead of the original
+ ARG. */
innermost_block = NULL;
- exp_start = arg;
+ expression = savestring (arg, exp_end - arg);
+ back_to = make_cleanup (xfree, expression);
+ exp_start = arg = expression;
exp = parse_exp_1 (&arg, 0, 0, 0);
exp_end = arg;
/* Remove trailing whitespace from the expression before saving it.
else if (val != NULL)
release_value (val);
- tok = skip_spaces (arg);
- end_tok = skip_to_space (tok);
+ tok = skip_spaces_const (arg);
+ end_tok = skip_to_space_const (tok);
toklen = end_tok - tok;
if (toklen >= 1 && strncmp (tok, "if", toklen) == 0)
}
install_breakpoint (internal, b, 1);
+ do_cleanups (back_to);
}
/* Return count of debug registers needed to watch the given expression.
old symtab. */
if (b->cond_string != NULL)
{
- char *s;
+ const char *s;
volatile struct gdb_exception e;
s = b->cond_string;
const char *name;
CORE_ADDR pc;
int flags;
+ const char *p;
+ p = arg;
name = NULL;
flags = 0;
- if (arg && *arg == '/')
+ if (p && *p == '/')
{
- ++arg;
+ ++p;
- if (*arg == '\0')
+ if (*p == '\0')
error (_("Missing modifier."));
- while (*arg && ! isspace (*arg))
+ while (*p && ! isspace (*p))
{
- switch (*arg++)
+ switch (*p++)
{
case 'm':
flags |= DISASSEMBLY_SOURCE;
}
}
- arg = skip_spaces (arg);
+ p = skip_spaces_const (p);
}
- if (! arg || ! *arg)
+ if (! p || ! *p)
{
flags |= DISASSEMBLY_OMIT_FNAME;
disassemble_current_function (flags);
return;
}
- pc = value_as_address (parse_to_comma_and_eval (&arg));
- if (arg[0] == ',')
- ++arg;
- if (arg[0] == '\0')
+ pc = value_as_address (parse_to_comma_and_eval (&p));
+ if (p[0] == ',')
+ ++p;
+ if (p[0] == '\0')
{
/* One argument. */
if (find_pc_partial_function (pc, &name, &low, &high) == 0)
/* Two arguments. */
int incl_flag = 0;
low = pc;
- arg = skip_spaces (arg);
- if (arg[0] == '+')
+ p = skip_spaces_const (p);
+ if (p[0] == '+')
{
- ++arg;
+ ++p;
incl_flag = 1;
}
- high = parse_and_eval_address (arg);
+ high = parse_and_eval_address (p);
if (incl_flag)
high += low;
}
/* See documentation in cli-utils.h. */
-char *
-skip_to_space (char *chp)
+const char *
+skip_to_space_const (const char *chp)
{
if (chp == NULL)
return NULL;
/* Skip leading non-whitespace characters in INP, returning an updated
pointer. If INP is NULL, return NULL. */
-extern char *skip_to_space (char *inp);
+#define skip_to_space(INP) ((char *) skip_to_space_const (INP))
+
+/* A const-correct version of the above. */
+
+extern const char *skip_to_space_const (const char *inp);
/* Reverse S to the last non-whitespace character without skipping past
START. */
#include "format.h"
struct format_piece *
-parse_format_string (char **arg)
+parse_format_string (const char **arg)
{
- char *s, *f, *string;
- char *prev_start;
- char *percent_loc;
+ const char *s;
+ char *f, *string;
+ const char *prev_start;
+ const char *percent_loc;
char *sub_start, *current_substring;
struct format_piece *pieces;
int next_frag;
/* Return an array of printf fragments found at the given string, and
rewrite ARG with a pointer to the end of the format string. */
-extern struct format_piece *parse_format_string (char **arg);
+extern struct format_piece *parse_format_string (const char **arg);
/* Given a pointer to an array of format pieces, free any memory that
would have been allocated by parse_format_string. */
and return the result as a number. */
CORE_ADDR
-parse_and_eval_address (char *exp)
+parse_and_eval_address (const char *exp)
{
struct expression *expr = parse_expression (exp);
CORE_ADDR addr;
}
struct value *
-parse_and_eval (char *exp)
+parse_and_eval (const char *exp)
{
struct expression *expr = parse_expression (exp);
struct value *val;
EXPP is advanced to point to the comma. */
struct value *
-parse_to_comma_and_eval (char **expp)
+parse_to_comma_and_eval (const char **expp)
{
struct expression *expr = parse_exp_1 (expp, 0, (struct block *) 0, 1);
struct value *val;
/* From parse.c */
-extern struct expression *parse_expression (char *);
+extern struct expression *parse_expression (const char *);
extern struct type *parse_expression_for_completion (char *, char **,
enum type_code *);
-extern struct expression *parse_exp_1 (char **, CORE_ADDR pc,
+extern struct expression *parse_exp_1 (const char **, CORE_ADDR pc,
const struct block *, int);
/* For use by parsers; set if we want to parse an expression and
ULONGEST pattern_len;
CORE_ADDR start_addr;
ULONGEST search_space_len;
- char *s = args;
+ const char *s = args;
struct cleanup *old_cleanups;
struct value *v;
}
}
- s = skip_spaces (s);
+ s = skip_spaces_const (s);
}
/* Get the search range. */
if (*s == ',')
++s;
- s = skip_spaces (s);
+ s = skip_spaces_const (s);
if (*s == '+')
{
struct type *t;
ULONGEST pattern_buf_size_need;
- s = skip_spaces (s);
+ s = skip_spaces_const (s);
v = parse_to_comma_and_eval (&s);
t = value_type (v);
if (*s == ',')
++s;
- s = skip_spaces (s);
+ s = skip_spaces_const (s);
}
if (pattern_buf_end == pattern_buf)
in. */
static void
-ax_printf (CORE_ADDR fn, CORE_ADDR chan, char *format,
+ax_printf (CORE_ADDR fn, CORE_ADDR chan, const char *format,
int nargs, ULONGEST *args)
{
- char *f = format;
+ const char *f = format;
struct format_piece *fpieces;
int i, fp;
char *current_substring;
static void initialize_defaults (struct symtab **default_symtab,
int *default_line);
-static CORE_ADDR linespec_expression_to_pc (char **exp_ptr);
+static CORE_ADDR linespec_expression_to_pc (const char **exp_ptr);
static struct symtabs_and_lines decode_objc (struct linespec_state *self,
linespec_p ls,
/* It must be either LSTOKEN_STRING or LSTOKEN_NUMBER. */
if (token.type == LSTOKEN_STRING && *LS_TOKEN_STOKEN (token).ptr == '*')
{
- char *expr, *copy;
+ char *expr;
+ const char *copy;
/* User specified an expression, *EXPR. */
copy = expr = copy_token_string (token);
advancing EXP_PTR past any parsed text. */
static CORE_ADDR
-linespec_expression_to_pc (char **exp_ptr)
+linespec_expression_to_pc (const char **exp_ptr)
{
if (current_program_space->executing_startup)
/* The error message doesn't really matter, because this case
If COMMA is nonzero, stop if a comma is reached. */
struct expression *
-parse_exp_1 (char **stringptr, CORE_ADDR pc, const struct block *block,
+parse_exp_1 (const char **stringptr, CORE_ADDR pc, const struct block *block,
int comma)
{
- return parse_exp_in_context (stringptr, pc, block, comma, 0, NULL);
+ struct expression *expr;
+ char *const_hack = *stringptr ? xstrdup (*stringptr) : NULL;
+ char *orig = const_hack;
+ struct cleanup *back_to = make_cleanup (xfree, const_hack);
+
+ expr = parse_exp_in_context (&const_hack, pc, block, comma, 0, NULL);
+ (*stringptr) += const_hack - orig;
+ do_cleanups (back_to);
+ return expr;
}
/* As for parse_exp_1, except that if VOID_CONTEXT_P, then
to use up all of the contents of STRING. */
struct expression *
-parse_expression (char *string)
+parse_expression (const char *string)
{
struct expression *exp;
/* printf "printf format string" ARG to STREAM. */
static void
-ui_printf (char *arg, struct ui_file *stream)
+ui_printf (const char *arg, struct ui_file *stream)
{
struct format_piece *fpieces;
- char *s = arg;
+ const char *s = arg;
struct value **val_args;
int allocated_args = 20;
struct cleanup *old_cleanups;
if (s == 0)
error_no_arg (_("format-control string and values to print"));
- s = skip_spaces (s);
+ s = skip_spaces_const (s);
/* A format string should follow, enveloped in double quotes. */
if (*s++ != '"')
if (*s++ != '"')
error (_("Bad format string, non-terminated '\"'."));
- s = skip_spaces (s);
+ s = skip_spaces_const (s);
if (*s != ',' && *s != 0)
error (_("Invalid argument syntax"));
if (*s == ',')
s++;
- s = skip_spaces (s);
+ s = skip_spaces_const (s);
{
int nargs = 0;
while (*s != '\0')
{
- char *s1;
+ const char *s1;
if (nargs == allocated_args)
val_args = (struct value **) xrealloc ((char *) val_args,
TRY_CATCH (except, RETURN_MASK_ALL)
{
- char *copy = xstrdup (expr_str);
- struct cleanup *cleanup = make_cleanup (xfree, copy);
-
- result = parse_and_eval (copy);
- do_cleanups (cleanup);
+ result = parse_and_eval (expr_str);
}
GDB_PY_HANDLE_EXCEPTION (except);
tmp_p = p;
for (loc = t->base.loc; loc; loc = loc->next)
{
- p = tmp_p;
- exp = parse_exp_1 (&p, loc->address,
+ const char *q;
+
+ q = tmp_p;
+ exp = parse_exp_1 (&q, loc->address,
block_for_pc (loc->address), 1);
+ p = (char *) q;
old_chain = make_cleanup (free_current_contents, &exp);
if (exp->elts[0].opcode == OP_VAR_VALUE)
tmp_p = p;
for (loc = t->base.loc; loc; loc = loc->next)
{
- p = tmp_p;
+ const char *q;
+
+ q = tmp_p;
/* Only expressions are allowed for this action. */
- exp = parse_exp_1 (&p, loc->address,
+ exp = parse_exp_1 (&q, loc->address,
block_for_pc (loc->address), 1);
+ p = (char *) q;
old_chain = make_cleanup (free_current_contents, &exp);
/* We have something to evaluate, make sure that the expr to
unsigned long addr;
struct cleanup *old_chain = NULL;
struct cleanup *old_chain1 = NULL;
+ const char *q;
- exp = parse_exp_1 (&action_exp, tloc->address,
+ q = action_exp;
+ exp = parse_exp_1 (&q, tloc->address,
block_for_pc (tloc->address), 1);
+ action_exp = (char *) q;
old_chain = make_cleanup (free_current_contents, &exp);
switch (exp->elts[0].opcode)
{
struct cleanup *old_chain = NULL;
struct cleanup *old_chain1 = NULL;
+ const char *q;
- exp = parse_exp_1 (&action_exp, tloc->address,
+ q = action_exp;
+ exp = parse_exp_1 (&q, tloc->address,
block_for_pc (tloc->address), 1);
+ action_exp = (char *) q;
old_chain = make_cleanup (free_current_contents, &exp);
aexpr = gen_eval_for_expr (tloc->address, exp);
extern struct value *evaluate_subexp_with_coercion (struct expression *,
int *, enum noside);
-extern struct value *parse_and_eval (char *exp);
+extern struct value *parse_and_eval (const char *exp);
-extern struct value *parse_to_comma_and_eval (char **expp);
+extern struct value *parse_to_comma_and_eval (const char **expp);
extern struct type *parse_and_eval_type (char *p, int length);
-extern CORE_ADDR parse_and_eval_address (char *exp);
+extern CORE_ADDR parse_and_eval_address (const char *exp);
extern LONGEST parse_and_eval_long (char *exp);
struct frame_info *fi;
struct frame_id old_id = null_frame_id;
struct block *block;
- char *p;
+ const char *p;
enum varobj_languages lang;
struct value *value = NULL;
volatile struct gdb_exception except;
struct expression *exp;
struct value *value = NULL; /* Initialize to keep gcc happy. */
int saved_input_radix = input_radix;
- char *s = expression;
+ const char *s = expression;
volatile struct gdb_exception except;
gdb_assert (varobj_editable_p (var));