From: KONRAD Frederic Date: Thu, 14 Feb 2019 03:37:11 +0000 (-0500) Subject: (riscv/ada) fix error when calling functions with range argument X-Git-Tag: gdb-8.3-release~212 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2988d01ea5fcc474a9b714d2148bab5fcf4e4be8;p=platform%2Fupstream%2Fbinutils.git (riscv/ada) fix error when calling functions with range argument Using the gdb.ada/call_pn.exp testcase, and running it by hand on riscv64-elf, we get the following error: (gdb) call pn(55) Could not compute alignment of type The problem occurs because the parameter's type is a TYPE_CODE_RANGE, and that type code is not handled by riscv_type_alignment. So this patch fixes the issue by handling TYPE_CODE_RANGE the same way we handle other integral types. gdb/ChangeLog: * riscv-rdep.c (riscv_type_alignment): Handle TYPE_CODE_RANGE. Tested on riscv64-elf using AdaCore's testsuite. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0dec9b0..34fe174 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2019-02-14 Frederic Konrad + + * riscv-rdep.c (riscv_type_alignment): Handle TYPE_CODE_RANGE. + 2019-02-14 Joel Brobecker * windows-nat.c (windows_add_thread): Add new parameter diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c index fb5e2c5..3e8f564 100644 --- a/gdb/riscv-tdep.c +++ b/gdb/riscv-tdep.c @@ -1632,6 +1632,7 @@ riscv_type_alignment (struct type *t) default: error (_("Could not compute alignment of type")); + case TYPE_CODE_RANGE: case TYPE_CODE_RVALUE_REF: case TYPE_CODE_PTR: case TYPE_CODE_ENUM: