Line 33... |
Line 33... |
#include "regdef.h"
|
#include "regdef.h"
|
#include "linux-low.h"
|
#include "linux-low.h"
|
|
|
#include <asm/ptrace.h> /* For openrisc kernel ptrace register offsets */
|
#include <asm/ptrace.h> /* For openrisc kernel ptrace register offsets */
|
|
|
|
/* Defined in auto-generated file reg-or32.c. */
|
|
void init_registers_or32 (void);
|
|
|
#ifdef HAVE_SYS_REG_H
|
#ifdef HAVE_SYS_REG_H
|
#include <sys/reg.h>
|
#include <sys/reg.h>
|
#endif
|
#endif
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
/*!Global register map
|
|
|
|
This should be in GDB order (r0-r1, ppc, npc, sr) to ptrace offset.
|
|
|
|
ptrace does not support r0 (so we use r31 for now), nor ppc (so we use npc
|
|
for now).
|
|
|
|
@note This must be a global variable.
|
|
|
|
@todo Fix r0 and ppc (needs ptrace changes). */
|
|
/* -------------------------------------------------------------------------- */
|
|
struct reg regs_or32[] = {
|
|
{ "r0", GPR31 * 8, 32 },
|
|
{ "sp", SP * 8, 32 },
|
|
{ "fp", GPR2 * 8, 32 },
|
|
{ "r3", GPR3 * 8, 32 },
|
|
{ "r4", GPR4 * 8, 32 },
|
|
{ "r5", GPR5 * 8, 32 },
|
|
{ "r6", GPR6 * 8, 32 },
|
|
{ "r7", GPR7 * 8, 32 },
|
|
{ "r8", GPR8 * 8, 32 },
|
|
{ "lr", GPR9 * 8, 32 },
|
|
{ "r10", GPR10 * 8, 32 },
|
|
{ "r11", GPR11 * 8, 32 },
|
|
{ "r12", GPR12 * 8, 32 },
|
|
{ "r13", GPR13 * 8, 32 },
|
|
{ "r14", GPR14 * 8, 32 },
|
|
{ "r15", GPR15 * 8, 32 },
|
|
{ "r16", GPR16 * 8, 32 },
|
|
{ "r17", GPR17 * 8, 32 },
|
|
{ "r18", GPR18 * 8, 32 },
|
|
{ "r19", GPR19 * 8, 32 },
|
|
{ "r20", GPR20 * 8, 32 },
|
|
{ "r21", GPR21 * 8, 32 },
|
|
{ "r22", GPR22 * 8, 32 },
|
|
{ "r23", GPR23 * 8, 32 },
|
|
{ "r24", GPR24 * 8, 32 },
|
|
{ "r25", GPR25 * 8, 32 },
|
|
{ "r26", GPR26 * 8, 32 },
|
|
{ "r27", GPR27 * 8, 32 },
|
|
{ "r28", GPR28 * 8, 32 },
|
|
{ "r29", GPR29 * 8, 32 },
|
|
{ "r30", GPR30 * 8, 32 },
|
|
{ "r31", GPR31 * 8, 32 },
|
|
{ "ppc", PC * 8, 32 },
|
|
{ "npc", PC * 8, 32 },
|
|
{ "sr", SR * 8, 32 }
|
|
};
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
/*!Initialize the register data.
|
|
|
|
Should be automagically created from a data file in gdb/regformats, but for
|
|
now we do it manually. */
|
|
/* -------------------------------------------------------------------------- */
|
|
static void
|
|
init_registers_or32 ()
|
|
{
|
|
|
|
static const char *expedite_regs_or32[] = { "sp", "lr", "npc", 0 };
|
|
|
|
set_register_cache (regs_or32, sizeof (regs_or32) / sizeof (regs_or32[0]));
|
|
gdbserver_expedite_regs = expedite_regs_or32;
|
|
gdbserver_xmltarget = NULL;
|
|
}
|
|
|
|
|
|
/*! Some useful GDB register numbers. */
|
/*! Some useful GDB register numbers. */
|
#define GDB_REGNUM_R0 0
|
#define GDB_REGNUM_R0 0
|
#define GDB_REGNUM_R31 31
|
#define GDB_REGNUM_R31 31
|
#define GDB_REGNUM_PPC 32
|
#define GDB_REGNUM_PPC 32
|
#define GDB_REGNUM_NPC 33
|
#define GDB_REGNUM_NPC 33
|
Line 259... |
Line 194... |
or32_breakpoint, /* Breakpoint instruction bytes */
|
or32_breakpoint, /* Breakpoint instruction bytes */
|
OR32_BREAKPOINT_LEN, /* Breakpoint length */
|
OR32_BREAKPOINT_LEN, /* Breakpoint length */
|
NULL, /* Breakpoint reinsertion (unused) */
|
NULL, /* Breakpoint reinsertion (unused) */
|
0, /* Decrement PC after break (FALSE) */
|
0, /* Decrement PC after break (FALSE) */
|
or32_breakpoint_at, /* Predicate to check for breakpoint */
|
or32_breakpoint_at, /* Predicate to check for breakpoint */
|
NULL, /* Insert matchpoint (unused) */
|
NULL, /* Insert watchpoint (unused) */
|
NULL, /* Remove matchpoint (unused) */
|
NULL, /* Remove watchpoint (unused) */
|
NULL, /* Predicate if stopped by watchpoint */
|
NULL, /* Predicate if stopped by watchpoint */
|
NULL, /* Data address for watchpoint stop */
|
NULL, /* Data address for watchpoint stop */
|
NULL, /* ptrace PEEKUSR hook */
|
NULL, /* ptrace PEEKUSR hook */
|
NULL, /* ptrace POKEUSR hook */
|
NULL, /* ptrace POKEUSR hook */
|
NULL, /* ptrace conversion predicate */
|
NULL, /* ptrace conversion predicate */
|