aboutsummaryrefslogtreecommitdiff
path: root/gdb/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/eval.c')
-rw-r--r--gdb/eval.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gdb/eval.c b/gdb/eval.c
index ad66f7c..2fdfdf9 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -2667,6 +2667,19 @@ evaluate_subexp_standard (struct type *expect_type,
}
return evaluate_subexp_for_sizeof (exp, pos, noside);
+ case UNOP_ALIGNOF:
+ {
+ struct type *type
+ = value_type (evaluate_subexp (NULL_TYPE, exp, pos,
+ EVAL_AVOID_SIDE_EFFECTS));
+ /* FIXME: This should be size_t. */
+ struct type *size_type = builtin_type (exp->gdbarch)->builtin_int;
+ ULONGEST align = type_align (type);
+ if (align == 0)
+ error (_("could not determine alignment of type"));
+ return value_from_longest (size_type, align);
+ }
+
case UNOP_CAST:
(*pos) += 2;
type = exp->elts[pc + 1].type;