static int procfs_can_run (void);
-static ptid_t procfs_wait (ptid_t, struct target_waitstatus *);
-
static int procfs_xfer_memory (CORE_ADDR, gdb_byte *, int, int,
struct mem_attrib *attrib,
struct target_ops *);
-static void procfs_fetch_registers (struct regcache *, int);
-
static void notice_signals (void);
static void init_procfs_ops (void);
{
if (sysinfo->type !=
nto_map_arch_to_cputype (gdbarch_bfd_arch_info
- (current_gdbarch)->arch_name))
+ (target_gdbarch)->arch_name))
error (_("Invalid target CPU."));
}
}
/* Return nonzero if the thread TH is still alive. */
static int
-procfs_thread_alive (ptid_t ptid)
+procfs_thread_alive (struct target_ops *ops, ptid_t ptid)
{
pid_t tid;
}
void
-procfs_find_new_threads (void)
+procfs_find_new_threads (struct target_ops *ops)
{
procfs_status status;
pid_t pid;
inf = add_inferior (pid);
inf->attach_flag = 1;
- push_target (&procfs_ops);
+ push_target (ops);
- procfs_find_new_threads ();
+ procfs_find_new_threads (ops);
}
static void
{
target_terminal_ours ();
- if (query ("Interrupted while waiting for the program.\n\
-Give up (and stop debugging it)? "))
+ if (query (_("Interrupted while waiting for the program.\n\
+Give up (and stop debugging it)? ")))
{
target_mourn_inferior ();
deprecated_throw_reason (RETURN_QUIT);
}
static ptid_t
-procfs_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
+procfs_wait (struct target_ops *ops,
+ ptid_t ptid, struct target_waitstatus *ourstatus, int options)
{
sigset_t set;
siginfo_t info;
general register set and floating point registers (if supported)
and update gdb's idea of their current values. */
static void
-procfs_fetch_registers (struct regcache *regcache, int regno)
+procfs_fetch_registers (struct target_ops *ops,
+ struct regcache *regcache, int regno)
{
union
{
}
static void
-procfs_resume (ptid_t ptid, int step, enum target_signal signo)
+procfs_resume (struct target_ops *ops,
+ ptid_t ptid, int step, enum target_signal signo)
{
int signal_to_pass;
procfs_status status;
close (fds[2]);
inferior_ptid = do_attach (pid_to_ptid (pid));
- procfs_find_new_threads ();
+ procfs_find_new_threads (ops);
inf = add_inferior (pid);
inf->attach_flag = 0;
/* warning( "Failed to set Kill-on-Last-Close flag: errno = %d(%s)\n",
errn, strerror(errn) ); */
}
- push_target (&procfs_ops);
+ push_target (ops);
target_terminal_init ();
if (exec_bfd != NULL
}
static void
-procfs_kill_inferior (void)
+procfs_kill_inferior (struct target_ops *ops)
{
target_mourn_inferior ();
}
default:
return -1;
}
- if (devctl (ctl_fd, dev_get, &buf, bufsize, regsize) != EOK)
+ if (devctl (ctl_fd, dev_get, buf, bufsize, regsize) != EOK)
return -1;
return dev_set;
}
void
-procfs_store_registers (struct regcache *regcache, int regno)
+procfs_store_registers (struct target_ops *ops,
+ struct regcache *regcache, int regno)
{
union
{
}
char *
-procfs_pid_to_str (ptid_t ptid)
+procfs_pid_to_str (struct target_ops *ops, ptid_t ptid)
{
static char buf[1024];
int pid, tid, n;
procfs_ops.to_pid_to_str = procfs_pid_to_str;
procfs_ops.to_stop = procfs_stop;
procfs_ops.to_stratum = process_stratum;
- procfs_ops.to_has_all_memory = 1;
- procfs_ops.to_has_memory = 1;
- procfs_ops.to_has_stack = 1;
- procfs_ops.to_has_registers = 1;
- procfs_ops.to_has_execution = 1;
+ procfs_ops.to_has_all_memory = default_child_has_all_memory;
+ procfs_ops.to_has_memory = default_child_has_memory;
+ procfs_ops.to_has_stack = default_child_has_stack;
+ procfs_ops.to_has_registers = default_child_has_registers;
+ procfs_ops.to_has_execution = default_child_has_execution;
procfs_ops.to_magic = OPS_MAGIC;
procfs_ops.to_have_continuable_watchpoint = 1;
}