OSDN Git Service

Fix ada array bounds display
authorbrobecke <brobecke>
Fri, 1 Jul 2011 18:27:11 +0000 (18:27 +0000)
committerbrobecke <brobecke>
Fri, 1 Jul 2011 18:27:11 +0000 (18:27 +0000)
commit1e5d7a51374aed4ce72af55c8616c1cb36c55010
tree32a2f37dbf5b850fe173cf31a8c1100cccdcc2b3
parent1fa4b0d5829dde05a283a402a257607a48f2de15
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.
gdb/ChangeLog
gdb/ada-typeprint.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.ada/packed_array.exp