* as.h [NEED_DECLARATION_FFS] (ffs): Prototype and alphabetize.
[deliverable/binutils-gdb.git] / gdb / p-typeprint.c
index 0facebfa9d1c24923db9c7a6793e1439d809773b..a13471622d621e4c911f97341f22a6f637f26a77 100644 (file)
@@ -1,5 +1,5 @@
 /* Support for printing Pascal types for GDB, the GNU debugger.
-   Copyright 2000
+   Copyright 2000, 2001, 2002
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -21,7 +21,7 @@
 /* This file is derived from p-typeprint.c */
 
 #include "defs.h"
-#include "obstack.h"
+#include "gdb_obstack.h"
 #include "bfd.h"               /* Binary File Description */
 #include "symtab.h"
 #include "gdbtypes.h"
@@ -37,8 +37,6 @@
 #include <errno.h>
 #include <ctype.h>
 
-static void pascal_type_print_args (struct type *, struct ui_file *);
-
 static void pascal_type_print_varspec_suffix (struct type *, struct ui_file *, int, int, int);
 
 static void pascal_type_print_derivation_info (struct ui_file *, struct type *);
@@ -52,7 +50,7 @@ void
 pascal_print_type (struct type *type, char *varstring, struct ui_file *stream,
                   int show, int level)
 {
-  register enum type_code code;
+  enum type_code code;
   int demangled_args;
 
   code = TYPE_CODE (type);
@@ -141,8 +139,8 @@ void
 pascal_type_print_method_args (char *physname, char *methodname,
                               struct ui_file *stream)
 {
-  int is_constructor = STREQN (physname, "__ct__", 6);
-  int is_destructor = STREQN (physname, "__dt__", 6);
+  int is_constructor = DEPRECATED_STREQN (physname, "__ct__", 6);
+  int is_destructor = DEPRECATED_STREQN (physname, "__dt__", 6);
 
   if (is_constructor || is_destructor)
     {
@@ -296,57 +294,11 @@ pascal_type_print_varspec_prefix (struct type *type, struct ui_file *stream,
          gcc -Wall will reveal any types that haven't been handled.  */
       break;
     default:
-      error ("type not handled in pascal_type_print_varspec_prefix()");
+      error (_("type not handled in pascal_type_print_varspec_prefix()"));
       break;
     }
 }
 
-static void
-pascal_type_print_args (struct type *type, struct ui_file *stream)
-{
-  int i;
-  struct type **args;
-
-  /*  fprintf_filtered (stream, "(");
-     no () for procedures !! */
-  args = TYPE_ARG_TYPES (type);
-  if (args != NULL)
-    {
-      if ((args[1] != NULL && args[1]->code != TYPE_CODE_VOID) ||
-         (args[2] != NULL))
-       {
-         fprintf_filtered (stream, "(");
-       }
-      if (args[1] == NULL)
-       {
-         fprintf_filtered (stream, "...");
-       }
-      else
-       {
-         for (i = 1;
-              args[i] != NULL && args[i]->code != TYPE_CODE_VOID;
-              i++)
-           {
-             pascal_print_type (args[i], "", stream, -1, 0);
-             if (args[i + 1] == NULL)
-               {
-                 fprintf_filtered (stream, "...");
-               }
-             else if (args[i + 1]->code != TYPE_CODE_VOID)
-               {
-                 fprintf_filtered (stream, ",");
-                 wrap_here ("    ");
-               }
-           }
-       }
-      if ((args[1] != NULL && args[1]->code != TYPE_CODE_VOID) ||
-         (args[2] != NULL))
-       {
-         fprintf_filtered (stream, ")");
-       }
-    }
-}
-
 static void
 pascal_print_func_args (struct type *type, struct ui_file *stream)
 {
@@ -412,7 +364,6 @@ pascal_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
       pascal_type_print_method_args ("",
                                     "",
                                     stream);
-      /* pascal_type_print_args (type, stream); */
       if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_VOID)
        {
          fprintf_filtered (stream, " : ");
@@ -464,7 +415,7 @@ pascal_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
          gcc -Wall will report types that may not have been considered.  */
       break;
     default:
-      error ("type not handled in pascal_type_print_varspec_suffix()");
+      error (_("type not handled in pascal_type_print_varspec_suffix()"));
       break;
     }
 }
@@ -489,9 +440,9 @@ void
 pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
                        int level)
 {
-  register int i;
-  register int len;
-  register int lastval;
+  int i;
+  int len;
+  int lastval;
   enum
     {
       s_none, s_public, s_private, s_protected
@@ -509,8 +460,8 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
   /* void pointer */
   if ((TYPE_CODE (type) == TYPE_CODE_PTR) && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_VOID))
     {
-      fprintf_filtered (stream,
-                       TYPE_NAME (type) ? TYPE_NAME (type) : "pointer");
+      fputs_filtered (TYPE_NAME (type) ? TYPE_NAME (type) : "pointer",
+                     stream);
       return;
     }
   /* When SHOW is zero or less, and there is a valid type name, then always
@@ -588,7 +539,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
          fprintf_filtered (stream, "\n");
          if ((TYPE_NFIELDS (type) == 0) && (TYPE_NFN_FIELDS (type) == 0))
            {
-             if (TYPE_FLAGS (type) & TYPE_FLAG_STUB)
+             if (TYPE_STUB (type))
                fprintfi_filtered (level + 4, stream, "<incomplete type>\n");
              else
                fprintfi_filtered (level + 4, stream, "<no data fields>\n");
@@ -608,7 +559,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
            {
              QUIT;
              /* Don't print out virtual function table.  */
-             if (STREQN (TYPE_FIELD_NAME (type, i), "_vptr", 5)
+             if (DEPRECATED_STREQN (TYPE_FIELD_NAME (type, i), "_vptr", 5)
                  && is_cplus_marker ((TYPE_FIELD_NAME (type, i))[5]))
                continue;
 
@@ -686,8 +637,8 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
                {
                  char *physname = TYPE_FN_FIELD_PHYSNAME (f, j);
 
-                 int is_constructor = STREQN (physname, "__ct__", 6);
-                 int is_destructor = STREQN (physname, "__dt__", 6);
+                 int is_constructor = DEPRECATED_STREQN (physname, "__ct__", 6);
+                 int is_destructor = DEPRECATED_STREQN (physname, "__dt__", 6);
 
                  QUIT;
                  if (TYPE_FN_FIELD_PROTECTED (f, j))
@@ -837,6 +788,14 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
                         show - 1, level);
       break;
 
+    case TYPE_CODE_BITSTRING:
+      fputs_filtered ("BitString", stream);
+      break;
+
+    case TYPE_CODE_STRING:
+      fputs_filtered ("String", stream);
+      break;
+
     default:
       /* Handle types not explicitly handled by the other cases,
          such as fundamental types.  For these, just print whatever
This page took 0.027146 seconds and 4 git commands to generate.