/* 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.
#include "arch-utils.h"
#include "ax-gdb.h"
-#include "dwarf2-frame.h"
+#include "dwarf2/frame.h"
#include "elf/s390.h"
#include "elf-bfd.h"
#include "frame-base.h"
if (TYPE_LENGTH (t) > 8)
{
- switch (TYPE_CODE (t))
+ switch (t->code ())
{
case TYPE_CODE_INT:
case TYPE_CODE_RANGE:
/* Implementation of gdbarch_displaced_step_copy_insn. */
-static struct displaced_step_closure *
+static displaced_step_closure_up
s390_displaced_step_copy_insn (struct gdbarch *gdbarch,
CORE_ADDR from, CORE_ADDR to,
struct regcache *regs)
displaced_step_dump_bytes (gdb_stdlog, buf, len);
}
- return closure.release ();
+ /* This is a work around for a problem with g++ 4.8. */
+ return displaced_step_closure_up (closure.release ());
}
/* Fix up the state of registers and memory after having single-stepped
static struct type *
s390_effective_inner_type (struct type *type, unsigned int min_size)
{
- while (TYPE_CODE (type) == TYPE_CODE_STRUCT)
+ while (type->code () == TYPE_CODE_STRUCT)
{
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++)
+ for (int i = 0; i < type->num_fields (); i++)
{
- struct field f = TYPE_FIELD (type, i);
+ struct field f = type->field (i);
if (field_is_static (&f))
continue;
or double. */
type = s390_effective_inner_type (type, 0);
- return (TYPE_CODE (type) == TYPE_CODE_FLT
- || TYPE_CODE (type) == TYPE_CODE_DECFLOAT);
+ return (type->code () == TYPE_CODE_FLT
+ || type->code () == TYPE_CODE_DECFLOAT);
}
/* Return non-zero if TYPE should be passed like a vector. */
/* Structs containing just a vector are passed like a vector. */
type = s390_effective_inner_type (type, TYPE_LENGTH (type));
- return TYPE_CODE (type) == TYPE_CODE_ARRAY && TYPE_VECTOR (type);
+ return type->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type);
}
/* Determine whether N is a power of two. */
static int
s390_function_arg_integer (struct type *type)
{
- enum type_code code = TYPE_CODE (type);
+ enum type_code code = type->code ();
if (TYPE_LENGTH (type) > 8)
return 0;
CORE_ADDR param_area_start, new_sp;
struct type *ftype = check_typedef (value_type (function));
- if (TYPE_CODE (ftype) == TYPE_CODE_PTR)
+ if (ftype->code () == TYPE_CODE_PTR)
ftype = check_typedef (TYPE_TARGET_TYPE (ftype));
arg_prep.copy = sp;
and arg_state.argp with the size of the parameter area. */
for (i = 0; i < nargs; i++)
s390_handle_arg (&arg_state, args[i], tdep, word_size, byte_order,
- TYPE_VARARGS (ftype) && i >= TYPE_NFIELDS (ftype));
+ TYPE_VARARGS (ftype) && i >= ftype->num_fields ());
param_area_start = align_down (arg_state.copy - arg_state.argp, 8);
/* Write all parameters. */
for (i = 0; i < nargs; i++)
s390_handle_arg (&arg_state, args[i], tdep, word_size, byte_order,
- TYPE_VARARGS (ftype) && i >= TYPE_NFIELDS (ftype));
+ TYPE_VARARGS (ftype) && i >= ftype->num_fields ());
/* Store return PSWA. In 31-bit mode, keep addressing mode bit. */
if (word_size == 4)
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int word_size = gdbarch_ptr_bit (gdbarch) / 8;
int length = TYPE_LENGTH (type);
- int code = TYPE_CODE (type);
+ int code = type->code ();
if (code == TYPE_CODE_FLT || code == TYPE_CODE_DECFLOAT)
{
type = check_typedef (type);
- switch (TYPE_CODE (type))
+ switch (type->code ())
{
case TYPE_CODE_STRUCT:
case TYPE_CODE_UNION:
/* 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 */
return gdbarch;
}
+void _initialize_s390_tdep ();
void
-_initialize_s390_tdep (void)
+_initialize_s390_tdep ()
{
/* Hook us into the gdbarch mechanism. */
register_gdbarch_init (bfd_arch_s390, s390_gdbarch_init);