* inftarg.c (child_thread_alive): New function to see if a
[deliverable/binutils-gdb.git] / gdb / gdbtypes.c
index 2ccc8456bf6dcbec14c429ea3cf26a0174ceca56..f5a8c3fb74f383df2da2d4ef3ab38bb208d90435 100644 (file)
@@ -226,17 +226,6 @@ make_function_type (type, typeptr)
   register struct type *ntype;         /* New type */
   struct objfile *objfile;
 
-  ntype = TYPE_FUNCTION_TYPE (type);
-
-  if (ntype) 
-    if (typeptr == 0)          
-      return ntype;    /* Don't care about alloc, and have new type.  */
-    else if (*typeptr == 0)
-      {
-       *typeptr = ntype;       /* Tracking alloc, and we have new type.  */
-       return ntype;
-      }
-
   if (typeptr == 0 || *typeptr == 0)   /* We'll need to allocate one.  */
     {
       ntype = alloc_type (TYPE_OBJFILE (type));
@@ -252,14 +241,10 @@ make_function_type (type, typeptr)
     }
 
   TYPE_TARGET_TYPE (ntype) = type;
-  TYPE_FUNCTION_TYPE (type) = ntype;
 
   TYPE_LENGTH (ntype) = 1;
   TYPE_CODE (ntype) = TYPE_CODE_FUNC;
   
-  if (!TYPE_FUNCTION_TYPE (type))      /* Remember it, if don't have one.  */
-    TYPE_FUNCTION_TYPE (type) = ntype;
-
   return ntype;
 }
 
@@ -335,7 +320,10 @@ create_range_type (result_type, index_type, low_bound, high_bound)
     }
   TYPE_CODE (result_type) = TYPE_CODE_RANGE;
   TYPE_TARGET_TYPE (result_type) = index_type;
-  TYPE_LENGTH (result_type) = TYPE_LENGTH (index_type);
+  if (TYPE_FLAGS (index_type) & TYPE_FLAG_STUB)
+    TYPE_FLAGS (result_type) |= TYPE_FLAG_TARGET_STUB;
+  else
+    TYPE_LENGTH (result_type) = TYPE_LENGTH (index_type);
   TYPE_NFIELDS (result_type) = 2;
   TYPE_FIELDS (result_type) = (struct field *)
     TYPE_ALLOC (result_type, 2 * sizeof (struct field));
@@ -905,11 +893,12 @@ check_stub_type (type)
       struct type *range_type;
 
       check_stub_type (TYPE_TARGET_TYPE (type));
-      if (!(TYPE_FLAGS (TYPE_TARGET_TYPE (type)) & TYPE_FLAG_STUB)
-         && TYPE_CODE (type) == TYPE_CODE_ARRAY
-         && TYPE_NFIELDS (type) == 1
-         && (TYPE_CODE (range_type = TYPE_FIELD_TYPE (type, 0))
-             == TYPE_CODE_RANGE))
+      if (TYPE_FLAGS (TYPE_TARGET_TYPE (type)) & TYPE_FLAG_STUB)
+       { }
+      else if (TYPE_CODE (type) == TYPE_CODE_ARRAY
+              && TYPE_NFIELDS (type) == 1
+              && (TYPE_CODE (range_type = TYPE_FIELD_TYPE (type, 0))
+                  == TYPE_CODE_RANGE))
        {
          /* Now recompute the length of the array type, based on its
             number of elements and the target type's length.  */
@@ -920,6 +909,11 @@ check_stub_type (type)
             * TYPE_LENGTH (TYPE_TARGET_TYPE (type)));
          TYPE_FLAGS (type) &= ~TYPE_FLAG_TARGET_STUB;
        }
+      else if (TYPE_CODE (type) == TYPE_CODE_RANGE)
+       {
+         TYPE_LENGTH (type) = TYPE_LENGTH (TYPE_TARGET_TYPE (type));
+         TYPE_FLAGS (type) &= ~TYPE_FLAG_TARGET_STUB;
+       }
     }
 }
 
@@ -1444,9 +1438,6 @@ recursive_dump_type (type, spaces)
   printfi_filtered (spaces, "reference_type ");
   gdb_print_address (TYPE_REFERENCE_TYPE (type), gdb_stdout);
   printf_filtered ("\n");
-  printfi_filtered (spaces, "function_type ");
-  gdb_print_address (TYPE_FUNCTION_TYPE (type), gdb_stdout);
-  printf_filtered ("\n");
   printfi_filtered (spaces, "flags 0x%x", TYPE_FLAGS (type));
   if (TYPE_FLAGS (type) & TYPE_FLAG_UNSIGNED)
     {
This page took 0.024181 seconds and 4 git commands to generate.