* gdbtypes.h (TYPE_OBJFILE_OWNED, TYPE_OWNER): New macros.
[deliverable/binutils-gdb.git] / gdb / jv-lang.c
index 8a834161b7e34bf7f84fb43287a4c55660139def..e1b6817a31b51c7772c2ce7b19be537957ed5f12 100644 (file)
@@ -296,7 +296,7 @@ type_from_class (struct gdbarch *gdbarch, struct value *clas)
   /* Do not use the "fake" dynamics objfile to own dynamically generated
      types, as it does not provide an architecture, and it would not help
      manage the lifetime of these types anyway.  */
-  type = alloc_type (NULL);
+  type = alloc_type_arch (gdbarch);
   TYPE_CODE (type) = TYPE_CODE_STRUCT;
   INIT_CPLUS_SPECIFIC (type);
 
@@ -803,13 +803,10 @@ java_demangle_type_signature (char *signature)
 struct type *
 java_array_type (struct type *type, int dims)
 {
-  struct type *range_type;
-
   while (dims-- > 0)
     {
-      range_type = create_range_type (NULL, builtin_type_int32, 0, 0);
       /* FIXME  This is bogus!  Java arrays are not gdb arrays! */
-      type = create_array_type (NULL, type, range_type);
+      type = lookup_array_range_type (type, 0, 0);
     }
 
   return type;
@@ -970,7 +967,7 @@ evaluate_subexp_java (struct type *expect_type, struct expression *exp,
 standard:
   return evaluate_subexp_standard (expect_type, exp, pos, noside);
 nosideret:
-  return value_from_longest (builtin_type_int8, (LONGEST) 1);
+  return value_from_longest (builtin_type (exp->gdbarch)->builtin_int, 1);
 }
 
 static char *java_demangle (const char *mangled, int options)
@@ -1173,23 +1170,23 @@ build_java_types (struct gdbarch *gdbarch)
     = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct builtin_java_type);
 
   builtin_java_type->builtin_int
-    = init_type (TYPE_CODE_INT, 4, 0, "int", NULL);
+    = arch_integer_type (gdbarch, 32, 0, "int");
   builtin_java_type->builtin_short
-    = init_type (TYPE_CODE_INT, 2, 0, "short", NULL);
+    = arch_integer_type (gdbarch, 16, 0, "short");
   builtin_java_type->builtin_long
-    = init_type (TYPE_CODE_INT, 8, 0, "long", NULL);
+    = arch_integer_type (gdbarch, 64, 0, "long");
   builtin_java_type->builtin_byte
-    = init_type (TYPE_CODE_INT, 1, 0, "byte", NULL);
+    = arch_integer_type (gdbarch, 8, 0, "byte");
   builtin_java_type->builtin_boolean
-    = init_type (TYPE_CODE_BOOL, 1, 0, "boolean", NULL);
+    = arch_boolean_type (gdbarch, 8, 0, "boolean");
   builtin_java_type->builtin_char
-    = init_type (TYPE_CODE_CHAR, 2, TYPE_FLAG_UNSIGNED, "char", NULL);
+    = arch_character_type (gdbarch, 16, 1, "char");
   builtin_java_type->builtin_float
-    = init_type (TYPE_CODE_FLT, 4, 0, "float", NULL);
+    = arch_float_type (gdbarch, 32, "float", NULL);
   builtin_java_type->builtin_double
-    = init_type (TYPE_CODE_FLT, 8, 0, "double", NULL);
+    = arch_float_type (gdbarch, 64, "double", NULL);
   builtin_java_type->builtin_void
-    = init_type (TYPE_CODE_VOID, 1, 0, "void", NULL);
+    = arch_type (gdbarch, TYPE_CODE_VOID, 1, "void");
 
   return builtin_java_type;
 }
This page took 0.024285 seconds and 4 git commands to generate.