+2013-05-13 Tom Tromey <tromey@redhat.com>
+
+ PR exp/15364:
+ * eval.c (evaluate_subexp_standard) <STRUCTOP_STRUCT,
+ STRUCTOP_PTR>: Return a not_lval value for
+ EVAL_AVOID_SIDE_EFFECTS.
+ * opencl-lang.c (evaluate_subexp_opencl): Return a not_lval value
+ for EVAL_AVOID_SIDE_EFFECTS.
+
2013-05-13 Joel Brobecker <brobecker@adacore.com>
* rs6000-aix-tdep.c (rs6000_push_dummy_call): Convert
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
if (noside == EVAL_SKIP)
goto nosideret;
- /* Also handle EVAL_AVOID_SIDE_EFFECTS. */
- return value_struct_elt (&arg1, NULL, &exp->elts[pc + 2].string,
+ arg3 = value_struct_elt (&arg1, NULL, &exp->elts[pc + 2].string,
NULL, "structure");
+ if (noside == EVAL_AVOID_SIDE_EFFECTS)
+ arg3 = value_zero (value_type (arg3), not_lval);
+ return arg3;
case STRUCTOP_PTR:
tem = longest_to_int (exp->elts[pc + 1].longconst);
}
}
- /* Also handle EVAL_AVOID_SIDE_EFFECTS. */
- return value_struct_elt (&arg1, NULL, &exp->elts[pc + 2].string,
+ arg3 = value_struct_elt (&arg1, NULL, &exp->elts[pc + 2].string,
NULL, "structure pointer");
+ if (noside == EVAL_AVOID_SIDE_EFFECTS)
+ arg3 = value_zero (value_type (arg3), not_lval);
+ return arg3;
case STRUCTOP_MEMBER:
case STRUCTOP_MPTR:
}
else
{
- /* Also handle EVAL_AVOID_SIDE_EFFECTS. */
- return value_struct_elt (&arg1, NULL,
- &exp->elts[pc + 2].string, NULL,
- "structure");
+ struct value *v = value_struct_elt (&arg1, NULL,
+ &exp->elts[pc + 2].string, NULL,
+ "structure");
+
+ if (noside == EVAL_AVOID_SIDE_EFFECTS)
+ v = value_zero (value_type (v), not_lval);
+ return v;
}
}
default:
+2013-05-13 Tom Tromey <tromey@redhat.com>
+
+ * gdb.base/exprs.exp (test_expr): Add regression test.
+ * gdb.base/exprs.c (null_t_struct): New global.
+
2013-05-13 Muhammad Bilal <mbilal@codesourcery.com>
* gdb.base/default.exp: Disable history saving.
enum colors {red, green, blue} color;
enum cars {chevy, ford, porsche} clunker;
+struct t_struct *null_t_struct;
void dummy()
{
# Regression tests for cast to void.
gdb_test "print (void) v_int_pointer" " = void"
gdb_test "print & (void) v_char" "value not located in memory."
+
+# Regression test for "&&".
+gdb_test "print null_t_struct && null_t_struct->v_int_member == 0" \
+ " = 0"