/* Target-dependent code for GDB, the GNU debugger.
- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+ 2011 Free Software Foundation, Inc.
Contributed by D.J. Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
for IBM Deutschland Entwicklung GmbH, IBM Corporation.
#include "dis-asm.h"
#include "solib-svr4.h"
#include "prologue-value.h"
-
+#include "linux-tdep.h"
#include "s390-tdep.h"
#include "features/s390-linux32.c"
internal_error (__FILE__, __LINE__, _("invalid regnum"));
}
-static void
+static enum register_status
s390_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
int regnum, gdb_byte *buf)
{
if (regnum == tdep->pc_regnum)
{
- regcache_raw_read_unsigned (regcache, S390_PSWA_REGNUM, &val);
- if (register_size (gdbarch, S390_PSWA_REGNUM) == 4)
- val &= 0x7fffffff;
- store_unsigned_integer (buf, regsize, byte_order, val);
- return;
+ enum register_status status;
+
+ status = regcache_raw_read_unsigned (regcache, S390_PSWA_REGNUM, &val);
+ if (status == REG_VALID)
+ {
+ if (register_size (gdbarch, S390_PSWA_REGNUM) == 4)
+ val &= 0x7fffffff;
+ store_unsigned_integer (buf, regsize, byte_order, val);
+ }
+ return status;
}
if (regnum == tdep->cc_regnum)
{
- regcache_raw_read_unsigned (regcache, S390_PSWM_REGNUM, &val);
- if (register_size (gdbarch, S390_PSWA_REGNUM) == 4)
- val = (val >> 12) & 3;
- else
- val = (val >> 44) & 3;
- store_unsigned_integer (buf, regsize, byte_order, val);
- return;
+ enum register_status status;
+
+ status = regcache_raw_read_unsigned (regcache, S390_PSWM_REGNUM, &val);
+ if (status == REG_VALID)
+ {
+ if (register_size (gdbarch, S390_PSWA_REGNUM) == 4)
+ val = (val >> 12) & 3;
+ else
+ val = (val >> 44) & 3;
+ store_unsigned_integer (buf, regsize, byte_order, val);
+ }
+ return status;
}
if (tdep->gpr_full_regnum != -1
&& regnum >= tdep->gpr_full_regnum
&& regnum < tdep->gpr_full_regnum + 16)
{
+ enum register_status status;
ULONGEST val_upper;
+
regnum -= tdep->gpr_full_regnum;
- regcache_raw_read_unsigned (regcache, S390_R0_REGNUM + regnum, &val);
- regcache_raw_read_unsigned (regcache, S390_R0_UPPER_REGNUM + regnum,
- &val_upper);
- val |= val_upper << 32;
- store_unsigned_integer (buf, regsize, byte_order, val);
- return;
+ status = regcache_raw_read_unsigned (regcache, S390_R0_REGNUM + regnum, &val);
+ if (status == REG_VALID)
+ status = regcache_raw_read_unsigned (regcache, S390_R0_UPPER_REGNUM + regnum,
+ &val_upper);
+ if (status == REG_VALID)
+ {
+ val |= val_upper << 32;
+ store_unsigned_integer (buf, regsize, byte_order, val);
+ }
+ return status;
}
internal_error (__FILE__, __LINE__, _("invalid regnum"));
register was saved, record its offset in the reg_offset table in
PROLOGUE_UNTYPED. */
static void
-s390_check_for_saved (void *data_untyped, pv_t addr, CORE_ADDR size, pv_t value)
+s390_check_for_saved (void *data_untyped, pv_t addr,
+ CORE_ADDR size, pv_t value)
{
struct s390_prologue_data *data = data_untyped;
int i, offset;
s390_store (data, d2, x2, b2, data->fpr_size, data->fpr[r1]);
/* STM r1, r3, d2(b2) --- store multiple. */
- /* STMY r1, r3, d2(b2) --- store multiple (long-displacement version). */
+ /* STMY r1, r3, d2(b2) --- store multiple (long-displacement
+ version). */
/* STMG r1, r3, d2(b2) --- store multiple (64-bit version). */
else if (is_rs (insn32, op_stm, &r1, &r3, &d2, &b2)
|| is_rsy (insn32, op1_stmy, op2_stmy, &r1, &r3, &d2, &b2)
exactly one case: when pc points to that branch instruction.
Thus we try to disassemble the one instructions immediately
- preceeding pc and check whether it is an LM-type instruction
+ preceding pc and check whether it is an LM-type instruction
modifying the stack pointer.
Note that disassembling backwards is not reliable, so there
/* If we've detected a function with stack frame, we'll still have to
treat it as frameless if we're currently within the function epilog
- code at a point where the frame pointer has already been restored.
+ code at a point where the frame pointer has already been restored.
This can only happen in an innermost frame. */
/* FIXME: cagney/2004-05-01: This sanity check shouldn't be needed,
instead the code should simpliy rely on its analysis. */
static const struct frame_unwind s390_frame_unwind = {
NORMAL_FRAME,
+ default_frame_unwind_stop_reason,
s390_frame_this_id,
s390_frame_prev_register,
NULL,
static const struct frame_unwind s390_stub_frame_unwind = {
NORMAL_FRAME,
+ default_frame_unwind_stop_reason,
s390_stub_frame_this_id,
s390_stub_frame_prev_register,
NULL,
/* New-style RT frame:
retcode + alignment (8 bytes)
siginfo (128 bytes)
- ucontext (contains sigregs at offset 5 words) */
+ ucontext (contains sigregs at offset 5 words). */
if (next_ra == next_cfa)
{
sigreg_ptr = next_cfa + 8 + 128 + align_up (5*word_size, 8);
/* Old-style RT frame and all non-RT frames:
old signal mask (8 bytes)
- pointer to sigregs */
+ pointer to sigregs. */
else
{
sigreg_ptr = read_memory_unsigned_integer (next_cfa + 8,
static const struct frame_unwind s390_sigtramp_frame_unwind = {
SIGTRAMP_FRAME,
+ default_frame_unwind_stop_reason,
s390_sigtramp_frame_this_id,
s390_sigtramp_frame_prev_register,
NULL,
{
/* Integer arguments are always extended to word size. */
regcache_cooked_write_signed (regcache, S390_R0_REGNUM + gr,
- extend_simple_arg (gdbarch, arg));
+ extend_simple_arg (gdbarch,
+ arg));
gr++;
}
else
/* Breakpoints. */
static const gdb_byte *
-s390_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
+s390_breakpoint_from_pc (struct gdbarch *gdbarch,
+ CORE_ADDR *pcptr, int *lenptr)
{
static const gdb_byte breakpoint[] = { 0x0, 0x1 };
}
static int
-s390_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name,
+s390_address_class_name_to_type_flags (struct gdbarch *gdbarch,
+ const char *name,
int *type_flags_ptr)
{
if (strcmp (name, "mode32") == 0)
displaced_step_at_entry_point);
set_gdbarch_max_insn_length (gdbarch, S390_MAX_INSTR_SIZE);
+ /* Note that GNU/Linux is the only OS supported on this
+ platform. */
+ linux_init_abi (info, gdbarch);
+
switch (tdep->abi)
{
case ABI_LINUX_S390: