OSDN Git Service

Update copyright year in most headers.
[pf3gnuchains/pf3gnuchains3x.git] / gdb / scm-lang.c
index 66f293b..5d2cafe 100644 (file)
@@ -1,7 +1,7 @@
 /* Scheme/Guile language support routines for GDB, the GNU debugger.
 
    Copyright (C) 1995, 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2007,
-   2008, 2009 Free Software Foundation, Inc.
+   2008, 2009, 2010 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -68,11 +68,12 @@ is_scmvalue_type (struct type *type)
    of the 0'th one.  */
 
 LONGEST
-scm_get_field (LONGEST svalue, int index, int size)
+scm_get_field (LONGEST svalue, int index, int size,
+              enum bfd_endian byte_order)
 {
   gdb_byte buffer[20];
   read_memory (SCM2PTR (svalue) + index * size, buffer, size);
-  return extract_signed_integer (buffer, size);
+  return extract_signed_integer (buffer, size, byte_order);
 }
 
 /* Unpack a value of type TYPE in buffer VALADDR as an integer
@@ -84,7 +85,10 @@ scm_unpack (struct type *type, const gdb_byte *valaddr, enum type_code context)
 {
   if (is_scmvalue_type (type))
     {
-      LONGEST svalue = extract_signed_integer (valaddr, TYPE_LENGTH (type));
+      enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type));
+      LONGEST svalue
+       = extract_signed_integer (valaddr, TYPE_LENGTH (type), byte_order);
+
       if (context == TYPE_CODE_BOOL)
        {
          if (svalue == SCM_BOOL_F)
@@ -278,10 +282,8 @@ build_scm_types (struct gdbarch *gdbarch)
   struct builtin_scm_type *builtin_scm_type
     = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct builtin_scm_type);
 
-  builtin_scm_type->builtin_scm =
-    init_type (TYPE_CODE_INT,
-              gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT,
-              0, "SCM", (struct objfile *) NULL);
+  builtin_scm_type->builtin_scm
+    = arch_integer_type (gdbarch, gdbarch_long_bit (gdbarch), 0, "SCM");
 
   return builtin_scm_type;
 }