* gdbthread.h (struct thread_info): Add comments around
[deliverable/binutils-gdb.git] / gdb / ada-typeprint.c
index e3397d707f89c6aba4889ad1c7c8dfcbe05db58d..e46637f48b353379c933e68bceee0278b4201b03 100644 (file)
@@ -1,23 +1,21 @@
 /* Support for printing Ada types for GDB, the GNU debugger.
-   Copyright (C) 1986, 1988, 1989, 1991, 1997, 1998, 1999, 2000, 
-   2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1986, 1988, 1989, 1991, 1997, 1998, 1999, 2000, 2001, 2002,
+   2003, 2004, 2007, 2008 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   This file is part of GDB.
 
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
 #include "gdb_obstack.h"
@@ -368,6 +366,9 @@ print_array_type (struct type *type, struct ui_file *stream, int show,
   int bitsize;
   int n_indices;
 
+  if (ada_is_packed_array_type (type))
+    type = ada_coerce_to_simple_array_type (type);
+
   bitsize = 0;
   fprintf_filtered (stream, "array (");
 
@@ -376,8 +377,6 @@ print_array_type (struct type *type, struct ui_file *stream, int show,
     fprintf_filtered (stream, "...");
   else
     {
-      if (ada_is_packed_array_type (type))
-       type = ada_coerce_to_simple_array_type (type);
       if (type == NULL)
         {
           fprintf_filtered (stream, _("<undecipherable array type>"));
@@ -586,7 +585,7 @@ print_record_field_types (struct type *type, struct type *outer_type,
   flds = 0;
   len = TYPE_NFIELDS (type);
 
-  if (len == 0 && (TYPE_FLAGS (type) & TYPE_FLAG_STUB) != 0)
+  if (len == 0 && TYPE_STUB (type))
     return -1;
 
   for (i = 0; i < len; i += 1)
@@ -755,7 +754,7 @@ ada_print_type (struct type *type0, char *varstring, struct ui_file *stream,
                int show, int level)
 {
   struct type *type = ada_check_typedef (ada_get_base_type (type0));
-  char *type_name = decoded_type_name (type);
+  char *type_name = decoded_type_name (type0);
   int is_var_decl = (varstring != NULL && varstring[0] != '\0');
 
   if (type == NULL)
@@ -784,7 +783,17 @@ ada_print_type (struct type *type0, char *varstring, struct ui_file *stream,
   if (ada_is_aligner_type (type))
     ada_print_type (ada_aligned_type (type), "", stream, show, level);
   else if (ada_is_packed_array_type (type))
-    print_array_type (type, stream, show, level);
+    {
+      if (TYPE_CODE (type) == TYPE_CODE_PTR)
+        {
+          fprintf_filtered (stream, "access ");
+          print_array_type (TYPE_TARGET_TYPE (type), stream, show, level);
+        }
+      else
+        {
+          print_array_type (type, stream, show, level);
+        }
+    }
   else
     switch (TYPE_CODE (type))
       {
@@ -804,6 +813,9 @@ ada_print_type (struct type *type0, char *varstring, struct ui_file *stream,
       case TYPE_CODE_ARRAY:
        print_array_type (type, stream, show, level);
        break;
+      case TYPE_CODE_BOOL:
+       fprintf_filtered (stream, "(false, true)");
+       break;
       case TYPE_CODE_INT:
        if (ada_is_fixed_point_type (type))
          print_fixed_point_type (type, stream);
This page took 0.024925 seconds and 4 git commands to generate.