aboutsummaryrefslogtreecommitdiff
path: root/gdb/f-lang.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/f-lang.c')
-rw-r--r--gdb/f-lang.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gdb/f-lang.c b/gdb/f-lang.c
index d79c458c..0c49420 100644
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -971,6 +971,25 @@ eval_op_f_rank (struct type *expect_type,
return value_from_longest (result_type, ndim);
}
+/* A helper function for UNOP_FORTRAN_LOC. */
+
+struct value *
+eval_op_f_loc (struct type *expect_type, struct expression *exp,
+ enum noside noside, enum exp_opcode op,
+ struct value *arg1)
+{
+ struct type *result_type;
+ if (gdbarch_ptr_bit (exp->gdbarch) == 16)
+ result_type = builtin_f_type (exp->gdbarch)->builtin_integer_s2;
+ else if (gdbarch_ptr_bit (exp->gdbarch) == 32)
+ result_type = builtin_f_type (exp->gdbarch)->builtin_integer;
+ else
+ result_type = builtin_f_type (exp->gdbarch)->builtin_integer_s8;
+
+ LONGEST result_value = value_address (arg1);
+ return value_from_longest (result_type, result_value);
+}
+
namespace expr
{