/* Target-dependent code for s390.
- Copyright (C) 2001-2021 Free Software Foundation, Inc.
+ Copyright (C) 2001-2023 Free Software Foundation, Inc.
This file is part of GDB.
{
t = check_typedef (t);
- if (TYPE_LENGTH (t) > 8)
+ if (t->length () > 8)
{
switch (t->code ())
{
regcache_write_pc (regs, from + insnlen);
/* Recompute output address in R1. */
regcache_cooked_write_unsigned (regs, S390_R0_REGNUM + r1,
- amode | (from + i2 * 2));
+ from + i2 * 2);
}
/* If we executed a breakpoint instruction, point PC right back at it. */
static int
s390_register_call_saved (struct gdbarch *gdbarch, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ s390_gdbarch_tdep *tdep = gdbarch_tdep<s390_gdbarch_tdep> (gdbarch);
switch (tdep->abi)
{
struct regcache *regcache,
CORE_ADDR addr)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ s390_gdbarch_tdep *tdep = gdbarch_tdep<s390_gdbarch_tdep> (gdbarch);
int sz = register_size (gdbarch, S390_PSWA_REGNUM);
gdb_byte *reg = (gdb_byte *) alloca (sz);
ULONGEST pswm, pswa;
static int
s390_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ s390_gdbarch_tdep *tdep = gdbarch_tdep<s390_gdbarch_tdep> (gdbarch);
int gdb_reg = -1;
/* In a 32-on-64 debug scenario, debug info refers to the full
These pseudo-registers are composed of two adjacent gprs. */
static int
-regnum_is_gpr_full (struct gdbarch_tdep *tdep, int regnum)
+regnum_is_gpr_full (s390_gdbarch_tdep *tdep, int regnum)
{
return (tdep->gpr_full_regnum != -1
&& regnum >= tdep->gpr_full_regnum
These pseudo-registers are composed of f0-f15 and v0l-v15l. */
static int
-regnum_is_vxr_full (struct gdbarch_tdep *tdep, int regnum)
+regnum_is_vxr_full (s390_gdbarch_tdep *tdep, int regnum)
{
return (tdep->v0_full_regnum != -1
&& regnum >= tdep->v0_full_regnum
s390_value_from_register (struct gdbarch *gdbarch, struct type *type,
int regnum, struct frame_id frame_id)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ s390_gdbarch_tdep *tdep = gdbarch_tdep<s390_gdbarch_tdep> (gdbarch);
struct value *value = default_value_from_register (gdbarch, type,
regnum, frame_id);
check_typedef (type);
if ((regnum >= S390_F0_REGNUM && regnum <= S390_F15_REGNUM
- && TYPE_LENGTH (type) < 8)
+ && type->length () < 8)
|| regnum_is_vxr_full (tdep, regnum)
|| (regnum >= S390_V16_REGNUM && regnum <= S390_V31_REGNUM))
set_value_offset (value, 0);
static const char *
s390_pseudo_register_name (struct gdbarch *gdbarch, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ s390_gdbarch_tdep *tdep = gdbarch_tdep<s390_gdbarch_tdep> (gdbarch);
if (regnum == tdep->pc_regnum)
return "pc";
return full_name[regnum - tdep->v0_full_regnum];
}
- internal_error (__FILE__, __LINE__, _("invalid regnum"));
+ internal_error (_("invalid regnum"));
}
/* Implement pseudo_register_type tdesc method. */
static struct type *
s390_pseudo_register_type (struct gdbarch *gdbarch, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ s390_gdbarch_tdep *tdep = gdbarch_tdep<s390_gdbarch_tdep> (gdbarch);
if (regnum == tdep->pc_regnum)
return builtin_type (gdbarch)->builtin_func_ptr;
if (regnum_is_vxr_full (tdep, regnum))
return tdesc_register_type (gdbarch, S390_V16_REGNUM);
- internal_error (__FILE__, __LINE__, _("invalid regnum"));
+ internal_error (_("invalid regnum"));
}
/* Implement pseudo_register_read gdbarch method. */
s390_pseudo_register_read (struct gdbarch *gdbarch, readable_regcache *regcache,
int regnum, gdb_byte *buf)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ s390_gdbarch_tdep *tdep = gdbarch_tdep<s390_gdbarch_tdep> (gdbarch);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int regsize = register_size (gdbarch, regnum);
ULONGEST val;
return status;
}
- internal_error (__FILE__, __LINE__, _("invalid regnum"));
+ internal_error (_("invalid regnum"));
}
/* Implement pseudo_register_write gdbarch method. */
s390_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
int regnum, const gdb_byte *buf)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ s390_gdbarch_tdep *tdep = gdbarch_tdep<s390_gdbarch_tdep> (gdbarch);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int regsize = register_size (gdbarch, regnum);
ULONGEST val, psw;
return;
}
- internal_error (__FILE__, __LINE__, _("invalid regnum"));
+ internal_error (_("invalid regnum"));
}
/* Register groups. */
static int
s390_pseudo_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
- struct reggroup *group)
+ const struct reggroup *group)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ s390_gdbarch_tdep *tdep = gdbarch_tdep<s390_gdbarch_tdep> (gdbarch);
/* We usually save/restore the whole PSW, which includes PC and CC.
However, some older gdbservers may not support saving/restoring
s390_ax_pseudo_register_collect (struct gdbarch *gdbarch,
struct agent_expr *ax, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ s390_gdbarch_tdep *tdep = gdbarch_tdep<s390_gdbarch_tdep> (gdbarch);
if (regnum == tdep->pc_regnum)
{
ax_reg_mask (ax, S390_PSWA_REGNUM);
}
else
{
- internal_error (__FILE__, __LINE__, _("invalid regnum"));
+ internal_error (_("invalid regnum"));
}
return 0;
}
s390_ax_pseudo_register_push_stack (struct gdbarch *gdbarch,
struct agent_expr *ax, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ s390_gdbarch_tdep *tdep = gdbarch_tdep<s390_gdbarch_tdep> (gdbarch);
if (regnum == tdep->pc_regnum)
{
ax_reg (ax, S390_PSWA_REGNUM);
}
else
{
- internal_error (__FILE__, __LINE__, _("invalid regnum"));
+ internal_error (_("invalid regnum"));
}
return 0;
}
if (inner == NULL)
break;
inner = check_typedef (inner);
- if (TYPE_LENGTH (inner) < min_size)
+ if (inner->length () < min_size)
break;
type = inner;
}
{
/* Note that long double as well as complex types are intentionally
excluded. */
- if (TYPE_LENGTH (type) > 8)
+ if (type->length () > 8)
return 0;
/* A struct containing just a float or double is passed like a float
static int
s390_function_arg_vector (struct type *type)
{
- if (TYPE_LENGTH (type) > 16)
+ if (type->length () > 16)
return 0;
/* Structs containing just a vector are passed like a vector. */
- type = s390_effective_inner_type (type, TYPE_LENGTH (type));
+ type = s390_effective_inner_type (type, type->length ());
return type->code () == TYPE_CODE_ARRAY && type->is_vector ();
}
{
enum type_code code = type->code ();
- if (TYPE_LENGTH (type) > 8)
+ if (type->length () > 8)
return 0;
if (code == TYPE_CODE_INT
return 1;
return ((code == TYPE_CODE_UNION || code == TYPE_CODE_STRUCT)
- && is_power_of_two (TYPE_LENGTH (type)));
+ && is_power_of_two (type->length ()));
}
/* Argument passing state: Internal data structure passed to helper
static void
s390_handle_arg (struct s390_arg_state *as, struct value *arg,
- struct gdbarch_tdep *tdep, int word_size,
+ s390_gdbarch_tdep *tdep, int word_size,
enum bfd_endian byte_order, int is_unnamed)
{
struct type *type = check_typedef (value_type (arg));
- unsigned int length = TYPE_LENGTH (type);
+ unsigned int length = type->length ();
int write_mode = as->regcache != NULL;
if (s390_function_arg_float (type))
function_call_return_method return_method,
CORE_ADDR struct_addr)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ s390_gdbarch_tdep *tdep = gdbarch_tdep<s390_gdbarch_tdep> (gdbarch);
int word_size = gdbarch_ptr_bit (gdbarch) / 8;
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int i;
struct type *ftype = check_typedef (value_type (function));
if (ftype->code () == TYPE_CODE_PTR)
- ftype = check_typedef (TYPE_TARGET_TYPE (ftype));
+ ftype = check_typedef (ftype->target_type ());
arg_prep.copy = sp;
arg_prep.gr = (return_method == return_method_struct) ? 3 : 2;
breakpoint. */
static struct frame_id
-s390_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
+s390_dummy_id (struct gdbarch *gdbarch, frame_info_ptr this_frame)
{
int word_size = gdbarch_ptr_bit (gdbarch) / 8;
CORE_ADDR sp = get_frame_register_unsigned (this_frame, S390_SP_REGNUM);
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int word_size = gdbarch_ptr_bit (gdbarch) / 8;
- int length = TYPE_LENGTH (type);
+ int length = type->length ();
int code = type->code ();
if (code == TYPE_CODE_FLT || code == TYPE_CODE_DECFLOAT)
}
}
else
- internal_error (__FILE__, __LINE__, _("invalid return type"));
+ internal_error (_("invalid return type"));
}
/* Implement the 'return_value' gdbarch method. */
rvc = RETURN_VALUE_STRUCT_CONVENTION;
break;
case TYPE_CODE_ARRAY:
- rvc = (gdbarch_tdep (gdbarch)->vector_abi == S390_VECTOR_ABI_128
- && TYPE_LENGTH (type) <= 16 && type->is_vector ())
- ? RETURN_VALUE_REGISTER_CONVENTION
- : RETURN_VALUE_STRUCT_CONVENTION;
- break;
+ {
+ s390_gdbarch_tdep *tdep = gdbarch_tdep<s390_gdbarch_tdep> (gdbarch);
+ rvc = (tdep->vector_abi == S390_VECTOR_ABI_128
+ && type->length () <= 16 && type->is_vector ())
+ ? RETURN_VALUE_REGISTER_CONVENTION
+ : RETURN_VALUE_STRUCT_CONVENTION;
+ break;
+ }
default:
- rvc = TYPE_LENGTH (type) <= 8
+ rvc = type->length () <= 8
? RETURN_VALUE_REGISTER_CONVENTION
: RETURN_VALUE_STRUCT_CONVENTION;
}
/* Implement unwind_pc gdbarch method. */
static CORE_ADDR
-s390_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
+s390_unwind_pc (struct gdbarch *gdbarch, frame_info_ptr next_frame)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ s390_gdbarch_tdep *tdep = gdbarch_tdep<s390_gdbarch_tdep> (gdbarch);
ULONGEST pc;
pc = frame_unwind_register_unsigned (next_frame, tdep->pc_regnum);
return gdbarch_addr_bits_remove (gdbarch, pc);
/* Implement unwind_sp gdbarch method. */
static CORE_ADDR
-s390_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
+s390_unwind_sp (struct gdbarch *gdbarch, frame_info_ptr next_frame)
{
ULONGEST sp;
sp = frame_unwind_register_unsigned (next_frame, S390_SP_REGNUM);
/* Helper routine to unwind pseudo registers. */
static struct value *
-s390_unwind_pseudo_register (struct frame_info *this_frame, int regnum)
+s390_unwind_pseudo_register (frame_info_ptr this_frame, int regnum)
{
struct gdbarch *gdbarch = get_frame_arch (this_frame);
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ s390_gdbarch_tdep *tdep = gdbarch_tdep<s390_gdbarch_tdep> (gdbarch);
struct type *type = register_type (gdbarch, regnum);
/* Unwind PC via PSW address. */
{
LONGEST pswa = value_as_long (val);
- if (TYPE_LENGTH (type) == 4)
+ if (type->length () == 4)
return value_from_pointer (type, pswa & 0x7fffffff);
else
return value_from_pointer (type, pswa);
{
LONGEST pswm = value_as_long (val);
- if (TYPE_LENGTH (type) == 4)
+ if (type->length () == 4)
return value_from_longest (type, (pswm >> 12) & 3);
else
return value_from_longest (type, (pswm >> 44) & 3);
s390_dwarf2_frame_init_reg. */
static struct value *
-s390_dwarf2_prev_register (struct frame_info *this_frame, void **this_cache,
+s390_dwarf2_prev_register (frame_info_ptr this_frame, void **this_cache,
int regnum)
{
return s390_unwind_pseudo_register (this_frame, regnum);
static void
s390_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum,
struct dwarf2_frame_state_reg *reg,
- struct frame_info *this_frame)
+ frame_info_ptr this_frame)
{
/* The condition code (and thus PSW mask) is call-clobbered. */
if (regnum == S390_PSWM_REGNUM)
register translation. */
struct value *
-s390_trad_frame_prev_register (struct frame_info *this_frame,
+s390_trad_frame_prev_register (frame_info_ptr this_frame,
trad_frame_saved_reg saved_regs[],
int regnum)
{
prologue analysis. Helper for s390_frame_unwind_cache. */
static int
-s390_prologue_frame_unwind_cache (struct frame_info *this_frame,
+s390_prologue_frame_unwind_cache (frame_info_ptr this_frame,
struct s390_unwind_cache *info)
{
struct gdbarch *gdbarch = get_frame_arch (this_frame);
CORE_ADDR prev_sp;
int frame_pointer;
int size;
- struct frame_info *next_frame;
+ frame_info_ptr next_frame;
/* Try to find the function start address. If we can't find it, we don't
bother searching for it -- with modern compilers this would be mostly
back chain unwinding. Helper for s390_frame_unwind_cache. */
static void
-s390_backchain_frame_unwind_cache (struct frame_info *this_frame,
+s390_backchain_frame_unwind_cache (frame_info_ptr this_frame,
struct s390_unwind_cache *info)
{
struct gdbarch *gdbarch = get_frame_arch (this_frame);
s390_frame_unwind and s390_frame_base. */
static struct s390_unwind_cache *
-s390_frame_unwind_cache (struct frame_info *this_frame,
+s390_frame_unwind_cache (frame_info_ptr this_frame,
void **this_prologue_cache)
{
struct s390_unwind_cache *info;
/* Implement this_id frame_unwind method for s390_frame_unwind. */
static void
-s390_frame_this_id (struct frame_info *this_frame,
+s390_frame_this_id (frame_info_ptr this_frame,
void **this_prologue_cache,
struct frame_id *this_id)
{
/* Implement prev_register frame_unwind method for s390_frame_unwind. */
static struct value *
-s390_frame_prev_register (struct frame_info *this_frame,
+s390_frame_prev_register (frame_info_ptr this_frame,
void **this_prologue_cache, int regnum)
{
struct s390_unwind_cache *info
s390_stub_frame_unwind. */
static struct s390_stub_unwind_cache *
-s390_stub_frame_unwind_cache (struct frame_info *this_frame,
+s390_stub_frame_unwind_cache (frame_info_ptr this_frame,
void **this_prologue_cache)
{
struct gdbarch *gdbarch = get_frame_arch (this_frame);
/* Implement this_id frame_unwind method for s390_stub_frame_unwind. */
static void
-s390_stub_frame_this_id (struct frame_info *this_frame,
+s390_stub_frame_this_id (frame_info_ptr this_frame,
void **this_prologue_cache,
struct frame_id *this_id)
{
/* Implement prev_register frame_unwind method for s390_stub_frame_unwind. */
static struct value *
-s390_stub_frame_prev_register (struct frame_info *this_frame,
+s390_stub_frame_prev_register (frame_info_ptr this_frame,
void **this_prologue_cache, int regnum)
{
struct s390_stub_unwind_cache *info
static int
s390_stub_frame_sniffer (const struct frame_unwind *self,
- struct frame_info *this_frame,
+ frame_info_ptr this_frame,
void **this_prologue_cache)
{
CORE_ADDR addr_in_block;
/* Frame base handling. */
static CORE_ADDR
-s390_frame_base_address (struct frame_info *this_frame, void **this_cache)
+s390_frame_base_address (frame_info_ptr this_frame, void **this_cache)
{
struct s390_unwind_cache *info
= s390_frame_unwind_cache (this_frame, this_cache);
}
static CORE_ADDR
-s390_local_base_address (struct frame_info *this_frame, void **this_cache)
+s390_local_base_address (frame_info_ptr this_frame, void **this_cache)
{
struct s390_unwind_cache *info
= s390_frame_unwind_cache (this_frame, this_cache);
s390_record_address_mask (struct gdbarch *gdbarch, struct regcache *regcache,
CORE_ADDR val)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ s390_gdbarch_tdep *tdep = gdbarch_tdep<s390_gdbarch_tdep> (gdbarch);
ULONGEST pswm, pswa;
int am;
if (tdep->abi == ABI_LINUX_S390)
case 3:
return val;
default:
- fprintf_unfiltered (gdb_stdlog, "Warning: Addressing mode %d used.", am);
+ gdb_printf (gdb_stdlog, "Warning: Addressing mode %d used.", am);
return 0;
}
}
uint8_t vx, uint8_t el, uint8_t es, uint16_t bd,
int8_t dh, CORE_ADDR *res)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ s390_gdbarch_tdep *tdep = gdbarch_tdep<s390_gdbarch_tdep> (gdbarch);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
ULONGEST x;
gdb_byte buf[16];
static int
s390_record_gpr_g (struct gdbarch *gdbarch, struct regcache *regcache, int i)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ s390_gdbarch_tdep *tdep = gdbarch_tdep<s390_gdbarch_tdep> (gdbarch);
if (record_full_arch_list_add_reg (regcache, S390_R0_REGNUM + i))
return -1;
if (tdep->abi == ABI_LINUX_S390)
static int
s390_record_gpr_h (struct gdbarch *gdbarch, struct regcache *regcache, int i)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ s390_gdbarch_tdep *tdep = gdbarch_tdep<s390_gdbarch_tdep> (gdbarch);
if (tdep->abi == ABI_LINUX_S390)
{
if (record_full_arch_list_add_reg (regcache, S390_R0_UPPER_REGNUM + i))
s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
CORE_ADDR addr)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ s390_gdbarch_tdep *tdep = gdbarch_tdep<s390_gdbarch_tdep> (gdbarch);
uint16_t insn[3] = {0};
/* Instruction as bytes. */
uint8_t ibyte[6];
return -1;
break;
default:
- fprintf_unfiltered (gdb_stdlog, "Warning: Unknown PFPO OFC %02x at %s.\n",
- ofc, paddress (gdbarch, addr));
+ gdb_printf (gdb_stdlog, "Warning: Unknown PFPO OFC %02x at %s.\n",
+ ofc, paddress (gdbarch, addr));
return -1;
}
}
else
{
- printf_unfiltered (_("no syscall record support\n"));
+ gdb_printf (gdb_stderr, _("no syscall record support\n"));
return -1;
}
break;
case 0x44: /* EX - execute */
if (ex != -1)
{
- fprintf_unfiltered (gdb_stdlog, "Warning: Double execute at %s.\n",
- paddress (gdbarch, addr));
+ gdb_printf (gdb_stdlog, "Warning: Double execute at %s.\n",
+ paddress (gdbarch, addr));
return -1;
}
addr = s390_record_calc_disp (gdbarch, regcache, inib[3], insn[1], 0);
break;
default:
- fprintf_unfiltered (gdb_stdlog, "Warning: Unknown KMAC function %02x at %s.\n",
- (int)tmp, paddress (gdbarch, addr));
+ gdb_printf (gdb_stdlog, "Warning: Unknown KMAC function %02x at %s.\n",
+ (int)tmp, paddress (gdbarch, addr));
return -1;
}
if (tmp != 0)
/* For other instructions... */
/* Fall through. */
default:
- fprintf_unfiltered (gdb_stdlog, "Warning: Unknown KM* function %02x at %s.\n",
- (int)tmp, paddress (gdbarch, addr));
+ gdb_printf (gdb_stdlog, "Warning: Unknown KM* function %02x at %s.\n",
+ (int)tmp, paddress (gdbarch, addr));
return -1;
}
if (tmp != 0)
break;
default:
- fprintf_unfiltered (gdb_stdlog, "Warning: Unknown PCC function %02x at %s.\n",
- (int)tmp, paddress (gdbarch, addr));
+ gdb_printf (gdb_stdlog, "Warning: Unknown PCC function %02x at %s.\n",
+ (int)tmp, paddress (gdbarch, addr));
return -1;
}
if (record_full_arch_list_add_reg (regcache, S390_PSWM_REGNUM))
break;
default:
- fprintf_unfiltered (gdb_stdlog, "Warning: Unknown KMCTR function %02x at %s.\n",
- (int)tmp, paddress (gdbarch, addr));
+ gdb_printf (gdb_stdlog, "Warning: Unknown KMCTR function %02x at %s.\n",
+ (int)tmp, paddress (gdbarch, addr));
return -1;
}
if (tmp != 0)
break;
default:
- fprintf_unfiltered (gdb_stdlog, "Warning: Unknown KM function %02x at %s.\n",
- (int)tmp, paddress (gdbarch, addr));
+ gdb_printf (gdb_stdlog, "Warning: Unknown KM function %02x at %s.\n",
+ (int)tmp, paddress (gdbarch, addr));
return -1;
}
if (tmp != 0)
break;
default:
- fprintf_unfiltered (gdb_stdlog, "Warning: Unknown PPNO function %02x at %s.\n",
- (int)tmp, paddress (gdbarch, addr));
+ gdb_printf (gdb_stdlog, "Warning: Unknown PPNO function %02x at %s.\n",
+ (int)tmp, paddress (gdbarch, addr));
return -1;
}
/* DXC may be written */
/* For KLMD... */
/* Fall through. */
default:
- fprintf_unfiltered (gdb_stdlog, "Warning: Unknown KMAC function %02x at %s.\n",
- (int)tmp, paddress (gdbarch, addr));
+ gdb_printf (gdb_stdlog, "Warning: Unknown KMAC function %02x at %s.\n",
+ (int)tmp, paddress (gdbarch, addr));
return -1;
}
if (tmp != 0)
case 0xc60: /* EXRL - execute relative long */
if (ex != -1)
{
- fprintf_unfiltered (gdb_stdlog, "Warning: Double execute at %s.\n",
- paddress (gdbarch, addr));
+ gdb_printf (gdb_stdlog, "Warning: Double execute at %s.\n",
+ paddress (gdbarch, addr));
return -1;
}
addr = s390_record_calc_rl (gdbarch, regcache, addr, insn[1], insn[2]);
break;
default:
- fprintf_unfiltered (gdb_stdlog, "Warning: Unknown CSST FC %02x at %s.\n",
- fc, paddress (gdbarch, addr));
+ gdb_printf (gdb_stdlog, "Warning: Unknown CSST FC %02x at %s.\n",
+ fc, paddress (gdbarch, addr));
return -1;
}
oaddr2 = s390_record_calc_disp (gdbarch, regcache, 0, insn[2], 0);
if (sc > 4)
{
- fprintf_unfiltered (gdb_stdlog, "Warning: Unknown CSST FC %02x at %s.\n",
- sc, paddress (gdbarch, addr));
+ gdb_printf (gdb_stdlog, "Warning: Unknown CSST FC %02x at %s.\n",
+ sc, paddress (gdbarch, addr));
return -1;
}
break;
default:
- fprintf_unfiltered (gdb_stdlog, "Warning: Unknown PLO FC %02x at %s.\n",
- fc, paddress (gdbarch, addr));
+ gdb_printf (gdb_stdlog, "Warning: Unknown PLO FC %02x at %s.\n",
+ fc, paddress (gdbarch, addr));
return -1;
}
}
default:
UNKNOWN_OP:
- fprintf_unfiltered (gdb_stdlog, "Warning: Don't know how to record %04x "
- "at %s.\n", insn[0], paddress (gdbarch, addr));
+ gdb_printf (gdb_stdlog, "Warning: Don't know how to record %04x "
+ "at %s.\n", insn[0], paddress (gdbarch, addr));
return -1;
}
tdesc. */
static bool
-s390_tdesc_valid (struct gdbarch_tdep *tdep,
+s390_tdesc_valid (s390_gdbarch_tdep *tdep,
struct tdesc_arch_data *tdesc_data)
{
static const char *const psw[] = {
return true;
}
-/* Allocate and initialize new gdbarch_tdep. Caller is responsible to free
- memory after use. */
+/* Allocate and initialize new gdbarch_tdep. */
-static struct gdbarch_tdep *
+static s390_gdbarch_tdep_up
s390_gdbarch_tdep_alloc ()
{
- struct gdbarch_tdep *tdep = XCNEW (struct gdbarch_tdep);
+ s390_gdbarch_tdep_up tdep (new s390_gdbarch_tdep);
tdep->tdesc = NULL;
static const char *const stap_register_indirection_suffixes[] = { ")",
NULL };
- struct gdbarch_tdep *tdep = s390_gdbarch_tdep_alloc ();
- struct gdbarch *gdbarch = gdbarch_alloc (&info, tdep);
+ gdbarch *gdbarch = gdbarch_alloc (&info, s390_gdbarch_tdep_alloc ());
+ s390_gdbarch_tdep *tdep = gdbarch_tdep<s390_gdbarch_tdep> (gdbarch);
tdesc_arch_data_up tdesc_data = tdesc_data_alloc ();
info.tdesc_data = tdesc_data.get ();
We can safely let them default to 128-bit, since the debug info
will give the size of type actually used in each case. */
set_gdbarch_long_double_bit (gdbarch, 128);
- set_gdbarch_long_double_format (gdbarch, floatformats_ia64_quad);
+ set_gdbarch_long_double_format (gdbarch, floatformats_ieee_quad);
set_gdbarch_type_align (gdbarch, s390_type_align);
/* Check any target description for validity. */
if (!s390_tdesc_valid (tdep, tdesc_data.get ()))
{
- xfree (tdep);
gdbarch_free (gdbarch);
return NULL;
}
arches != NULL;
arches = gdbarch_list_lookup_by_info (arches->next, &info))
{
- struct gdbarch_tdep *tmp = gdbarch_tdep (arches->gdbarch);
+ s390_gdbarch_tdep *tmp
+ = gdbarch_tdep<s390_gdbarch_tdep> (arches->gdbarch);
+
if (!tmp)
continue;
+
/* A program can 'choose' not to use the vector registers when they
are present. Leading to the same tdesc but different tdep and
thereby a different gdbarch. */
if (tmp->vector_abi != tdep->vector_abi)
continue;
- xfree (tdep);
gdbarch_free (gdbarch);
return arches->gdbarch;
}
_initialize_s390_tdep ()
{
/* Hook us into the gdbarch mechanism. */
- register_gdbarch_init (bfd_arch_s390, s390_gdbarch_init);
+ gdbarch_register (bfd_arch_s390, s390_gdbarch_init);
initialize_tdesc_s390_linux32 ();
initialize_tdesc_s390x_linux64 ();