27 #include <sys/debug.h> 28 #include <sys/procfs.h> 29 #include <sys/neutrino.h> 30 #include <sys/syspage.h> 32 #include <sys/netmgr.h> 48 #define _DEBUG_FLAG_TRACE (_DEBUG_FLAG_TRACE_EXEC|_DEBUG_FLAG_TRACE_RD|\ 49 _DEBUG_FLAG_TRACE_WR|_DEBUG_FLAG_TRACE_MODIFY) 55 static procfs_run
run;
94 node = netmgr_strtond (
nodestr, 0);
96 error (
_(
"Lost the QNX node. Debug session probably over."));
117 procfs_sysinfo *sysinfo;
119 char nto_procfs_path[PATH_MAX];
142 if (errno == ENOTSUP)
152 if (*(endstr - 1) ==
'/')
158 snprintf (nto_procfs_path, PATH_MAX - 1,
"%s%s",
161 fd = open (nto_procfs_path, O_RDONLY);
164 printf_filtered (
"Error opening %s : %d (%s)\n", nto_procfs_path, errno,
166 error (
_(
"Invalid procfs arg"));
170 sysinfo = (
void *)
buffer;
171 if (devctl (fd, DCMD_PROC_SYSINFO, sysinfo,
sizeof buffer, 0) != EOK)
175 error (
_(
"Devctl failed."));
179 total_size = sysinfo->total_size;
180 sysinfo = alloca (total_size);
185 error (
_(
"alloca failed."));
189 if (devctl (fd, DCMD_PROC_SYSINFO, sysinfo, total_size, 0) != EOK)
193 error (
_(
"Devctl failed."));
200 error (
_(
"Invalid target CPU."));
216 devctl (
ctl_fd, DCMD_PROC_CURTHREAD, &
tid,
sizeof (
tid), 0);
231 if (kill (
pid, 0) == -1)
235 if ((
err = devctl (
ctl_fd, DCMD_PROC_TIDSTATUS,
267 pthread_t
tid,
int state,
int flags)
270 struct _thread_name *tn;
271 procfs_threadctl tctl;
273 #if _NTO_VERSION > 630 276 if (devctl (
ctl_fd, DCMD_PROC_INFO, &pidinfo,
277 sizeof(pidinfo), 0) != EOK)
280 memset (&tctl, 0,
sizeof (tctl));
281 tctl.cmd = _NTO_TCTL_NAME;
282 tn = (
struct _thread_name *) (&tctl.data);
286 tn->name_buf_len =
sizeof (tctl.data) -
sizeof (*tn);
287 tn->new_name_len = -1;
288 if (devctl (
ctl_fd, DCMD_PROC_THREADCTL, &tctl,
sizeof (tctl), NULL) != EOK)
289 tn->name_buf[0] =
'\0';
291 tn->name_buf[_NTO_THREAD_NAME_MAX] =
'\0';
351 struct dirent *dirp = NULL;
353 procfs_info *pidinfo = NULL;
354 procfs_debuginfo *info = NULL;
355 procfs_status *
status = NULL;
356 pid_t num_threads = 0;
360 char procfs_dir[PATH_MAX];
362 snprintf (procfs_dir,
sizeof (procfs_dir),
"%s%s",
365 dp = opendir (procfs_dir);
392 snprintf (buf,
sizeof (buf),
"%s%s/%s/as",
394 "/proc", dirp->d_name);
395 pid = atoi (dirp->d_name);
400 fd = open (buf, O_RDONLY);
409 pidinfo = (procfs_info *) buf;
410 if (devctl (fd, DCMD_PROC_INFO, pidinfo,
sizeof (buf), 0) != EOK)
413 "devctl DCMD_PROC_INFO failed - %d (%s)\n",
417 num_threads = pidinfo->num_threads;
419 info = (procfs_debuginfo *) buf;
420 if (devctl (fd, DCMD_PROC_MAPDEBUG_BASE, info,
sizeof (buf), 0) != EOK)
421 strcpy (
name,
"unavailable");
423 strcpy (
name, info->path);
426 status = (procfs_status *) buf;
430 = devctl (fd, DCMD_PROC_TIDSTATUS,
status,
sizeof (buf), 0);
443 while (dirp != NULL);
452 procfs_mapinfo *mapinfos = NULL;
453 static int num_mapinfos = 0;
454 procfs_mapinfo *mapinfo_p, *mapinfo_p2;
459 procfs_debuginfo info;
460 char buff[_POSIX_PATH_MAX];
468 unsigned debug_vaddr;
469 unsigned long long offset;
474 unsigned long long ino;
482 err = devctl (
ctl_fd, DCMD_PROC_MAPINFO, NULL, 0, &num);
485 printf (
"failed devctl num mapinfos - %d (%s)\n",
err,
490 mapinfos =
XNEWVEC (procfs_mapinfo, num);
493 mapinfo_p = mapinfos;
496 err = devctl (
ctl_fd, DCMD_PROC_MAPINFO, mapinfo_p, num
497 *
sizeof (procfs_mapinfo), &num);
505 num = std::min (num, num_mapinfos);
509 for (mapinfo_p = mapinfos, i = 0; i < num; i++, mapinfo_p++)
511 if (!(mapinfo_p->flags &
flags))
514 if (mapinfo_p->ino == 0)
517 map.info.vaddr = mapinfo_p->vaddr;
519 err = devctl (
ctl_fd, DCMD_PROC_MAPDEBUG, &map,
sizeof (map), 0);
523 memset (&printme, 0,
sizeof printme);
524 printme.dev = mapinfo_p->dev;
525 printme.ino = mapinfo_p->ino;
526 printme.text.addr = mapinfo_p->vaddr;
527 printme.text.size = mapinfo_p->size;
528 printme.text.flags = mapinfo_p->flags;
529 printme.text.offset = mapinfo_p->offset;
530 printme.text.debug_vaddr = map.info.vaddr;
531 strcpy (printme.name, map.info.path);
534 for (mapinfo_p2 = mapinfos, j = 0; j < num; j++, mapinfo_p2++)
536 if (mapinfo_p2->vaddr != mapinfo_p->vaddr
537 && mapinfo_p2->ino == mapinfo_p->ino
538 && mapinfo_p2->dev == mapinfo_p->dev)
540 map.info.vaddr = mapinfo_p2->vaddr;
542 devctl (
ctl_fd, DCMD_PROC_MAPDEBUG, &map,
sizeof (map), 0);
546 if (strcmp (map.info.path, printme.name))
550 if ((
int) map.info.vaddr < (
int) printme.text.debug_vaddr)
552 memcpy (&(printme.data), &(printme.text),
553 sizeof (printme.data));
554 printme.text.addr = mapinfo_p2->vaddr;
555 printme.text.size = mapinfo_p2->size;
556 printme.text.flags = mapinfo_p2->flags;
557 printme.text.offset = mapinfo_p2->offset;
558 printme.text.debug_vaddr = map.info.vaddr;
562 printme.data.addr = mapinfo_p2->vaddr;
563 printme.data.size = mapinfo_p2->size;
564 printme.data.flags = mapinfo_p2->flags;
565 printme.data.offset = mapinfo_p2->offset;
566 printme.data.debug_vaddr = map.info.vaddr;
579 if (printme.data.size)
601 inf->attach_flag ?
"attached" :
"child",
612 static char proc_path[PATH_MAX];
616 snprintf (proc_path,
sizeof (proc_path),
"%s/proc/%d/exefile",
618 proc_fd = open (proc_path, O_RDONLY);
622 rd =
read (proc_fd, proc_path,
sizeof (proc_path) - 1);
629 proc_path[rd] =
'\0';
643 if (
pid == getpid ())
644 error (
_(
"Attaching GDB to itself is not a good idea..."));
662 inf->attach_flag = 1;
681 struct sigevent event;
684 snprintf (path, PATH_MAX - 1,
"%s%s/%d/as",
686 ctl_fd = open (path, O_RDWR);
688 error (
_(
"Couldn't open proc file %s, error %d (%s)"), path, errno,
691 error (
_(
"Couldn't stop process"));
694 event.sigev_notify = SIGEV_SIGNAL_THREAD;
695 event.sigev_signo = SIGUSR1;
696 event.sigev_code = 0;
697 event.sigev_value.sival_ptr = NULL;
698 event.sigev_priority = -1;
699 devctl (
ctl_fd, DCMD_PROC_EVENT, &event,
sizeof (event), 0);
702 &&
status.flags & _DEBUG_FLAG_STOPPED)
712 if (
query (
_(
"Interrupted while waiting for the program.\n\ 713 Give up (and stop debugging it)? ")))
724 signal (signo,
ofunc);
745 static int exit_signo = 0;
752 ourstatus->
value.
sig = GDB_SIGNAL_0;
758 sigaddset (&
set, SIGUSR1);
761 while (!(
status.flags & _DEBUG_FLAG_ISTOP))
764 sigwaitinfo (&
set, &info);
765 signal (SIGINT,
ofunc);
772 if (
status.flags & _DEBUG_FLAG_SSTEP)
775 ourstatus->
value.
sig = GDB_SIGNAL_TRAP;
781 ourstatus->
value.
sig = GDB_SIGNAL_TRAP;
783 else if (
status.flags & _DEBUG_FLAG_ISTOP)
787 case _DEBUG_WHY_SIGNALLED:
793 case _DEBUG_WHY_FAULTED:
795 if (
status.info.si_signo == SIGTRAP)
808 case _DEBUG_WHY_TERMINATED:
829 case _DEBUG_WHY_REQUESTED:
832 ourstatus->
value.
sig = GDB_SIGNAL_INT;
852 procfs_altreg altreg;
858 if (devctl (
ctl_fd, DCMD_PROC_GETGREG, &
reg,
sizeof (
reg), ®size) == EOK)
860 if (devctl (
ctl_fd, DCMD_PROC_GETFPREG, &
reg,
sizeof (
reg), ®size)
863 if (devctl (
ctl_fd, DCMD_PROC_GETALTREG, &
reg,
sizeof (
reg), ®size)
880 if (writebuf != NULL)
881 nbytes = write (
ctl_fd, writebuf, len);
886 *xfered_len = nbytes;
894 const char *annex,
gdb_byte *readbuf,
909 const unsigned int sizeof_auxv_t =
sizeof (auxv_t);
910 const unsigned int sizeof_tempbuf = 20 * sizeof_auxv_t;
922 initial_stack =
procinfo.initial_stack;
928 tempread = std::min (tempread, len) -
offset;
930 *xfered_len = tempread;
936 readbuf, writebuf,
offset, len,
954 siggnal = atoi (args);
977 errno = devctl (
ctl_fd, DCMD_PROC_BREAK, &brk,
sizeof (brk), 0);
1005 _DEBUG_BREAK_EXEC | _DEBUG_BREAK_HW, 0);
1014 _DEBUG_BREAK_EXEC | _DEBUG_BREAK_HW, -1);
1019 ptid_t ptid,
int step,
enum gdb_signal signo)
1023 sigset_t *run_fault = (sigset_t *) (
void *) &
run.fault;
1031 run.flags = _DEBUG_RUN_FAULT | _DEBUG_RUN_TRACE;
1033 run.flags |= _DEBUG_RUN_STEP;
1035 sigemptyset (run_fault);
1036 sigaddset (run_fault, FLTBPT);
1037 sigaddset (run_fault, FLTTRACE);
1038 sigaddset (run_fault, FLTILL);
1039 sigaddset (run_fault, FLTPRIV);
1040 sigaddset (run_fault, FLTBOUNDS);
1041 sigaddset (run_fault, FLTIOVF);
1042 sigaddset (run_fault, FLTIZDIV);
1043 sigaddset (run_fault, FLTFPE);
1045 sigaddset (run_fault, FLTPAGE);
1047 run.flags |= _DEBUG_RUN_ARM;
1055 if (
status.why & (_DEBUG_WHY_SIGNALLED | _DEBUG_WHY_FAULTED))
1057 if (signal_to_pass !=
status.info.si_signo)
1060 signal_to_pass, 0, 0);
1061 run.flags |= _DEBUG_RUN_CLRFLT | _DEBUG_RUN_CLRSIG;
1064 sigdelset (&
run.trace, signal_to_pass);
1068 run.flags |= _DEBUG_RUN_CLRSIG | _DEBUG_RUN_CLRFLT;
1070 errno = devctl (
ctl_fd, DCMD_PROC_RUN, &
run,
sizeof (
run), 0);
1073 perror (
_(
"run error!\n"));
1102 char *pp, *cp = scratch;
1109 while (*cp ==
' ' || *cp ==
'\t' || *cp ==
'\n')
1120 quoting = strchr (cp,
'"') ? 1 : 0;
1128 cp = strchr (pp,
'"');
1129 if ((cp == NULL) || (!quoting))
1130 cp = strchr (pp,
' ');
1132 cp = strchr (pp,
'\t');
1134 cp = strchr (pp,
'\n');
1154 char **env,
int from_tty)
1156 struct inheritance inherit;
1160 const char *in =
"", *out =
"", *
err =
"";
1166 argv =
xmalloc ((allargs.size () / (unsigned) 2 + 2) *
1172 argv[0] = exec_file;
1177 args = xstrdup (allargs.c_str ());
1182 fds[0] = STDIN_FILENO;
1183 fds[1] = STDOUT_FILENO;
1184 fds[2] = STDERR_FILENO;
1188 if (inferior_io_terminal)
1191 in = inferior_io_terminal;
1193 out = inferior_io_terminal;
1195 err = inferior_io_terminal;
1200 fd = open (in, O_RDONLY);
1208 fd = open (out, O_WRONLY);
1216 fd = open (
err, O_WRONLY);
1224 signal (SIGUSR1, signal (SIGUSR1, SIG_IGN));
1227 sigaddset (&
set, SIGUSR1);
1228 sigprocmask (SIG_UNBLOCK, &
set, NULL);
1230 memset (&inherit, 0,
sizeof (inherit));
1235 inherit.flags |= SPAWN_SETND;
1236 inherit.flags &= ~SPAWN_EXEC;
1238 inherit.flags |= SPAWN_SETGROUP | SPAWN_HOLD;
1239 inherit.pgroup = SPAWN_NEWPGROUP;
1244 sigprocmask (SIG_BLOCK, &
set, NULL);
1247 error (
_(
"Error spawning %s: %d (%s)"),
argv[0], errno,
1250 if (fds[0] != STDIN_FILENO)
1252 if (fds[1] != STDOUT_FILENO)
1254 if (fds[2] != STDERR_FILENO)
1262 inf->attach_flag = 0;
1264 flags = _DEBUG_FLAG_KLC;
1284 devctl (
ctl_fd, DCMD_PROC_STOP, NULL, 0, 0);
1298 int dev_get, dev_set;
1302 dev_get = DCMD_PROC_GETGREG;
1303 dev_set = DCMD_PROC_SETGREG;
1307 dev_get = DCMD_PROC_GETFPREG;
1308 dev_set = DCMD_PROC_SETFPREG;
1312 dev_get = DCMD_PROC_GETALTREG;
1313 dev_set = DCMD_PROC_SETALTREG;
1320 if (devctl (
ctl_fd, dev_get, buf, bufsize, regsize) != EOK)
1334 procfs_altreg altreg;
1351 sizeof (
reg), ®size);
1361 "Warning unable to write regset %d: %s\n",
1386 "Warning unable to write regset %d: %s\n", regno,
1395 int numsigs,
unsigned char *pass_signals)
1399 sigfillset (&
run.trace);
1401 for (signo = 1; signo < NSIG; signo++)
1404 if (target_signo < numsigs && pass_signals[target_signo])
1405 sigdelset (&
run.trace, signo);
1412 static char buf[1024];
1414 struct tidinfo *tip;
1419 n = snprintf (buf, 1023,
"process %d",
pid);
1422 tip = procfs_thread_info (
pid,
tid);
1424 snprintf (&buf[n], 1023,
" (state = 0x%02x)", tip->state);
1473 t->
to_doc =
"QNX Neutrino local process (started by the \"run\" command).";
1513 t->
to_longname =
"QNX Neutrino local or remote process";
1514 t->
to_doc =
"QNX Neutrino process. target procfs <node>";
1520 #define OSTYPE_NTO 1 1532 sigaddset (&
set, SIGUSR1);
1533 sigprocmask (SIG_BLOCK, &
set, NULL);
1536 sigfillset (&
run.trace);
1557 brk.type = _DEBUG_BREAK_RD;
1560 brk.type = _DEBUG_BREAK_RW;
1564 brk.type = _DEBUG_BREAK_RW;
1566 brk.type |= _DEBUG_BREAK_HW;
1570 errno = devctl (
ctl_fd, DCMD_PROC_BREAK, &brk,
sizeof (brk), 0);
1573 perror (
_(
"Failed to set hardware watchpoint"));
1582 int cnt,
int othertype)
1622 & (_DEBUG_FLAG_TRACE_RD
1623 | _DEBUG_FLAG_TRACE_WR
1624 | _DEBUG_FLAG_TRACE_MODIFY);
struct gdbarch * target_gdbarch(void)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t err
static void procfs_update_thread_list(struct target_ops *ops)
void add_target(struct target_ops *t)
ssize_t read(int fd, void *buf, size_t count)
static int procfs_insert_hw_breakpoint(struct target_ops *self, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
static constexpr ptid_t tid
struct thread_info * add_thread(ptid_t ptid)
static int procfs_breakpoint(CORE_ADDR addr, int type, int size)
struct thread_info * find_thread_ptid(ptid_t ptid)
#define nto_cpuinfo_valid
static int procfs_can_use_hw_breakpoint(struct target_ops *self, enum bptype, int, int)
static void procfs_native_open(const char *arg, int from_tty)
static void procfs_set_thread(ptid_t ptid)
static ptid_t do_attach(ptid_t ptid)
void target_announce_detach(int from_tty)
static enum target_xfer_status procfs_xfer_partial(struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
int ptid_get_pid(const ptid_t &ptid)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int int rusage_t pid_t pid
void _initialize_procfs(void)
static int procfs_remove_breakpoint(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt, enum remove_bp_reason reason)
static char * procfs_pid_to_exec_file(struct target_ops *ops, const int pid)
static void procfs_fetch_registers(struct target_ops *ops, struct regcache *regcache, int regno)
int query(const char *ctlstr,...)
static void nto_handle_sigint_twice(int signo)
static void procfs_kill_inferior(struct target_ops *ops)
void push_target(struct target_ops *t)
int(* to_insert_breakpoint)(struct target_ops *, struct gdbarch *, struct bp_target_info *) TARGET_DEFAULT_FUNC(memory_insert_breakpoint)
char * get_exec_file(int err)
struct cmd_list_element * add_info(const char *name, cmd_const_cfunc_ftype *fun, const char *doc)
char * phex(ULONGEST l, int sizeof_l)
ptid_t regcache_get_ptid(const struct regcache *regcache)
void * memset(T *s, int c, size_t n)=delete
const char *(* to_pid_to_str)(struct target_ops *, ptid_t) TARGET_DEFAULT_FUNC(default_pid_to_str)
union target_waitstatus::@174 value
static void procfs_open_1(struct target_ops *ops, const char *arg, int from_tty)
static int get_regset(int regset, char *buf, int bufsize, int *regsize)
static ptid_t procfs_wait(struct target_ops *ops, ptid_t ptid, struct target_waitstatus *ourstatus, int options)
static void procfs_interrupt(struct target_ops *self, ptid_t ptid)
int(* to_remove_watchpoint)(struct target_ops *, CORE_ADDR, int, enum target_hw_bp_type, struct expression *) TARGET_DEFAULT_RETURN(-1)
int(* to_can_use_hw_breakpoint)(struct target_ops *, enum bptype, int, int) TARGET_DEFAULT_RETURN(0)
LONGEST nto_read_auxv_from_initial_stack(CORE_ADDR initial_stack, gdb_byte *readbuf, LONGEST len, size_t sizeof_auxv_t)
static void do_closedir_cleanup(void *dir)
void inf_child_maybe_unpush_target(struct target_ops *ops)
static char * procfs_pid_to_str(struct target_ops *ops, ptid_t ptid)
static struct target_ops nto_procfs_ops
void printf_filtered(const char *format,...)
static void procfs_post_attach(struct target_ops *self, pid_t pid)
struct nto_inferior_data * nto_inferior_data(struct inferior *const inferior)
ptid_t ptid_build(int pid, long lwp, long tid)
void(* to_files_info)(struct target_ops *) TARGET_DEFAULT_IGNORE()
mach_port_t kern_return_t mach_port_t msgports mach_port_t kern_return_t pid_t pid mach_port_t kern_return_t mach_port_t task mach_port_t kern_return_t int flags
#define nto_supply_gregset
static int procfs_stopped_by_watchpoint(struct target_ops *ops)
#define nto_register_area
static int procfs_thread_alive(struct target_ops *ops, ptid_t ptid)
static int procfs_can_run(struct target_ops *self)
const char * get_inferior_io_terminal(void)
static enum target_xfer_status procfs_xfer_memory(gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST memaddr, ULONGEST len, ULONGEST *xfered_len)
static struct obstack tempbuf
long ptid_get_tid(const ptid_t &ptid)
static void procfs_meminfo(const char *args, int from_tty)
void fprintf_unfiltered(struct ui_file *stream, const char *format,...)
void(* to_resume)(struct target_ops *, ptid_t, int TARGET_DEBUG_PRINTER(target_debug_print_step), enum gdb_signal) TARGET_DEFAULT_NORETURN(noprocess())
static void procfs_resume(struct target_ops *ops, ptid_t ptid, int step, enum gdb_signal signo)
static void procfs_open(const char *arg, int from_tty)
int(* to_can_run)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
ptid_t pid_to_ptid(int pid)
int nto_map_arch_to_cputype(const char *arch)
static void procfs_files_info(struct target_ops *ignore)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
void target_interrupt(ptid_t ptid)
void inf_child_open_target(struct target_ops *target, const char *arg, int from_tty)
static void procfs_pidlist(const char *args, int from_tty)
int gdb_signal_to_host(enum gdb_signal)
struct cleanup * make_cleanup_close(int fd)
char ** nto_parse_redirection(char *pargv[], const char **pin, const char **pout, const char **perr)
enum gdb_signal gdb_signal_from_host(int)
#define nto_supply_altregset
void target_mourn_inferior(ptid_t ptid)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int status
int(* to_insert_watchpoint)(struct target_ops *, CORE_ADDR, int, enum target_hw_bp_type, struct expression *) TARGET_DEFAULT_RETURN(-1)
enum target_xfer_status(* to_xfer_partial)(struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len) TARGET_DEFAULT_RETURN(TARGET_XFER_E_IO)
static struct thread_info * new_thread(struct inferior *inf, ptid_t ptid)
static void update_thread_private_data_name(struct thread_info *new_thread, const char *newname)
void printf_unfiltered(const char *format,...)
static void procfs_pass_signals(struct target_ops *self, int numsigs, unsigned char *pass_signals)
void(* to_detach)(struct target_ops *ops, const char *, int) TARGET_DEFAULT_IGNORE()
void nto_init_solib_absolute_prefix(void)
void inf_child_mourn_inferior(struct target_ops *ops)
static void update_thread_private_data(struct thread_info *new_thread, pthread_t tid, int state, int flags)
int(* to_insert_hw_breakpoint)(struct target_ops *, struct gdbarch *, struct bp_target_info *) TARGET_DEFAULT_RETURN(-1)
char *(* to_pid_to_exec_file)(struct target_ops *, int pid) TARGET_DEFAULT_RETURN(NULL)
int target_is_pushed(struct target_ops *t)
#define _DEBUG_FLAG_TRACE
static enum gdb_osabi procfs_is_nto_target(bfd *abfd)
int(* to_remove_hw_breakpoint)(struct target_ops *, struct gdbarch *, struct bp_target_info *) TARGET_DEFAULT_RETURN(-1)
struct target_ops * inf_child_target(void)
void(* to_fetch_registers)(struct target_ops *, struct regcache *, int) TARGET_DEFAULT_IGNORE()
void(* to_mourn_inferior)(struct target_ops *) TARGET_DEFAULT_FUNC(default_mourn_inferior)
static unsigned nto_node(void)
const char *(* to_extra_thread_info)(struct target_ops *, struct thread_info *) TARGET_DEFAULT_RETURN(NULL)
unsigned int stopped_flags
static unsigned nto_procfs_node
std::unique_ptr< private_thread_info > priv
void(* to_pass_signals)(struct target_ops *, int, unsigned char *TARGET_DEBUG_PRINTER(target_debug_print_signals)) TARGET_DEFAULT_IGNORE()
enum target_waitkind kind
void(* to_kill)(struct target_ops *) TARGET_DEFAULT_NORETURN(noprocess())
static int procfs_insert_hw_watchpoint(struct target_ops *self, CORE_ADDR addr, int len, enum target_hw_bp_type type, struct expression *cond)
void detach_inferior(int pid)
char * safe_strerror(int)
static struct target_ops * nto_native_ops
void solib_create_inferior_hook(int from_tty)
static int procfs_hw_watchpoint(int addr, int len, enum target_hw_bp_type type)
const char * target_pid_to_str(ptid_t ptid)
void(* to_open)(const char *, int)
const char * nto_extra_thread_info(struct target_ops *self, struct thread_info *ti)
void(* to_post_attach)(struct target_ops *, int) TARGET_DEFAULT_IGNORE()
static int procfs_insert_breakpoint(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
int parse_pid_to_attach(const char *args)
int(* to_remove_breakpoint)(struct target_ops *, struct gdbarch *, struct bp_target_info *, enum remove_bp_reason) TARGET_DEFAULT_FUNC(memory_remove_breakpoint)
int(* to_stopped_by_watchpoint)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
static sighandler_t ofunc
static void procfs_detach(struct target_ops *ops, const char *args, int from_tty)
int ptid_equal(const ptid_t &ptid1, const ptid_t &ptid2)
struct inferior * current_inferior(void)
static void nto_handle_sigint(int signo)
const char * to_shortname
int to_have_continuable_watchpoint
unsigned long long ULONGEST
static int ignore(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
static nto_thread_info * get_nto_thread_info(thread_info *thread)
static void interrupt_query(void)
static void procfs_attach(struct target_ops *ops, const char *args, int from_tty)
const struct bfd_arch_info * gdbarch_bfd_arch_info(struct gdbarch *gdbarch)
static void breakup_args(char *scratch, char **argv)
void regcache_raw_collect(const struct regcache *regcache, int regnum, void *buf)
void(* to_interrupt)(struct target_ops *, ptid_t) TARGET_DEFAULT_IGNORE()
void(* to_create_inferior)(struct target_ops *, const char *, const std::string &, char **, int)
int(* to_thread_alive)(struct target_ops *, ptid_t ptid) TARGET_DEFAULT_RETURN(0)
void(* to_attach)(struct target_ops *ops, const char *, int)
void target_preopen(int from_tty)
#define nto_supply_fpregset
void gdb_flush(struct ui_file *file)
#define nto_cpuinfo_flags
void(* to_update_thread_list)(struct target_ops *) TARGET_DEFAULT_IGNORE()
static int procfs_remove_hw_watchpoint(struct target_ops *self, CORE_ADDR addr, int len, enum target_hw_bp_type type, struct expression *cond)
void(* to_store_registers)(struct target_ops *, struct regcache *, int) TARGET_DEFAULT_NORETURN(noprocess())
ptid_t(* to_wait)(struct target_ops *, ptid_t, struct target_waitstatus *, int TARGET_DEBUG_PRINTER(target_debug_print_options)) TARGET_DEFAULT_FUNC(default_target_wait)
#define nto_is_nto_target
static void procfs_create_inferior(struct target_ops *ops, const char *exec_file, const std::string &allargs, char **env, int from_tty)
static void procfs_store_registers(struct target_ops *ops, struct regcache *regcache, int regno)
void error(const char *fmt,...)
static void init_procfs_targets(void)
static int procfs_remove_hw_breakpoint(struct target_ops *self, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
struct target_ops * beneath
void inferior_appeared(struct inferior *inf, int pid)
void do_cleanups(struct cleanup *old_chain)
void init_thread_list(void)
static void procfs_mourn_inferior(struct target_ops *ops)