aboutsummaryrefslogtreecommitdiff
path: root/gdb/thread-fsm.h
diff options
context:
space:
mode:
authorJerome Guitton <guitton@adacore.com>2018-01-05 03:03:59 -0500
committerJoel Brobecker <brobecker@adacore.com>2018-01-05 03:14:19 -0500
commit7150d33cda60fd543e9d9d68eb58d4e6155fb878 (patch)
tree7c477193d908664414cd91e9fa3136d9a4f2da50 /gdb/thread-fsm.h
parentcc0e770c0d00acececc43826f4673896d09b3dff (diff)
downloadfsf-binutils-gdb-7150d33cda60fd543e9d9d68eb58d4e6155fb878.zip
fsf-binutils-gdb-7150d33cda60fd543e9d9d68eb58d4e6155fb878.tar.gz
fsf-binutils-gdb-7150d33cda60fd543e9d9d68eb58d4e6155fb878.tar.bz2
(Ada) Fix Length attribute on array access
Consider the following variable "Indexed_By_Enum", declared as an access to an array whose index type is an enumerated type whose underlying values have "gaps": type Enum_With_Gaps is (LIT0, LIT1, LIT2, LIT3, LIT4); for Enum_With_Gaps use (LIT0 => 3, LIT1 => 5, LIT2 => 8, LIT3 => 13, LIT4 => 21); for Enum_With_Gaps'size use 16; type MyWord is range 0 .. 16#FFFF# ; for MyWord'Size use 16; type AR is array (Enum_With_Gaps range <>) of MyWord; type AR_Access is access AR; Indexed_By_Enum : AR_Access := new AR'(LIT1 => 1, LIT2 => 43, LIT3 => 42, LIT4 => 41); Trying to print the length (number of elements) of this array using the 'Length attribute does not work: (gdb) print indexed_by_enum'length 'POS only defined on discrete types The problem occurs while trying to get the array's index type. It was using TYPE_INDEX_TYPE for that. It does not work for Ada arrays in general; use ada_index_type instead. gdb/ChangeLog: * ada-lang.c (ada_array_length): Use ada_index_type instead of TYPE_INDEX_TYPE. gdb/testsuite/ChangeLog: * gdb.ada/arr_acc_idx_w_gap: New testcase. Tested on x86_64-linux.
Diffstat (limited to 'gdb/thread-fsm.h')
0 files changed, 0 insertions, 0 deletions