daily update
[deliverable/binutils-gdb.git] / gdb / m2-typeprint.c
index c0b813844a66de9515b91aa82a921d075082340f..fb3d49c6de1808e9256962bf5554ade2745e2e4a 100644 (file)
@@ -1,6 +1,6 @@
 /* Support for printing Modula 2 types for GDB, the GNU debugger.
-   Copyright (C) 1986, 1988, 1989, 1991, 1992, 1995, 2000, 2001, 2002, 2003,
-                 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 1986, 1988-1989, 1991-1992, 1995, 2000-2012 Free
+   Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -66,11 +66,11 @@ int m2_is_unbounded_array (struct type *type);
 
 
 void
-m2_print_type (struct type *type, char *varstring, struct ui_file *stream,
+m2_print_type (struct type *type, const char *varstring,
+              struct ui_file *stream,
               int show, int level)
 {
   enum type_code code;
-  int demangled_args;
 
   CHECK_TYPEDEF (type);
 
@@ -133,7 +133,7 @@ m2_print_type (struct type *type, char *varstring, struct ui_file *stream,
       break;
 
     case TYPE_CODE_UNDEF:
-      /* i18n: Do not translate the "struct" part! */
+      /* i18n: Do not translate the "struct" part!  */
       m2_unknown (_("undef"), type, stream, show, level);
       break;
 
@@ -145,9 +145,6 @@ m2_print_type (struct type *type, char *varstring, struct ui_file *stream,
       m2_range (type, stream, show, level);
       break;
 
-    case TYPE_CODE_TEMPLATE:
-      break;
-
     default:
       m2_type_name (type, stream);
       break;
@@ -306,9 +303,6 @@ m2_print_bounds (struct type *type,
 {
   struct type *target = TYPE_TARGET_TYPE (type);
 
-  if (target == NULL)
-    target = builtin_type_int32;
-
   if (TYPE_NFIELDS(type) == 0)
     return;
 
@@ -334,8 +328,8 @@ m2_short_set (struct type *type, struct ui_file *stream, int show, int level)
 int
 m2_is_long_set (struct type *type)
 {
-  LONGEST previous_high = 0;  /* unnecessary initialization
-                                keeps gcc -Wall happy */
+  LONGEST previous_high = 0;  /* Unnecessary initialization
+                                keeps gcc -Wall happy */
   int len, i;
   struct type *range;
 
@@ -370,7 +364,7 @@ m2_is_long_set (struct type *type)
                             This should be integrated into gdbtypes.c
                             inside get_discrete_bounds.  */
 
-int
+static int
 m2_get_discrete_bounds (struct type *type, LONGEST *lowp, LONGEST *highp)
 {
   CHECK_TYPEDEF (type);
@@ -413,8 +407,6 @@ m2_is_long_set_of_type (struct type *type, struct type **of_type)
        return 0;
       range = TYPE_INDEX_TYPE (TYPE_FIELD_TYPE (type, i));
       target = TYPE_TARGET_TYPE (range);
-      if (target == NULL)
-       target = builtin_type_int32;
 
       l1 = TYPE_LOW_BOUND (TYPE_INDEX_TYPE (TYPE_FIELD_TYPE (type, i)));
       h1 = TYPE_HIGH_BOUND (TYPE_INDEX_TYPE (TYPE_FIELD_TYPE (type, len-1)));
@@ -431,8 +423,6 @@ m2_is_long_set_of_type (struct type *type, struct type **of_type)
 static int
 m2_long_set (struct type *type, struct ui_file *stream, int show, int level)
 {
-  struct type *index_type;
-  struct type *range_type;
   struct type *of_type;
   int i;
   int len = TYPE_NFIELDS (type);
@@ -477,7 +467,7 @@ m2_long_set (struct type *type, struct ui_file *stream, int show, int level)
            }
        }
       else
-       /* i18n: Do not translate the "SET OF" part! */
+       /* i18n: Do not translate the "SET OF" part!  */
        fprintf_filtered(stream, _("SET OF <unknown>"));
 
       return 1;
@@ -551,9 +541,9 @@ m2_record_fields (struct type *type, struct ui_file *stream, int show,
   wrap_here ("    ");
   if (show < 0)
     {
-      if (TYPE_CODE (type) == DECLARED_TYPE_STRUCT)
+      if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
        fprintf_filtered (stream, "RECORD ... END ");
-      else if (TYPE_DECLARED_TYPE (type) == DECLARED_TYPE_UNION)
+      else if (TYPE_CODE (type) == TYPE_CODE_UNION)
        fprintf_filtered (stream, "CASE ... END ");
     }
   else if (show > 0)
@@ -564,7 +554,7 @@ m2_record_fields (struct type *type, struct ui_file *stream, int show,
       if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
        fprintf_filtered (stream, "RECORD\n");
       else if (TYPE_CODE (type) == TYPE_CODE_UNION)
-       /* i18n: Do not translate "CASE" and "OF" */
+       /* i18n: Do not translate "CASE" and "OF" */
        fprintf_filtered (stream, _("CASE <variant> OF\n"));
 
       for (i = TYPE_N_BASECLASSES (type); i < len; i++)
@@ -617,10 +607,11 @@ m2_enum (struct type *type, struct ui_file *stream, int show, int level)
            fprintf_filtered (stream, ", ");
          wrap_here ("    ");
          fputs_filtered (TYPE_FIELD_NAME (type, i), stream);
-         if (lastval != TYPE_FIELD_BITPOS (type, i))
+         if (lastval != TYPE_FIELD_ENUMVAL (type, i))
            {
-             fprintf_filtered (stream, " = %d", TYPE_FIELD_BITPOS (type, i));
-             lastval = TYPE_FIELD_BITPOS (type, i);
+             fprintf_filtered (stream, " = %s",
+                               plongest (TYPE_FIELD_ENUMVAL (type, i)));
+             lastval = TYPE_FIELD_ENUMVAL (type, i);
            }
          lastval++;
        }
This page took 0.026539 seconds and 4 git commands to generate.