aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@adacore.com>2018-05-02 13:59:12 -0700
committerTom Tromey <tromey@adacore.com>2021-12-02 09:08:50 -0700
commita6617193990fd9b6762d735f742f2df542b859c7 (patch)
tree0abe11c0d98e0279c3d8a8e635d40508e68bcc9c
parent28397ae781e0780259648991f981909c5a5045e7 (diff)
downloadgdb-a6617193990fd9b6762d735f742f2df542b859c7.zip
gdb-a6617193990fd9b6762d735f742f2df542b859c7.tar.gz
gdb-a6617193990fd9b6762d735f742f2df542b859c7.tar.bz2
(ARM/fixed-point) wrong value shown by "finish" command:
Consider the following Ada code: type FP1_Type is delta 0.1 range -1.0 .. +1.0; -- Ordinary FP1_Arg : FP1_Type := 0.0; function Call_FP1 (F : FP1_Type) return FP1_Type is begin FP1_Arg := F; return FP1_Arg; end Call_FP1; After having stopped inside function Call_FP1 as follow: Breakpoint 1, pck.call_fp1 (f=1) at /[...]/pck.adb:5 5 FP1_Arg := F; Returning from that function call using "finish" should show that the function return "1.0" (the same value as was passed as an argument). However, this is not the case: (gdb) finish Run till exit from #0 pck.call_fp1 (f=1) [...] 9 F1 := Call_FP1 (F1); Value returned is $1 = 0 This patch enhances the extraction of the return value to know about fixed point types.
-rw-r--r--gdb/arm-tdep.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 7495434..e0ef1d2 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -8001,7 +8001,8 @@ arm_extract_return_value (struct type *type, struct regcache *regs,
|| type->code () == TYPE_CODE_BOOL
|| type->code () == TYPE_CODE_PTR
|| TYPE_IS_REFERENCE (type)
- || type->code () == TYPE_CODE_ENUM)
+ || type->code () == TYPE_CODE_ENUM
+ || is_fixed_point_type (type))
{
/* If the type is a plain integer, then the access is
straight-forward. Otherwise we have to play around a bit