* Makefile.in (ALLDEPFILES): Remove alphanbsd-nat.c.
[deliverable/binutils-gdb.git] / gdb / p-typeprint.c
index a2cfadb4d40ed1e1f26e2dea7d6b005bcd76b22c..e8de7884f1de3ed4ac2725ff09578333e160db29 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.
 #include "value.h"
 #include "gdbcore.h"
 #include "target.h"
-#include "command.h"
-#include "gdbcmd.h"
 #include "language.h"
-#include "demangle.h"
 #include "p-lang.h"
 #include "typeprint.h"
 
@@ -40,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,12 +47,8 @@ void pascal_type_print_varspec_prefix (struct type *, struct ui_file *, int, int
 /* LEVEL is the depth to indent lines by.  */
 
 void
-pascal_print_type (type, varstring, stream, show, level)
-     struct type *type;
-     char *varstring;
-     struct ui_file *stream;
-     int show;
-     int level;
+pascal_print_type (struct type *type, char *varstring, struct ui_file *stream,
+                  int show, int level)
 {
   register enum type_code code;
   int demangled_args;
@@ -122,9 +113,7 @@ pascal_print_type (type, varstring, stream, show, level)
    the form that they appear in the source code. */
 
 static void
-pascal_type_print_derivation_info (stream, type)
-     struct ui_file *stream;
-     struct type *type;
+pascal_type_print_derivation_info (struct ui_file *stream, struct type *type)
 {
   char *name;
   int i;
@@ -147,10 +136,8 @@ pascal_type_print_derivation_info (stream, type)
 /* Print the Pascal method arguments ARGS to the file STREAM.  */
 
 void
-pascal_type_print_method_args (physname, methodname, stream)
-     char *physname;
-     char *methodname;
-     struct ui_file *stream;
+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);
@@ -170,11 +157,9 @@ pascal_type_print_method_args (physname, methodname, stream)
       char *argname;
       fputs_filtered (" (", stream);
       /* we must demangle this */
-      while isdigit
-       (physname[0])
+      while (isdigit (physname[0]))
        {
-         while isdigit
-           (physname[len])
+         while (isdigit (physname[len]))
            {
              len++;
            }
@@ -203,11 +188,8 @@ pascal_type_print_method_args (physname, methodname, stream)
    SHOW is always zero on recursive calls.  */
 
 void
-pascal_type_print_varspec_prefix (type, stream, show, passed_a_ptr)
-     struct type *type;
-     struct ui_file *stream;
-     int show;
-     int passed_a_ptr;
+pascal_type_print_varspec_prefix (struct type *type, struct ui_file *stream,
+                                 int show, int passed_a_ptr)
 {
   char *name;
   if (type == 0)
@@ -317,54 +299,6 @@ pascal_type_print_varspec_prefix (type, stream, show, passed_a_ptr)
     }
 }
 
-static void
-pascal_type_print_args (type, stream)
-     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)
 {
@@ -399,12 +333,9 @@ pascal_print_func_args (struct type *type, struct ui_file *stream)
    Args work like pascal_type_print_varspec_prefix.  */
 
 static void
-pascal_type_print_varspec_suffix (type, stream, show, passed_a_ptr, demangled_args)
-     struct type *type;
-     struct ui_file *stream;
-     int show;
-     int passed_a_ptr;
-     int demangled_args;
+pascal_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
+                                 int show, int passed_a_ptr,
+                                 int demangled_args)
 {
   if (type == 0)
     return;
@@ -433,7 +364,6 @@ pascal_type_print_varspec_suffix (type, stream, show, passed_a_ptr, demangled_ar
       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, " : ");
@@ -507,11 +437,8 @@ pascal_type_print_varspec_suffix (type, stream, show, passed_a_ptr, demangled_ar
    We increase it for some recursive calls.  */
 
 void
-pascal_type_print_base (type, stream, show, level)
-     struct type *type;
-     struct ui_file *stream;
-     int show;
-     int level;
+pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
+                       int level)
 {
   register int i;
   register int len;
@@ -612,7 +539,7 @@ pascal_type_print_base (type, stream, show, level)
          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");
@@ -861,6 +788,14 @@ pascal_type_print_base (type, stream, show, level)
                         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.026684 seconds and 4 git commands to generate.