diff options
author | KONRAD Frederic <konrad@adacore.com> | 2019-02-13 22:37:11 -0500 |
---|---|---|
committer | Joel Brobecker <brobecker@adacore.com> | 2019-02-13 22:37:11 -0500 |
commit | 2988d01ea5fcc474a9b714d2148bab5fcf4e4be8 (patch) | |
tree | 9f5feec6feca27ebefdeca266b9e00e0c7c74e08 /gdb/riscv-tdep.c | |
parent | c559d7096b4b1b9c4e8d78cfd67b1892c1836ffb (diff) | |
download | gdb-2988d01ea5fcc474a9b714d2148bab5fcf4e4be8.zip gdb-2988d01ea5fcc474a9b714d2148bab5fcf4e4be8.tar.gz gdb-2988d01ea5fcc474a9b714d2148bab5fcf4e4be8.tar.bz2 |
(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.
Diffstat (limited to 'gdb/riscv-tdep.c')
-rw-r--r-- | gdb/riscv-tdep.c | 1 |
1 files changed, 1 insertions, 0 deletions
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: |