* amd64-sol2-tdep.c (amd64_sol2_gregset_reg_offset): Correct
[deliverable/binutils-gdb.git] / gdb / ada-valprint.c
index f0901a8c137a991d6e57e44b4cae7669d4336116..f43f3e3be5e405ee461fe21b8129981735245084 100644 (file)
@@ -1,8 +1,7 @@
 /* Support for printing Ada values for GDB, the GNU debugger.
 
-   Copyright (C) 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1997, 2001, 2002,
-   2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
-   Free Software Foundation, Inc.
+   Copyright (C) 1986, 1988-1989, 1991-1994, 1997, 2001-2012 Free
+   Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -682,7 +681,8 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr,
   type = ada_check_typedef (type);
 
   if (ada_is_array_descriptor_type (type)
-      || ada_is_constrained_packed_array_type (type))
+      || (ada_is_constrained_packed_array_type (type)
+         && TYPE_CODE (type) != TYPE_CODE_PTR))
     {
       int retn;
       struct value *mark = value_mark ();
@@ -897,9 +897,18 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr,
       
       if (TYPE_CODE (elttype) != TYPE_CODE_UNDEF)
         {
-          CORE_ADDR deref_val_int
-           = unpack_pointer (type, valaddr + offset_aligned);
+          CORE_ADDR deref_val_int;
+         struct value *deref_val;
 
+         deref_val = coerce_ref_if_computed (original_value);
+         if (deref_val)
+           {
+             common_val_print (deref_val, stream, recurse + 1, options,
+                               current_language);
+             break;
+           }
+
+          deref_val_int = unpack_pointer (type, valaddr + offset_aligned);
           if (deref_val_int != 0)
             {
               struct value *deref_val =
This page took 0.024682 seconds and 4 git commands to generate.