diff options
author | Joel Brobecker <brobecker@gnat.com> | 2011-07-01 18:27:12 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2011-07-01 18:27:12 +0000 |
commit | 54ae186fb505f4873858ae56b2298c9471f9eaee (patch) | |
tree | 85b515d6e0cd7dc91d49fd61a67fda2ab27a73bb /gdb/testsuite/gdb.ada | |
parent | 8f17729f21e54827ba8de614be382c4fbd6b690f (diff) | |
download | fsf-binutils-gdb-54ae186fb505f4873858ae56b2298c9471f9eaee.zip fsf-binutils-gdb-54ae186fb505f4873858ae56b2298c9471f9eaee.tar.gz fsf-binutils-gdb-54ae186fb505f4873858ae56b2298c9471f9eaee.tar.bz2 |
Fix ada array bounds display
Array bounds were not correctly displayed when the SHOW parameter of
print_type functions is set to -1. This shows up in the following
type of situation, where we have a declaration as follow:
Anon_Array_Int_Obj : array (1..10) of Integer := (others => 8);
In GDB/MI mode, trying to print the type info for our array object
yields:
(gdb) -var-create ai 0 Anon_Array_Int_Obj
(gdb) -var-info-type ai
^done,type="array (...) of integer"
The actual bounds are missing. Contrast this with what happens
when in GDB/CLI mode:
(gdb) ptype Anon_Array_Int_Obj
type = array (1 .. 10) of integer
This patch fixes array type printing accordingly. And as it turns
out, it also improves the output for one of the tests already present,
so it shows that it's not just the GDB/MI mode that's affected.
gdb/ChangeLog (Jean-Charles Delay):
* ada-typeprint.c (print_array_type): removed if condition on show
being negative for bounds printing.
gdb/testsuite/ChangeLog (Jean-Charles Delay):
* gdb.ada/packed_array.exp: fixed expected output.
Diffstat (limited to 'gdb/testsuite/gdb.ada')
-rw-r--r-- | gdb/testsuite/gdb.ada/packed_array.exp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.ada/packed_array.exp b/gdb/testsuite/gdb.ada/packed_array.exp index fc4dd17..3318873 100644 --- a/gdb/testsuite/gdb.ada/packed_array.exp +++ b/gdb/testsuite/gdb.ada/packed_array.exp @@ -48,7 +48,7 @@ gdb_test "ptype &var" \ "ptype &var" gdb_test "print &var" \ - "= \\(access array \\(\\.\\.\\.\\) of boolean\\) \\(4 => true, false, true, false, true\\)" \ + "= \\(access array \\(4 \\.\\. 8\\) of boolean <packed: 1-bit elements>\\) \\(4 => true, false, true, false, true\\)" \ "print &var" # Print the value of U_Var, an unconstrainted packed array. |