aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/ada-valprint.c2
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.ada/array_char_idx.exp3
-rw-r--r--gdb/testsuite/gdb.ada/array_char_idx/pck.ads3
5 files changed, 20 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b632382..ab98fb4 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2018-01-03 Xavier Roirand <roirand@adacore.com>
+
+ * ada-valprint.c (print_optional_low_bound): Handle
+ character-indexed array printing like boolean-indexed array
+ printing.
+
2018-01-05 Joel Brobecker <brobecker@adacore.com>
* NEWS: Create a new section for the next release branch.
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index c5efdf1..f5a2c3c 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -88,9 +88,11 @@ print_optional_low_bound (struct ui_file *stream, struct type *type,
index_type = TYPE_TARGET_TYPE (index_type);
}
+ /* Don't print the lower bound if it's the default one. */
switch (TYPE_CODE (index_type))
{
case TYPE_CODE_BOOL:
+ case TYPE_CODE_CHAR:
if (low_bound == 0)
return 0;
break;
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index ea9d65c..f45ae0c 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2018-01-05 Xavier Roirand <brobecker@adacore.com>
+
+ * testsuite/gdb.ada/array_char_idx/pck.ads (Table): New type.
+ (My_Table): New global variable.
+ * testsuite/gdb.ada/array_char_idx.exp: Add test.
+
2018-01-04 Joel Brobecker <brobecker@adacore.com>
PR gdb/22670
diff --git a/gdb/testsuite/gdb.ada/array_char_idx.exp b/gdb/testsuite/gdb.ada/array_char_idx.exp
index 2608a8e..89805fb 100644
--- a/gdb/testsuite/gdb.ada/array_char_idx.exp
+++ b/gdb/testsuite/gdb.ada/array_char_idx.exp
@@ -30,3 +30,6 @@ gdb_test "ptype char_table" \
gdb_test "ptype global_char_table" \
"= array \\(character\\) of natural"
+
+gdb_test "print my_table" "= \\(0 <repeats 256 times>\\)" \
+ "Display my_table"
diff --git a/gdb/testsuite/gdb.ada/array_char_idx/pck.ads b/gdb/testsuite/gdb.ada/array_char_idx/pck.ads
index a26393a..699fef9 100644
--- a/gdb/testsuite/gdb.ada/array_char_idx/pck.ads
+++ b/gdb/testsuite/gdb.ada/array_char_idx/pck.ads
@@ -19,5 +19,8 @@ package Pck is
of Natural;
Global_Char_Table : Char_Table := (others => 0);
+ type Table is array (Character) of Natural;
+ My_Table : Table := (others => 4874);
+
procedure Do_Nothing (A : System.Address);
end Pck;