/* Target-dependent code for s390.
- Copyright (C) 2001-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2023 Free Software Foundation, Inc.
This file is part of GDB.
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. */
return full_name[regnum - tdep->v0_full_regnum];
}
- internal_error (__FILE__, __LINE__, _("invalid regnum"));
+ internal_error (_("invalid regnum"));
}
/* Implement pseudo_register_type tdesc method. */
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. */
return status;
}
- internal_error (__FILE__, __LINE__, _("invalid regnum"));
+ internal_error (_("invalid regnum"));
}
/* Implement pseudo_register_write gdbarch method. */
return;
}
- internal_error (__FILE__, __LINE__, _("invalid regnum"));
+ internal_error (_("invalid regnum"));
}
/* Register groups. */
}
else
{
- internal_error (__FILE__, __LINE__, _("invalid regnum"));
+ internal_error (_("invalid regnum"));
}
return 0;
}
}
else
{
- internal_error (__FILE__, __LINE__, _("invalid regnum"));
+ internal_error (_("invalid regnum"));
}
return 0;
}
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);
}
}
else
- internal_error (__FILE__, __LINE__, _("invalid return type"));
+ internal_error (_("invalid return type"));
}
/* Implement the 'return_value' gdbarch method. */
/* 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)
{
s390_gdbarch_tdep *tdep = gdbarch_tdep<s390_gdbarch_tdep> (gdbarch);
ULONGEST 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);
s390_gdbarch_tdep *tdep = gdbarch_tdep<s390_gdbarch_tdep> (gdbarch);
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);
return true;
}
-/* Allocate and initialize new gdbarch_tdep. Caller is responsible to free
- memory after use. */
+/* Allocate and initialize new gdbarch_tdep. */
-static s390_gdbarch_tdep *
+static s390_gdbarch_tdep_up
s390_gdbarch_tdep_alloc ()
{
- s390_gdbarch_tdep *tdep = new s390_gdbarch_tdep;
+ s390_gdbarch_tdep_up tdep (new s390_gdbarch_tdep);
tdep->tdesc = NULL;
static const char *const stap_register_indirection_suffixes[] = { ")",
NULL };
- s390_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 ();
/* Check any target description for validity. */
if (!s390_tdesc_valid (tdep, tdesc_data.get ()))
{
- delete tdep;
gdbarch_free (gdbarch);
return NULL;
}
if (tmp->vector_abi != tdep->vector_abi)
continue;
- delete tdep;
gdbarch_free (gdbarch);
return arches->gdbarch;
}