* config/monitor.exp: Detect the "Couldn't establish connection"
[deliverable/binutils-gdb.git] / gdb / gdbtypes.c
index de15b5ad367df514adf27f84750954124fbab162..2f4e411fb3022e70ebb068c8ab118071aa533b7f 100644 (file)
@@ -1,5 +1,5 @@
 /* Support routines for manipulating internal types for GDB.
-   Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+   Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
    Contributed by Cygnus Support, using pieces from other GDB modules.
 
 This file is part of GDB.
@@ -54,6 +54,18 @@ struct type *builtin_type_complex;
 struct type *builtin_type_double_complex;
 struct type *builtin_type_string;
 
+struct extra { char str[128]; int len; }; /* maximum extention is 128! FIXME */
+
+static void add_name PARAMS ((struct extra *, char *));
+static void add_mangled_type PARAMS ((struct extra *, struct type *));
+#if 0
+static void cfront_mangle_name PARAMS ((struct type *, int, int));
+#endif
+static void print_bit_vector PARAMS ((B_TYPE *, int));
+static void print_arg_types PARAMS ((struct type **, int));
+static void dump_fn_fieldlists PARAMS ((struct type *, int));
+static void print_cplus_stuff PARAMS ((struct type *, int));
+
 /* Alloc a new type structure and fill it with some defaults.  If
    OBJFILE is non-NULL, then allocate the space for the type structure
    in that objfile's type_obstack. */
@@ -867,6 +879,35 @@ fill_in_vptr_fieldno (type)
     }
 }
 
+/* Find the method and field indices for the destructor in class type T.
+   Return 1 if the destructor was found, otherwise, return 0.  */
+
+int
+get_destructor_fn_field (t, method_indexp, field_indexp)
+     struct type *t;
+     int *method_indexp;
+     int *field_indexp;
+{
+  int i;
+
+  for (i = 0; i < TYPE_NFN_FIELDS (t); i++)
+    {
+      int j;
+      struct fn_field *f = TYPE_FN_FIELDLIST1 (t, i);
+
+      for (j = 0; j < TYPE_FN_FIELDLIST_LENGTH (t, i); j++)
+       {
+         if (DESTRUCTOR_PREFIX_P (TYPE_FN_FIELD_PHYSNAME (f, j)))
+           {
+             *method_indexp = i;
+             *field_indexp = j;
+             return 1;
+           }
+       }
+    }
+  return 0;
+}
+
 /* Added by Bryan Boreham, Kewill, Sun Sep 17 18:07:17 1989.
 
    If this is a stubbed struct (i.e. declared as struct foo *), see if
@@ -979,21 +1020,21 @@ check_typedef (type)
 #include <ctype.h>
 #define INIT_EXTRA { pextras->len=0; pextras->str[0]='\0'; }
 #define ADD_EXTRA(c) { pextras->str[pextras->len++]=c; }
-struct extra { char str[128]; int len; }; /* maximum extention is 128! FIXME */
-void 
+
+static void 
 add_name(pextras,n) 
   struct extra * pextras;
   char * n; 
 {
-  char lenstr[512];    /* FIXME!  hardcoded :-( */
-  int nlen, lenstrlen;
+  int nlen;
+
   if ((nlen = (n ? strlen(n) : 0))==0) 
     return;
   sprintf(pextras->str+pextras->len,"%d%s",nlen,n);
   pextras->len=strlen(pextras->str);
 }
 
-void 
+static void 
 add_mangled_type(pextras,t) 
   struct extra * pextras;
   struct type * t;
@@ -1116,7 +1157,8 @@ add_mangled_type(pextras,t)
     add_mangled_type(pextras,t->target_type);
 }
 
-char * 
+#if 0
+void
 cfront_mangle_name(type, i, j)
      struct type *type;
      int i;
@@ -1165,6 +1207,8 @@ cfront_mangle_name(type, i, j)
        mangled_name = arm_mangled_name;
      }
 }
+#endif /* 0 */
+
 #undef ADD_EXTRA
 /* End of new code added to support parsing of Cfront stabs strings */
 
This page took 0.024308 seconds and 4 git commands to generate.