* defs.h (extract_signed_integer, extract_unsigned_integer,
[deliverable/binutils-gdb.git] / gdb / jv-lang.c
index 9d2484503b4d198c7873f4663e4d999cb940691f..6b68e7d6b0e3dc43cc665f650e9d8aaf8581dac1 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);
 
@@ -907,6 +907,7 @@ evaluate_subexp_java (struct type *expect_type, struct expression *exp,
       if (TYPE_CODE (type) == TYPE_CODE_STRUCT
          && i > 2 && name[i - 1] == ']')
        {
+         enum bfd_endian byte_order = gdbarch_byte_order (exp->gdbarch);
          CORE_ADDR address;
          long length, index;
          struct type *el_type;
@@ -927,7 +928,7 @@ evaluate_subexp_java (struct type *expect_type, struct expression *exp,
          address = value_as_address (arg1);
          address += get_java_object_header_size (exp->gdbarch);
          read_memory (address, buf4, 4);
-         length = (long) extract_signed_integer (buf4, 4);
+         length = (long) extract_signed_integer (buf4, 4, byte_order);
          index = (long) value_as_long (arg2);
          if (index >= length || index < 0)
            error (_("array index (%ld) out of bounds (length: %ld)"),
@@ -1170,23 +1171,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.042283 seconds and 4 git commands to generate.