/* 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.
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
{
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)
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;
}