This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit/Ada] [Ada] Do not use name-based lookup for unconstrained packed arrays.


The following change got left out when support for unconstrained packed
arrays was contributed, because it depended on some code that had not
been contributed yet.  Now that the descriptive-type support is in,
this change should be put in as well.

The idea behind the check is that older versions of the compiler were
not generating the descriptive-type attribute for packed arrays. So,
to allow the debugger work with these compilers, we've added a check
that causes GDB to fallback to the traditional name-based lookup for
packed arrays.

However, the check can be further refined in this case, because the
encoding was not detailed enough to support the unconstrained version
of packed arrays.  It is therefore unnecessary to use the fallback
for unconstrained packed arrays.

gdb/ChangeLog:

        * ada-lang.c (find_parallel_type_by_descriptive_type):
        Limit the fallback to name-based lookups to the case where
        the type is a constrained packed array.

Tested on x86_64-linux. Checked in.
-- 
Joel

---
 gdb/ada-lang.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 24def95..8f90711 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -6687,7 +6687,7 @@ find_parallel_type_by_descriptive_type (struct type *type, const char *name)
      older compilers, the descriptive type information is either absent or
      irrelevant when it comes to packed arrays so the above lookup fails.
      Fall back to using a parallel lookup by name in this case.  */
-  if (result == NULL && ada_is_packed_array_type (type))
+  if (result == NULL && ada_is_constrained_packed_array_type (type))
     return ada_find_any_type (name);
 
   return result;
-- 
1.6.3.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]