/* Native-dependent code for LynxOS.
- Copyright 1993, 1994 Free Software Foundation, Inc.
+ Copyright 1993, 1994, 2001 Free Software Foundation, Inc.
This file is part of GDB.
#include "inferior.h"
#include "target.h"
#include "gdbcore.h"
+#include "regcache.h"
#include <sys/ptrace.h>
#include <sys/wait.h>
#include <sys/fpp.h>
-static unsigned long registers_addr PARAMS ((int pid));
-static void fetch_core_registers PARAMS ((char *, unsigned, int, CORE_ADDR));
+static unsigned long registers_addr (int pid);
+static void fetch_core_registers (char *, unsigned, int, CORE_ADDR);
#define X(ENTRY)(offsetof(struct econtext, ENTRY))
It also handles knows where to find the I & L regs on the stack. */
void
-fetch_inferior_registers (regno)
- int regno;
+fetch_inferior_registers (int regno)
{
int whatregs = 0;
sp = read_register (SP_REGNUM);
- target_xfer_memory (sp + FRAME_SAVED_I0,
+ target_read_memory (sp + FRAME_SAVED_I0,
®isters[REGISTER_BYTE (I0_REGNUM)],
- 8 * REGISTER_RAW_SIZE (I0_REGNUM), 0);
+ 8 * REGISTER_RAW_SIZE (I0_REGNUM));
for (i = I0_REGNUM; i <= I7_REGNUM; i++)
register_valid[i] = 1;
- target_xfer_memory (sp + FRAME_SAVED_L0,
+ target_read_memory (sp + FRAME_SAVED_L0,
®isters[REGISTER_BYTE (L0_REGNUM)],
- 8 * REGISTER_RAW_SIZE (L0_REGNUM), 0);
+ 8 * REGISTER_RAW_SIZE (L0_REGNUM));
for (i = L0_REGNUM; i <= L0_REGNUM + 7; i++)
register_valid[i] = 1;
}
this point. */
void
-store_inferior_registers (regno)
- int regno;
+store_inferior_registers (int regno)
{
int whatregs = 0;
if (regno == -1 || regno == SP_REGNUM)
{
if (!register_valid[L0_REGNUM + 5])
- abort ();
- target_xfer_memory (sp + FRAME_SAVED_I0,
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
+ target_write_memory (sp + FRAME_SAVED_I0,
®isters[REGISTER_BYTE (I0_REGNUM)],
- 8 * REGISTER_RAW_SIZE (I0_REGNUM), 1);
+ 8 * REGISTER_RAW_SIZE (I0_REGNUM));
- target_xfer_memory (sp + FRAME_SAVED_L0,
+ target_write_memory (sp + FRAME_SAVED_L0,
®isters[REGISTER_BYTE (L0_REGNUM)],
- 8 * REGISTER_RAW_SIZE (L0_REGNUM), 1);
+ 8 * REGISTER_RAW_SIZE (L0_REGNUM));
}
else if (regno >= L0_REGNUM && regno <= I7_REGNUM)
{
if (!register_valid[regno])
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
if (regno >= L0_REGNUM && regno <= L0_REGNUM + 7)
regoffset = REGISTER_BYTE (regno) - REGISTER_BYTE (L0_REGNUM)
+ FRAME_SAVED_L0;
else
regoffset = REGISTER_BYTE (regno) - REGISTER_BYTE (I0_REGNUM)
+ FRAME_SAVED_I0;
- target_xfer_memory (sp + regoffset, ®isters[REGISTER_BYTE (regno)],
- REGISTER_RAW_SIZE (regno), 1);
+ target_write_memory (sp + regoffset,
+ ®isters[REGISTER_BYTE (regno)],
+ REGISTER_RAW_SIZE (regno));
}
}
saved context block. */
static unsigned long
-registers_addr (pid)
- int pid;
+registers_addr (int pid)
{
CORE_ADDR stblock;
int ecpoff = offsetof (st_t, ecp);
marking them as valid so we won't fetch them again. */
void
-fetch_inferior_registers (regno)
- int regno;
+fetch_inferior_registers (int regno)
{
int reglo, reghi;
int i;
#endif
void
-store_inferior_registers (regno)
- int regno;
+store_inferior_registers (int regno)
{
int reglo, reghi;
int i;
of error; store status through argument pointer OURSTATUS. */
int
-child_wait (pid, ourstatus)
- int pid;
- struct target_waitstatus *ourstatus;
+child_wait (int pid, struct target_waitstatus *ourstatus)
{
int save_errno;
int thread;
/* Return nonzero if the given thread is still alive. */
int
-child_thread_alive (pid)
- int pid;
+child_thread_alive (int pid)
{
/* Arggh. Apparently pthread_kill only works for threads within
the process that calls pthread_kill.
If SIGNAL is nonzero, give it that signal. */
void
-child_resume (pid, step, signal)
- int pid;
- int step;
- enum target_signal signal;
+child_resume (int pid, int step, enum target_signal signal)
{
int func;
buffer. */
char *
-child_pid_to_str (pid)
- int pid;
+child_pid_to_str (int pid)
{
static char buf[40];
*/
static void
-fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
- char *core_reg_sect;
- unsigned core_reg_size;
- int which;
- CORE_ADDR reg_addr;
+fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
+ CORE_ADDR reg_addr)
{
struct st_entry s;
unsigned int regno;
};
void
-_initialize_core_lynx ()
+_initialize_core_lynx (void)
{
add_core_fns (&lynx_core_fns);
}