/* Evaluate expressions for GDB.
- Copyright (C) 1986-2003, 2005-2012 Free Software Foundation, Inc.
+ Copyright (C) 1986-2013 Free Software Foundation, Inc.
This file is part of GDB.
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;
find_overload_match (&argvec[1], nargs, func_name,
NON_METHOD, /* not method */
- 0, /* strict match */
NULL, NULL, /* pass NULL symbol since
symbol is unknown */
NULL, &symp, NULL, 0);
(void) find_overload_match (&argvec[1], nargs, tstr,
METHOD, /* method */
- 0, /* strict match */
&arg2, /* the object */
NULL, &valp, NULL,
&static_memfuncp, 0);
(void) find_overload_match (&argvec[1], nargs,
NULL, /* no need for name */
NON_METHOD, /* not method */
- 0, /* strict match */
NULL, function, /* the function */
NULL, &symp, NULL, no_adl);
{
struct type *type = check_typedef (value_type (x));
- if (VALUE_LVAL (x) == lval_memory || value_must_coerce_to_target (x))
- return value_zero (lookup_pointer_type (value_type (x)),
- not_lval);
- else if (TYPE_CODE (type) == TYPE_CODE_REF)
+ if (TYPE_CODE (type) == TYPE_CODE_REF)
return value_zero (lookup_pointer_type (TYPE_TARGET_TYPE (type)),
not_lval);
+ else if (VALUE_LVAL (x) == lval_memory || value_must_coerce_to_target (x))
+ return value_zero (lookup_pointer_type (value_type (x)),
+ not_lval);
else
error (_("Attempt to take address of "
"value not located in memory."));