/* QNX Neutrino specific low level interface, for the remote server
for GDB.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009-2012 Free Software Foundation, Inc.
This file is part of GDB.
#include "server.h"
+#include "gdbthread.h"
#include "nto-low.h"
#include <limits.h>
close (nto_inferior.ctl_fd);
init_nto_inferior (&nto_inferior);
}
- snprintf (nto_inferior.nto_procfs_path, PATH_MAX - 1, "/proc/%d/as", pid);
+ xsnprintf (nto_inferior.nto_procfs_path, PATH_MAX - 1, "/proc/%d/as", pid);
nto_inferior.ctl_fd = open (nto_inferior.nto_procfs_path, O_RDWR);
if (nto_inferior.ctl_fd == -1)
{
return 0;
}
+static void
+nto_mourn (struct process_info *process)
+{
+ remove_process (process);
+}
+
/* Check if the given thread is alive.
Return 1 if alive, 0 otherwise. */
{
TRACE ("SSTEP\n");
ourstatus->kind = TARGET_WAITKIND_STOPPED;
- ourstatus->value.sig = TARGET_SIGNAL_TRAP;
+ ourstatus->value.sig = GDB_SIGNAL_TRAP;
}
/* Was it a breakpoint? */
else if (status.flags & trace_mask)
{
TRACE ("STOPPED\n");
ourstatus->kind = TARGET_WAITKIND_STOPPED;
- ourstatus->value.sig = TARGET_SIGNAL_TRAP;
+ ourstatus->value.sig = GDB_SIGNAL_TRAP;
}
else if (status.flags & _DEBUG_FLAG_ISTOP)
{
TRACE (" SIGNALLED\n");
ourstatus->kind = TARGET_WAITKIND_STOPPED;
ourstatus->value.sig =
- target_signal_from_host (status.info.si_signo);
+ gdb_signal_from_host (status.info.si_signo);
nto_inferior.exit_signo = ourstatus->value.sig;
break;
case _DEBUG_WHY_FAULTED:
else
{
ourstatus->value.sig =
- target_signal_from_host (status.info.si_signo);
+ gdb_signal_from_host (status.info.si_signo);
nto_inferior.exit_signo = ourstatus->value.sig;
}
break;
TRACE ("REQUESTED\n");
/* We are assuming a requested stop is due to a SIGINT. */
ourstatus->kind = TARGET_WAITKIND_STOPPED;
- ourstatus->value.sig = TARGET_SIGNAL_INT;
+ ourstatus->value.sig = GDB_SIGNAL_INT;
nto_inferior.exit_signo = 0;
break;
}
If REGNO is -1, fetch all registers, or REGNO register only otherwise. */
static void
-nto_fetch_registers (int regno)
+nto_fetch_registers (struct regcache *regcache, int regno)
{
int regsize;
procfs_greg greg;
{
const unsigned int registeroffset
= the_low_target.register_offset (regno);
- supply_register (regno, ((char *)&greg) + registeroffset);
+ supply_register (regcache, regno,
+ ((char *)&greg) + registeroffset);
}
}
else
= the_low_target.register_offset (regno);
if (registeroffset == -1)
return;
- supply_register (regno, ((char *)&greg) + registeroffset);
+ supply_register (regcache, regno, ((char *)&greg) + registeroffset);
}
}
else
We always store all registers, regardless of REGNO. */
static void
-nto_store_registers (int regno)
+nto_store_registers (struct regcache *regcache, int regno)
{
procfs_greg greg;
int err;
{
const unsigned int regoffset
= the_low_target.register_offset (regno);
- collect_register (regno, ((char *)&greg) + regoffset);
+ collect_register (regcache, regno, ((char *)&greg) + regoffset);
}
err = devctl (nto_inferior.ctl_fd, DCMD_PROC_SETGREG, &greg, sizeof (greg),
0);
nto_attach,
nto_kill,
nto_detach,
+ nto_mourn,
NULL, /* nto_join */
nto_thread_alive,
nto_resume,
nto_wait,
nto_fetch_registers,
nto_store_registers,
+ NULL, /* prepare_to_access_memory */
+ NULL, /* done_accessing_memory */
nto_read_memory,
nto_write_memory,
NULL, /* nto_look_up_symbols */