From 28397ae781e0780259648991f981909c5a5045e7 Mon Sep 17 00:00:00 2001 From: Xavier Roirand Date: Fri, 12 May 2017 15:02:28 +0200 Subject: (Ada/AArch64) fix fixed point argument passing in inferior funcall Consider the following code: type FP1_Type is delta 0.1 range -1.0 .. +1.0; -- Ordinary function Call_FP1 (F : FP1_Type) return FP1_Type is begin return F; end Call_FP1; When the default in GCC is to generate proper DWARF info for fixed point types, then in gdb, printing the result of a call to call_fp1 with a decimal parameter leads to: (gdb) p call_fp1(0.5) $1 = 0 The displayed value is wrong, and we actually expected: (gdb) p call_fp1(0.5) $1 = 0.5 What happened is that our fixed point type parameter got promoted to a 32bit integer because we detected that the length of that object was less than 4 bytes. The compiler does not perform this promotion and therefore GDB should not either. This patch fixes the behavior described above. --- gdb/aarch64-tdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/aarch64-tdep.c') diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index 31d239b..3287499 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -1917,7 +1917,7 @@ aarch64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, case TYPE_CODE_CHAR: case TYPE_CODE_RANGE: case TYPE_CODE_ENUM: - if (len < 4) + if (len < 4 && !is_fixed_point_type (arg_type)) { /* Promote to 32 bit integer. */ if (arg_type->is_unsigned ()) -- cgit v1.1