/* Target-dependent code for s390.
- Copyright (C) 2001-2019 Free Software Foundation, Inc.
+ Copyright (C) 2001-2020 Free Software Foundation, Inc.
This file is part of GDB.
static struct type *
s390_effective_inner_type (struct type *type, unsigned int min_size)
{
- while (TYPE_CODE (type) == TYPE_CODE_STRUCT
- && TYPE_NFIELDS (type) == 1)
+ while (TYPE_CODE (type) == TYPE_CODE_STRUCT)
{
- struct type *inner = check_typedef (TYPE_FIELD_TYPE (type, 0));
+ struct type *inner = NULL;
+ /* Find a non-static field, if any. Unless there's exactly one,
+ abort the unwrapping. */
+ for (int i = 0; i < TYPE_NFIELDS (type); i++)
+ {
+ struct field f = TYPE_FIELD (type, i);
+
+ if (field_is_static (&f))
+ continue;
+ if (inner != NULL)
+ return type;
+ inner = FIELD_TYPE (f);
+ }
+
+ if (inner == NULL)
+ break;
+ inner = check_typedef (inner);
if (TYPE_LENGTH (inner) < min_size)
break;
type = inner;
/* Frame unwinding. */
-/* Implmement the stack_frame_destroyed_p gdbarch method. */
+/* Implement the stack_frame_destroyed_p gdbarch method. */
static int
s390_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
case 0xe383: /* MSGC - multiply single 64x64mem -> 64 */
case 0xe398: /* ALC - add logical with carry */
case 0xe399: /* SLB - subtract logical with borrow */
- case 0xe727: /* LCBB - load count to block bounduary */
+ case 0xe727: /* LCBB - load count to block boundary */
case 0xeb81: /* ICMY - insert characters under mask */
case 0xebdc: /* SRAK - shift left single */
case 0xebdd: /* SLAK - shift left single */
case 0xe704: /* VLLEZ - vector load logical element and zero */
case 0xe705: /* VLREP - vector load and replicate */
case 0xe706: /* VL - vector load */
- case 0xe707: /* VLBB - vector load to block bounduary */
+ case 0xe707: /* VLBB - vector load to block boundary */
case 0xe712: /* VGEG - vector gather element */
case 0xe713: /* VGEF - vector gather element */
case 0xe722: /* VLVG - vector load vr element from gr */
return -1;
break;
- /* 0xed42-0xed47 undefind */
+ /* 0xed42-0xed47 undefined */
case 0xed48: /* SLXT - shift significand left */
case 0xed49: /* SRXT - shift significand right */
return -1;
break;
- /* 0xed4a-0xed4f undefind */
- /* 0xed52-0xed53 undefind */
- /* 0xed56-0xed57 undefind */
- /* 0xed5a-0xed63 undefind */
+ /* 0xed4a-0xed4f undefined */
+ /* 0xed52-0xed53 undefined */
+ /* 0xed56-0xed57 undefined */
+ /* 0xed5a-0xed63 undefined */
/* 0xed68-0xeda7 undefined */
case 0xeda8: /* CZDT - convert to zoned */
/* Implement gdbarch_gcc_target_options. GCC does not know "-m32" or
"-mcmodel=large". */
-static char *
+static std::string
s390_gcc_target_options (struct gdbarch *gdbarch)
{
- return xstrdup (gdbarch_ptr_bit (gdbarch) == 64 ? "-m64" : "-m31");
+ return gdbarch_ptr_bit (gdbarch) == 64 ? "-m64" : "-m31";
}
/* Implement gdbarch_gnu_triplet_regexp. Target triplets are "s390-*"