Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2008,
- 2009, 2010 Free Software Foundation, Inc.
+ 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of GDB.
#include "gdb_obstack.h"
#include "objfiles.h"
#include "python/python.h"
+#include "wrapper.h"
#include "gdb_assert.h"
evaluate_expression (struct expression *exp)
{
int pc = 0;
+
return evaluate_subexp (NULL_TYPE, exp, &pc, EVAL_NORMAL);
}
evaluate_type (struct expression *exp)
{
int pc = 0;
+
return evaluate_subexp (NULL_TYPE, exp, &pc, EVAL_AVOID_SIDE_EFFECTS);
}
return evaluate_subexp (NULL_TYPE, exp, &subexp, EVAL_AVOID_SIDE_EFFECTS);
}
+/* Find the current value of a watchpoint on EXP. Return the value in
+ *VALP and *RESULTP and the chain of intermediate and final values
+ in *VAL_CHAIN. RESULTP and VAL_CHAIN may be NULL if the caller does
+ not need them.
+
+ If a memory error occurs while evaluating the expression, *RESULTP will
+ be set to NULL. *RESULTP may be a lazy value, if the result could
+ not be read from memory. It is used to determine whether a value
+ is user-specified (we should watch the whole value) or intermediate
+ (we should watch only the bit used to locate the final value).
+
+ If the final value, or any intermediate value, could not be read
+ from memory, *VALP will be set to NULL. *VAL_CHAIN will still be
+ set to any referenced values. *VALP will never be a lazy value.
+ This is the value which we store in struct breakpoint.
+
+ If VAL_CHAIN is non-NULL, *VAL_CHAIN will be released from the
+ value chain. The caller must free the values individually. If
+ VAL_CHAIN is NULL, all generated values will be left on the value
+ chain. */
+
+void
+fetch_subexp_value (struct expression *exp, int *pc, struct value **valp,
+ struct value **resultp, struct value **val_chain)
+{
+ struct value *mark, *new_mark, *result;
+ volatile struct gdb_exception ex;
+
+ *valp = NULL;
+ if (resultp)
+ *resultp = NULL;
+ if (val_chain)
+ *val_chain = NULL;
+
+ /* Evaluate the expression. */
+ mark = value_mark ();
+ result = NULL;
+
+ TRY_CATCH (ex, RETURN_MASK_ALL)
+ {
+ result = evaluate_subexp (NULL_TYPE, exp, pc, EVAL_NORMAL);
+ }
+ if (ex.reason < 0)
+ {
+ /* Ignore memory errors, we want watchpoints pointing at
+ inaccessible memory to still be created; otherwise, throw the
+ error to some higher catcher. */
+ switch (ex.error)
+ {
+ case MEMORY_ERROR:
+ break;
+ default:
+ throw_exception (ex);
+ break;
+ }
+ }
+
+ new_mark = value_mark ();
+ if (mark == new_mark)
+ return;
+ if (resultp)
+ *resultp = result;
+
+ /* Make sure it's not lazy, so that after the target stops again we
+ have a non-lazy previous value to compare with. */
+ if (result != NULL
+ && (!value_lazy (result) || gdb_value_fetch_lazy (result)))
+ *valp = result;
+
+ if (val_chain)
+ {
+ /* Return the chain of intermediate values. We use this to
+ decide which addresses to watch. */
+ *val_chain = new_mark;
+ value_release_to_mark (mark);
+ }
+}
+
/* Extract a field operation from an expression. If the subexpression
of EXP starting at *SUBEXP is not a structure dereference
operation, return NULL. Otherwise, return the name of the
{
int tem;
char *result;
+
if (exp->elts[*subexp].opcode != STRUCTOP_STRUCT
&& exp->elts[*subexp].opcode != STRUCTOP_PTR)
return NULL;
int pc = (*pos)++;
char *name = &exp->elts[pc + 2].string;
int tem = longest_to_int (exp->elts[pc + 1].longconst);
+
(*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1);
return name;
}
int fieldno = -1;
int variantno = -1;
int subfieldno = -1;
+
while (--nargs >= 0)
{
int pc = *pos;
do
{
char *label = get_label (exp, &pc);
+
if (label)
{
for (fieldno = 0; fieldno < TYPE_NFIELDS (struct_type);
fieldno++)
{
char *field_name = TYPE_FIELD_NAME (struct_type, fieldno);
+
if (field_name != NULL && strcmp (field_name, label) == 0)
{
variantno = -1;
fieldno++)
{
char *field_name = TYPE_FIELD_NAME (struct_type, fieldno);
+
field_type = TYPE_FIELD_TYPE (struct_type, fieldno);
if ((field_name == 0 || *field_name == '\0')
&& TYPE_CODE (field_type) == TYPE_CODE_UNION)
{
LONGEST index;
int element_size = TYPE_LENGTH (value_type (element));
+
if (exp->elts[*pos].opcode == BINOP_COMMA)
{
(*pos)++;
else if (exp->elts[*pos].opcode == BINOP_RANGE)
{
LONGEST low, high;
+
(*pos)++;
low = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
high = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
it needs to modify this function. */
{
struct type *builtin_int = builtin_type (gdbarch)->builtin_int;
+
if (TYPE_LENGTH (type1) < TYPE_LENGTH (builtin_int))
*arg1 = value_cast (builtin_int, *arg1);
}
case language_cplus:
case language_asm:
case language_objc:
+ case language_opencl:
/* No promotion required. */
break;
: builtin->builtin_long_long);
}
break;
-
+ case language_opencl:
+ if (result_len <= TYPE_LENGTH (lookup_signed_typename
+ (language, gdbarch, "int")))
+ {
+ promoted_type =
+ (unsigned_operation
+ ? lookup_unsigned_typename (language, gdbarch, "int")
+ : lookup_signed_typename (language, gdbarch, "int"));
+ }
+ else if (result_len <= TYPE_LENGTH (lookup_signed_typename
+ (language, gdbarch, "long")))
+ {
+ promoted_type =
+ (unsigned_operation
+ ? lookup_unsigned_typename (language, gdbarch, "long")
+ : lookup_signed_typename (language, gdbarch,"long"));
+ }
+ break;
default:
/* For other languages the result type is unchanged from gdb
version 6.7 for backward compatibility.
return 1;
case TYPE_CODE_ARRAY:
- return lang->c_style_arrays;
+ return TYPE_VECTOR (type) ? 0 : lang->c_style_arrays;
default:
return 0;
if (except.reason < 0)
{
if (noside == EVAL_AVOID_SIDE_EFFECTS)
- ret = value_zero (SYMBOL_TYPE (exp->elts[pc + 2].symbol), not_lval);
+ ret = value_zero (SYMBOL_TYPE (exp->elts[pc + 2].symbol),
+ not_lval);
else
throw_exception (except);
}
type = language_string_char_type (exp->language_defn, exp->gdbarch);
return value_string (&exp->elts[pc + 2].string, tem, type);
- case OP_OBJC_NSSTRING: /* Objective C Foundation Class NSString constant. */
+ case OP_OBJC_NSSTRING: /* Objective C Foundation Class
+ NSString constant. */
tem = longest_to_int (exp->elts[pc + 1].longconst);
(*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1);
if (noside == EVAL_SKIP)
&& TYPE_CODE (type) == TYPE_CODE_STRUCT)
{
struct value *rec = allocate_value (expect_type);
+
memset (value_contents_raw (rec), '\0', TYPE_LENGTH (type));
return evaluate_struct_tuple (rec, exp, pos, noside, nargs);
}
struct value *array = allocate_value (expect_type);
int element_size = TYPE_LENGTH (check_typedef (element_type));
LONGEST low_bound, high_bound, index;
+
if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0)
{
low_bound = 0;
{
struct value *element;
int index_pc = 0;
+
if (exp->elts[*pos].opcode == BINOP_RANGE)
{
index_pc = ++(*pos);
if (index_pc)
{
int continue_pc = *pos;
+
*pos = index_pc;
index = init_array_element (array, element, exp, pos, noside,
low_bound, high_bound);
LONGEST range_low, range_high;
struct type *range_low_type, *range_high_type;
struct value *elem_val;
+
if (exp->elts[*pos].opcode == BINOP_RANGE)
{
(*pos)++;
for (; range_low <= range_high; range_low++)
{
int bit_index = (unsigned) range_low % TARGET_CHAR_BIT;
+
if (gdbarch_bits_big_endian (exp->gdbarch))
bit_index = TARGET_CHAR_BIT - 1 - bit_index;
valaddr[(unsigned) range_low / TARGET_CHAR_BIT]
{
struct value *array = evaluate_subexp (NULL_TYPE, exp, pos, noside);
int lowbound
- = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
+ = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
int upper
- = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
+ = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
+
if (noside == EVAL_SKIP)
goto nosideret;
return value_slice (array, lowbound, upper - lowbound + 1);
{
struct value *array = evaluate_subexp (NULL_TYPE, exp, pos, noside);
int lowbound
- = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
+ = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
int length
- = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
+ = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
+
return value_slice (array, lowbound, length);
}
if (gnu_runtime)
{
struct type *type = selector_type;
+
type = lookup_function_type (type);
type = lookup_pointer_type (type);
type = lookup_function_type (type);
}
struct_return = using_struct_return (exp->gdbarch,
- value_type (method), val_type);
+ value_type (method),
+ val_type);
}
else if (expect_type != NULL)
{
if (method)
{
if (TYPE_CODE (value_type (method)) != TYPE_CODE_FUNC)
- error (_("method address has symbol information with non-function type; skipping"));
-
- /* Create a function pointer of the appropriate type, and replace
- its value with the value of msg_send or msg_send_stret. We must
- use a pointer here, as msg_send and msg_send_stret are of pointer
- type, and the representation may be different on systems that use
+ error (_("method address has symbol information "
+ "with non-function type; skipping"));
+
+ /* Create a function pointer of the appropriate type, and
+ replace its value with the value of msg_send or
+ msg_send_stret. We must use a pointer here, as
+ msg_send and msg_send_stret are of pointer type, and
+ the representation may be different on systems that use
function descriptors. */
if (struct_return)
called_method
it. */
struct type *type = value_type (called_method);
+
if (type && TYPE_CODE (type) == TYPE_CODE_PTR)
type = TYPE_TARGET_TYPE (type);
type = TYPE_TARGET_TYPE (type);
return allocate_value (type);
}
else
- error (_("Expression of type other than \"method returning ...\" used as a method"));
+ error (_("Expression of type other than "
+ "\"method returning ...\" used as a method"));
}
/* Now depending on whether we found a symbol for the method,
/* Function objc_msg_lookup returns a pointer. */
deprecated_set_value_type (argvec[0],
lookup_pointer_type (lookup_function_type (value_type (argvec[0]))));
- argvec[0] = call_function_by_hand (argvec[0], nargs + 2, argvec + 1);
+ argvec[0]
+ = call_function_by_hand (argvec[0], nargs + 2, argvec + 1);
}
ret = call_function_by_hand (argvec[0], nargs + 2, argvec + 1);
nargs = longest_to_int (exp->elts[pc + 1].longconst);
/* Allocate arg vector, including space for the function to be
called in argvec[0] and a terminating NULL */
- argvec = (struct value **) alloca (sizeof (struct value *) * (nargs + 3));
+ argvec = (struct value **)
+ alloca (sizeof (struct value *) * (nargs + 3));
if (op == STRUCTOP_MEMBER || op == STRUCTOP_MPTR)
{
nargs++;
if (noside == EVAL_AVOID_SIDE_EFFECTS)
{
struct type *method_type = check_typedef (value_type (arg1));
+
arg1 = value_zero (method_type, not_lval);
}
else
else
{
arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+
+ /* Check to see if the operator '->' has been
+ overloaded. If the operator has been overloaded
+ replace arg2 with the value returned by the custom
+ operator and continue evaluation. */
+ while (unop_user_defined_p (op, arg2))
+ {
+ volatile struct gdb_exception except;
+ struct value *value = NULL;
+ TRY_CATCH (except, RETURN_MASK_ERROR)
+ {
+ value = value_x_unop (arg2, op, noside);
+ }
+
+ if (except.reason < 0)
+ {
+ if (except.error == NOT_FOUND_ERROR)
+ break;
+ else
+ throw_exception (except);
+ }
+ arg2 = value;
+ }
}
/* Now, say which argument to start evaluating from */
tem = 2;
/* Save the function position and move pos so that the arguments
can be evaluated. */
int func_name_len;
+
save_pos1 = *pos;
tem = 1;
{
/* Non-method function call */
save_pos1 = *pos;
- argvec[0] = evaluate_subexp_with_coercion (exp, pos, noside);
tem = 1;
- type = value_type (argvec[0]);
- if (type && TYPE_CODE (type) == TYPE_CODE_PTR)
- type = TYPE_TARGET_TYPE (type);
- if (type && TYPE_CODE (type) == TYPE_CODE_FUNC)
+
+ /* If this is a C++ function wait until overload resolution. */
+ if (op == OP_VAR_VALUE
+ && overload_resolution
+ && (exp->language_defn->la_language == language_cplus))
{
- for (; tem <= nargs && tem <= TYPE_NFIELDS (type); tem++)
+ (*pos) += 4; /* Skip the evaluation of the symbol. */
+ argvec[0] = NULL;
+ }
+ else
+ {
+ argvec[0] = evaluate_subexp_with_coercion (exp, pos, noside);
+ type = value_type (argvec[0]);
+ if (type && TYPE_CODE (type) == TYPE_CODE_PTR)
+ type = TYPE_TARGET_TYPE (type);
+ if (type && TYPE_CODE (type) == TYPE_CODE_FUNC)
{
- /* pai: FIXME This seems to be coercing arguments before
- * overload resolution has been done! */
- argvec[tem] = evaluate_subexp (TYPE_FIELD_TYPE (type, tem - 1),
- exp, pos, noside);
+ for (; tem <= nargs && tem <= TYPE_NFIELDS (type); tem++)
+ {
+ argvec[tem] = evaluate_subexp (TYPE_FIELD_TYPE (type,
+ tem - 1),
+ exp, pos, noside);
+ }
}
}
}
strcpy (func_name, &exp->elts[string_pc + 1].string);
/* Prepare list of argument types for overload resolution */
- arg_types = (struct type **) alloca (nargs * (sizeof (struct type *)));
+ arg_types = (struct type **)
+ alloca (nargs * (sizeof (struct type *)));
for (ix = 1; ix <= nargs; ix++)
arg_types[ix - 1] = value_type (argvec[ix]);
find_overload_match (arg_types, nargs, func_name,
- 0 /* not method */ , 0 /* strict match */ ,
- NULL, NULL /* pass NULL symbol since symbol is unknown */ ,
+ NON_METHOD, /* not method */
+ 0, /* strict match */
+ NULL, NULL, /* pass NULL symbol since
+ symbol is unknown */
NULL, &symp, NULL, 0);
/* Now fix the expression being evaluated. */
else
tstr = function_name;
- if (overload_resolution && (exp->language_defn->la_language == language_cplus))
+ if (overload_resolution && (exp->language_defn->la_language
+ == language_cplus))
{
- /* Language is C++, do some overload resolution before evaluation */
+ /* Language is C++, do some overload resolution before
+ evaluation */
struct value *valp = NULL;
/* Prepare list of argument types for overload resolution */
- arg_types = (struct type **) alloca (nargs * (sizeof (struct type *)));
+ arg_types = (struct type **)
+ alloca (nargs * (sizeof (struct type *)));
for (ix = 1; ix <= nargs; ix++)
arg_types[ix - 1] = value_type (argvec[ix]);
(void) find_overload_match (arg_types, nargs, tstr,
- 1 /* method */ , 0 /* strict match */ ,
- &arg2 /* the object */ , NULL,
- &valp, NULL, &static_memfuncp, 0);
+ METHOD, /* method */
+ 0, /* strict match */
+ &arg2, /* the object */
+ NULL, &valp, NULL,
+ &static_memfuncp, 0);
if (op == OP_SCOPE && !static_memfuncp)
{
function_name);
}
argvec[1] = arg2; /* the ``this'' pointer */
- argvec[0] = valp; /* use the method found after overload resolution */
+ argvec[0] = valp; /* use the method found after overload
+ resolution */
}
else
/* Non-C++ case -- or no overload resolution */
{
struct value *temp = arg2;
+
argvec[0] = value_struct_elt (&temp, argvec + 1, tstr,
&static_memfuncp,
op == STRUCTOP_STRUCT
/* value_struct_elt updates temp with the correct value
of the ``this'' pointer if necessary, so modify argvec[1] to
reflect any ``this'' changes. */
- arg2 = value_from_longest (lookup_pointer_type(value_type (temp)),
- value_address (temp)
- + value_embedded_offset (temp));
+ arg2
+ = value_from_longest (lookup_pointer_type(value_type (temp)),
+ value_address (temp)
+ + value_embedded_offset (temp));
argvec[1] = arg2; /* the ``this'' pointer */
}
in a C++ program, for instance, does not have the fields that
are expected here */
- if (overload_resolution && (exp->language_defn->la_language == language_cplus))
+ if (overload_resolution && (exp->language_defn->la_language
+ == language_cplus))
{
- /* Language is C++, do some overload resolution before evaluation */
+ /* Language is C++, do some overload resolution before
+ evaluation */
struct symbol *symp;
int no_adl = 0;
function = exp->elts[save_pos1+2].symbol;
/* Prepare list of argument types for overload resolution */
- arg_types = (struct type **) alloca (nargs * (sizeof (struct type *)));
+ arg_types = (struct type **)
+ alloca (nargs * (sizeof (struct type *)));
for (ix = 1; ix <= nargs; ix++)
arg_types[ix - 1] = value_type (argvec[ix]);
- (void) find_overload_match (arg_types, nargs, NULL /* no need for name */ ,
- 0 /* not method */ , 0 /* strict match */ ,
- NULL, function /* the function */ ,
+ (void) find_overload_match (arg_types, nargs,
+ NULL, /* no need for name */
+ NON_METHOD, /* not method */
+ 0, /* strict match */
+ NULL, function, /* the function */
NULL, &symp, NULL, no_adl);
if (op == OP_VAR_VALUE)
else if (TYPE_TARGET_TYPE (ftype))
return allocate_value (TYPE_TARGET_TYPE (ftype));
else
- error (_("Expression of type other than \"Function returning ...\" used as function"));
+ error (_("Expression of type other than "
+ "\"Function returning ...\" used as function"));
}
if (TYPE_CODE (value_type (argvec[0])) == TYPE_CODE_INTERNAL_FUNCTION)
return call_internal_function (exp->gdbarch, exp->language_defn,
argvec[0], nargs, argvec + 1);
return call_function_by_hand (argvec[0], nargs, argvec + 1);
- /* pai: FIXME save value from call_function_by_hand, then adjust pc by adjust_fn_pc if +ve */
+ /* pai: FIXME save value from call_function_by_hand, then adjust
+ pc by adjust_fn_pc if +ve. */
case OP_F77_UNDETERMINED_ARGLIST:
/* It's a function call. */
/* Allocate arg vector, including space for the function to be
called in argvec[0] and a terminating NULL */
- argvec = (struct value **) alloca (sizeof (struct value *) * (nargs + 2));
+ argvec = (struct value **)
+ alloca (sizeof (struct value *) * (nargs + 2));
argvec[0] = arg1;
tem = 1;
for (; tem <= nargs; tem++)
else
{
struct value *temp = arg1;
+
return value_struct_elt (&temp, NULL, &exp->elts[pc + 2].string,
NULL, "structure");
}
if (noside == EVAL_SKIP)
goto nosideret;
+ /* Check to see if operator '->' has been overloaded. If so replace
+ arg1 with the value returned by evaluating operator->(). */
+ while (unop_user_defined_p (op, arg1))
+ {
+ volatile struct gdb_exception except;
+ struct value *value = NULL;
+ TRY_CATCH (except, RETURN_MASK_ERROR)
+ {
+ value = value_x_unop (arg1, op, noside);
+ }
+
+ if (except.reason < 0)
+ {
+ if (except.error == NOT_FOUND_ERROR)
+ break;
+ else
+ throw_exception (except);
+ }
+ arg1 = value;
+ }
+
/* JYG: if print object is on we need to replace the base type
with rtti type in order to continue on with successful
lookup of member / method only available in the rtti type. */
else
{
struct value *temp = arg1;
+
return value_struct_elt (&temp, NULL, &exp->elts[pc + 2].string,
NULL, "structure pointer");
}
return value_ind (arg3);
default:
- error (_("non-pointer-to-member value used in pointer-to-member construct"));
+ error (_("non-pointer-to-member value used "
+ "in pointer-to-member construct"));
}
case TYPE_INSTANCE:
type = check_typedef (value_type (arg1));
if (TYPE_CODE (type) == TYPE_CODE_METHODPTR
|| TYPE_CODE (type) == TYPE_CODE_MEMBERPTR)
- error (_("Attempt to dereference pointer to member without an object"));
+ error (_("Attempt to dereference pointer "
+ "to member without an object"));
if (noside == EVAL_SKIP)
goto nosideret;
if (unop_user_defined_p (op, arg1))
}
else
{
- struct value *retvalp = evaluate_subexp_for_address (exp, pos, noside);
+ struct value *retvalp = evaluate_subexp_for_address (exp, pos,
+ noside);
+
return retvalp;
}
else
{
CORE_ADDR tls_addr;
+
tls_addr = target_translate_tls_address (exp->elts[pc + 1].objfile,
value_as_address (arg1));
return value_at_lazy (exp->elts[pc + 2].type, tls_addr);
else
{
struct value *tmp = arg1;
+
arg2 = value_one (value_type (arg1), not_lval);
binop_promote (exp->language_defn, exp->gdbarch, &tmp, &arg2);
arg2 = value_binop (tmp, arg2, BINOP_ADD);
else
{
struct value *tmp = arg1;
+
arg2 = value_one (value_type (arg1), not_lval);
binop_promote (exp->language_defn, exp->gdbarch, &tmp, &arg2);
arg2 = value_binop (tmp, arg2, BINOP_SUB);
}
else
{
+ arg3 = value_non_lval (arg1);
+
if (ptrmath_type_p (exp->language_defn, value_type (arg1)))
arg2 = value_ptradd (arg1, 1);
else
{
struct value *tmp = arg1;
+
arg2 = value_one (value_type (arg1), not_lval);
binop_promote (exp->language_defn, exp->gdbarch, &tmp, &arg2);
arg2 = value_binop (tmp, arg2, BINOP_ADD);
}
value_assign (arg1, arg2);
- return arg1;
+ return arg3;
}
case UNOP_POSTDECREMENT:
}
else
{
+ arg3 = value_non_lval (arg1);
+
if (ptrmath_type_p (exp->language_defn, value_type (arg1)))
arg2 = value_ptradd (arg1, -1);
else
{
struct value *tmp = arg1;
+
arg2 = value_one (value_type (arg1), not_lval);
binop_promote (exp->language_defn, exp->gdbarch, &tmp, &arg2);
arg2 = value_binop (tmp, arg2, BINOP_SUB);
}
value_assign (arg1, arg2);
- return arg1;
+ return arg3;
}
case OP_THIS:
else if (noside == EVAL_AVOID_SIDE_EFFECTS)
{
struct type *type = exp->elts[pc + 1].type;
+
/* If this is a typedef, then find its immediate target. We
use check_typedef to resolve stubs, but we ignore its
result because we do not want to dig past all
then they should be separate cases, with more descriptive
error messages. */
- error (_("\
-GDB does not (yet) know how to evaluate that kind of expression"));
+ error (_("GDB does not (yet) know how to "
+ "evaluate that kind of expression"));
}
nosideret:
if (noside == EVAL_AVOID_SIDE_EFFECTS)
{
struct type *type =
- lookup_pointer_type (SYMBOL_TYPE (var));
+ lookup_pointer_type (SYMBOL_TYPE (var));
enum address_class sym_class = SYMBOL_CLASS (var);
if (sym_class == LOC_CONST
return value_zero (lookup_pointer_type (TYPE_TARGET_TYPE (type)),
not_lval);
else
- error (_("Attempt to take address of value not located in memory."));
+ error (_("Attempt to take address of "
+ "value not located in memory."));
}
return value_addr (x);
}
var = exp->elts[pc + 2].symbol;
type = check_typedef (SYMBOL_TYPE (var));
if (TYPE_CODE (type) == TYPE_CODE_ARRAY
+ && !TYPE_VECTOR (type)
&& CAST_IS_CONVERSION (exp->language_defn))
{
(*pos) += 4;
{
char *tmp = (char *) alloca (length + 4);
struct expression *expr;
+
tmp[0] = '(';
memcpy (tmp + 1, p, length);
tmp[length + 1] = ')';