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>
45 #define _DEBUG_FLAG_TRACE (_DEBUG_FLAG_TRACE_EXEC|_DEBUG_FLAG_TRACE_RD|\
46 _DEBUG_FLAG_TRACE_WR|_DEBUG_FLAG_TRACE_MODIFY)
52 static procfs_run
run;
90 error (
_(
"Lost the QNX node. Debug session probably over."));
112 procfs_sysinfo *sysinfo;
124 nodestr = arg ? xstrdup (arg) :
arg;
133 if (errno == ENOTSUP)
143 if (*(endstr - 1) ==
'/')
149 snprintf (
nto_procfs_path, PATH_MAX - 1,
"%s%s", nodestr ? nodestr :
"",
159 error (
_(
"Invalid procfs arg"));
163 sysinfo = (
void *) buffer;
164 if (devctl (fd, DCMD_PROC_SYSINFO, sysinfo,
sizeof buffer, 0) != EOK)
168 error (
_(
"Devctl failed."));
172 total_size = sysinfo->total_size;
173 sysinfo = alloca (total_size);
178 error (
_(
"alloca failed."));
182 if (devctl (fd, DCMD_PROC_SYSINFO, sysinfo, total_size, 0) != EOK)
186 error (
_(
"Devctl failed."));
193 error (
_(
"Invalid target CPU."));
209 devctl (
ctl_fd, DCMD_PROC_CURTHREAD, &tid,
sizeof (tid), 0);
224 if (kill (pid, 0) == -1)
228 if ((err = devctl (
ctl_fd, DCMD_PROC_TIDSTATUS,
229 &status,
sizeof (status), 0)) != EOK)
237 return (status.tid == tid) && (status.state != STATE_DEAD);
249 newnamelen = strlen (newname);
250 if (!new_thread->
priv)
255 memcpy (new_thread->
priv->
name, newname, newnamelen + 1);
257 else if (strcmp (newname, new_thread->
priv->
name) != 0)
260 int oldnamelen = strlen (new_thread->
priv->
name);
262 if (oldnamelen < newnamelen)
267 memcpy (new_thread->
priv->
name, newname, newnamelen + 1);
277 struct _thread_name *tn;
278 procfs_threadctl tctl;
280 #if _NTO_VERSION > 630
283 if (devctl (
ctl_fd, DCMD_PROC_INFO, &pidinfo,
284 sizeof(pidinfo), 0) != EOK)
287 memset (&tctl, 0,
sizeof (tctl));
288 tctl.cmd = _NTO_TCTL_NAME;
289 tn = (
struct _thread_name *) (&tctl.data);
293 tn->name_buf_len =
sizeof (tctl.data) -
sizeof (*tn);
294 tn->new_name_len = -1;
295 if (devctl (
ctl_fd, DCMD_PROC_THREADCTL, &tctl,
sizeof (tctl), NULL) != EOK)
296 tn->name_buf[0] =
'\0';
298 tn->name_buf[_NTO_THREAD_NAME_MAX] =
'\0';
327 for (tid = 1;; ++tid)
329 if (status.tid == tid
330 && (devctl (
ctl_fd, DCMD_PROC_TIDSTATUS, &status,
sizeof (status), 0)
333 if (status.tid != tid)
358 struct dirent *dirp = NULL;
360 procfs_info *pidinfo = NULL;
361 procfs_debuginfo *info = NULL;
362 procfs_status *
status = NULL;
363 pid_t num_threads = 0;
396 pid = atoi (dirp->d_name);
401 fd = open (buf, O_RDONLY);
411 pidinfo = (procfs_info *) buf;
412 if (devctl (fd, DCMD_PROC_INFO, pidinfo,
sizeof (buf), 0) != EOK)
415 "devctl DCMD_PROC_INFO failed - %d (%s)\n",
419 num_threads = pidinfo->num_threads;
421 info = (procfs_debuginfo *) buf;
422 if (devctl (fd, DCMD_PROC_MAPDEBUG_BASE, info,
sizeof (buf), 0) != EOK)
423 strcpy (name,
"unavailable");
425 strcpy (name, info->path);
428 status = (procfs_status *) buf;
429 for (status->tid = 1; status->tid <= num_threads; status->tid++)
431 if (devctl (fd, DCMD_PROC_TIDSTATUS, status,
sizeof (buf), 0) != EOK
434 if (status->tid != 0)
440 while (dirp != NULL);
449 procfs_mapinfo *mapinfos = NULL;
450 static int num_mapinfos = 0;
451 procfs_mapinfo *mapinfo_p, *mapinfo_p2;
456 procfs_debuginfo info;
457 char buff[_POSIX_PATH_MAX];
465 unsigned debug_vaddr;
466 unsigned long long offset;
471 unsigned long long ino;
479 err = devctl (
ctl_fd, DCMD_PROC_MAPINFO, NULL, 0, &num);
482 printf (
"failed devctl num mapinfos - %d (%s)\n",
err,
487 mapinfos =
xmalloc (num *
sizeof (procfs_mapinfo));
490 mapinfo_p = mapinfos;
493 err = devctl (
ctl_fd, DCMD_PROC_MAPINFO, mapinfo_p, num
494 *
sizeof (procfs_mapinfo), &num);
502 num =
min (num, num_mapinfos);
506 for (mapinfo_p = mapinfos, i = 0; i < num; i++, mapinfo_p++)
508 if (!(mapinfo_p->flags & flags))
511 if (mapinfo_p->ino == 0)
514 map.info.vaddr = mapinfo_p->vaddr;
516 err = devctl (
ctl_fd, DCMD_PROC_MAPDEBUG, &map,
sizeof (map), 0);
520 memset (&printme, 0,
sizeof printme);
521 printme.dev = mapinfo_p->dev;
522 printme.ino = mapinfo_p->ino;
523 printme.text.addr = mapinfo_p->vaddr;
524 printme.text.size = mapinfo_p->size;
525 printme.text.flags = mapinfo_p->flags;
526 printme.text.offset = mapinfo_p->offset;
527 printme.text.debug_vaddr = map.info.vaddr;
528 strcpy (printme.name, map.info.path);
531 for (mapinfo_p2 = mapinfos, j = 0; j < num; j++, mapinfo_p2++)
533 if (mapinfo_p2->vaddr != mapinfo_p->vaddr
534 && mapinfo_p2->ino == mapinfo_p->ino
535 && mapinfo_p2->dev == mapinfo_p->dev)
537 map.info.vaddr = mapinfo_p2->vaddr;
539 devctl (
ctl_fd, DCMD_PROC_MAPDEBUG, &map,
sizeof (map), 0);
543 if (strcmp (map.info.path, printme.name))
547 if ((
int) map.info.vaddr < (
int) printme.text.debug_vaddr)
549 memcpy (&(printme.data), &(printme.text),
550 sizeof (printme.data));
551 printme.text.addr = mapinfo_p2->vaddr;
552 printme.text.size = mapinfo_p2->size;
553 printme.text.flags = mapinfo_p2->flags;
554 printme.text.offset = mapinfo_p2->offset;
555 printme.text.debug_vaddr = map.info.vaddr;
559 printme.data.addr = mapinfo_p2->vaddr;
560 printme.data.size = mapinfo_p2->size;
561 printme.data.flags = mapinfo_p2->flags;
562 printme.data.offset = mapinfo_p2->offset;
563 printme.data.debug_vaddr = map.info.vaddr;
576 if (printme.data.size)
612 if (pid == getpid ())
613 error (
_(
"Attaching GDB to itself is not a good idea..."));
650 struct sigevent event;
655 ctl_fd = open (path, O_RDWR);
657 error (
_(
"Couldn't open proc file %s, error %d (%s)"), path, errno,
659 if (devctl (
ctl_fd, DCMD_PROC_STOP, &status,
sizeof (status), 0) != EOK)
660 error (
_(
"Couldn't stop process"));
663 event.sigev_notify = SIGEV_SIGNAL_THREAD;
664 event.sigev_signo = SIGUSR1;
665 event.sigev_code = 0;
666 event.sigev_value.sival_ptr = NULL;
667 event.sigev_priority = -1;
668 devctl (
ctl_fd, DCMD_PROC_EVENT, &event,
sizeof (event), 0);
670 if (devctl (
ctl_fd, DCMD_PROC_STATUS, &status,
sizeof (status), 0) == EOK
671 && status.flags & _DEBUG_FLAG_STOPPED)
683 if (
query (
_(
"Interrupted while waiting for the program.\n\
684 Give up (and stop debugging it)? ")))
697 signal (signo,
ofunc);
718 static int exit_signo = 0;
725 ourstatus->
value.
sig = GDB_SIGNAL_0;
731 sigaddset (&set, SIGUSR1);
733 devctl (
ctl_fd, DCMD_PROC_STATUS, &status,
sizeof (status), 0);
734 while (!(status.flags & _DEBUG_FLAG_ISTOP))
737 sigwaitinfo (&set, &info);
738 signal (SIGINT,
ofunc);
739 devctl (
ctl_fd, DCMD_PROC_STATUS, &status,
sizeof (status), 0);
742 if (status.flags & _DEBUG_FLAG_SSTEP)
745 ourstatus->
value.
sig = GDB_SIGNAL_TRAP;
751 ourstatus->
value.
sig = GDB_SIGNAL_TRAP;
753 else if (status.flags & _DEBUG_FLAG_ISTOP)
757 case _DEBUG_WHY_SIGNALLED:
763 case _DEBUG_WHY_FAULTED:
765 if (status.info.si_signo == SIGTRAP)
778 case _DEBUG_WHY_TERMINATED:
799 case _DEBUG_WHY_REQUESTED:
802 ourstatus->
value.
sig = GDB_SIGNAL_INT;
808 return ptid_build (status.pid, 0, status.tid);
822 procfs_altreg altreg;
828 if (devctl (
ctl_fd, DCMD_PROC_GETGREG, &
reg,
sizeof (
reg), ®size) == EOK)
830 if (devctl (
ctl_fd, DCMD_PROC_GETFPREG, &
reg,
sizeof (
reg), ®size)
833 if (devctl (
ctl_fd, DCMD_PROC_GETALTREG, &
reg,
sizeof (
reg), ®size)
850 if (writebuf != NULL)
851 nbytes = write (
ctl_fd, writebuf, len);
856 *xfered_len = nbytes;
864 const char *annex,
gdb_byte *readbuf,
874 readbuf, writebuf, offset, len);
898 siggnal = atoi (args);
921 errno = devctl (
ctl_fd, DCMD_PROC_BREAK, &brk,
sizeof (brk), 0);
948 _DEBUG_BREAK_EXEC | _DEBUG_BREAK_HW, 0);
957 _DEBUG_BREAK_EXEC | _DEBUG_BREAK_HW, -1);
966 sigset_t *run_fault = (sigset_t *) (
void *) &
run.fault;
974 run.flags = _DEBUG_RUN_FAULT | _DEBUG_RUN_TRACE;
976 run.flags |= _DEBUG_RUN_STEP;
978 sigemptyset (run_fault);
979 sigaddset (run_fault, FLTBPT);
980 sigaddset (run_fault, FLTTRACE);
981 sigaddset (run_fault, FLTILL);
982 sigaddset (run_fault, FLTPRIV);
983 sigaddset (run_fault, FLTBOUNDS);
984 sigaddset (run_fault, FLTIOVF);
985 sigaddset (run_fault, FLTIZDIV);
986 sigaddset (run_fault, FLTFPE);
988 sigaddset (run_fault, FLTPAGE);
990 run.flags |= _DEBUG_RUN_ARM;
996 devctl (
ctl_fd, DCMD_PROC_STATUS, &status,
sizeof (status), 0);
998 if (status.why & (_DEBUG_WHY_SIGNALLED | _DEBUG_WHY_FAULTED))
1000 if (signal_to_pass != status.info.si_signo)
1003 signal_to_pass, 0, 0);
1004 run.flags |= _DEBUG_RUN_CLRFLT | _DEBUG_RUN_CLRSIG;
1007 sigdelset (&
run.trace, signal_to_pass);
1011 run.flags |= _DEBUG_RUN_CLRSIG | _DEBUG_RUN_CLRFLT;
1013 errno = devctl (
ctl_fd, DCMD_PROC_RUN, &
run,
sizeof (
run), 0);
1016 perror (
_(
"run error!\n"));
1045 char *pp, *cp = scratch;
1052 while (*cp ==
' ' || *cp ==
'\t' || *cp ==
'\n')
1063 quoting = strchr (cp,
'"') ? 1 : 0;
1071 cp = strchr (pp,
'"');
1072 if ((cp == NULL) || (!quoting))
1073 cp = strchr (pp,
' ');
1075 cp = strchr (pp,
'\t');
1077 cp = strchr (pp,
'\n');
1096 char *allargs,
char **env,
int from_tty)
1098 struct inheritance inherit;
1102 const char *in =
"", *out =
"", *
err =
"";
1108 argv =
xmalloc (((strlen (allargs) + 1) / (
unsigned) 2 + 2) *
1114 argv[0] = exec_file;
1119 args = xstrdup (allargs);
1124 fds[0] = STDIN_FILENO;
1125 fds[1] = STDOUT_FILENO;
1126 fds[2] = STDERR_FILENO;
1130 if (inferior_io_terminal)
1133 in = inferior_io_terminal;
1135 out = inferior_io_terminal;
1137 err = inferior_io_terminal;
1142 fd = open (in, O_RDONLY);
1150 fd = open (out, O_WRONLY);
1158 fd = open (
err, O_WRONLY);
1166 signal (SIGUSR1, signal (SIGUSR1, SIG_IGN));
1169 sigaddset (&set, SIGUSR1);
1170 sigprocmask (SIG_UNBLOCK, &set, NULL);
1172 memset (&inherit, 0,
sizeof (inherit));
1177 inherit.flags |= SPAWN_SETND;
1178 inherit.flags &= ~SPAWN_EXEC;
1180 inherit.flags |= SPAWN_SETGROUP | SPAWN_HOLD;
1181 inherit.pgroup = SPAWN_NEWPGROUP;
1182 pid = spawnp (argv[0], 3, fds, &inherit, argv,
1186 sigprocmask (SIG_BLOCK, &set, NULL);
1189 error (
_(
"Error spawning %s: %d (%s)"), argv[0], errno,
1192 if (fds[0] != STDIN_FILENO)
1194 if (fds[1] != STDOUT_FILENO)
1196 if (fds[2] != STDERR_FILENO)
1206 flags = _DEBUG_FLAG_KLC;
1207 errn = devctl (
ctl_fd, DCMD_PROC_SET_FLAG, &flags,
sizeof (flags), 0);
1226 devctl (
ctl_fd, DCMD_PROC_STOP, NULL, 0, 0);
1240 int dev_get, dev_set;
1244 dev_get = DCMD_PROC_GETGREG;
1245 dev_set = DCMD_PROC_SETGREG;
1249 dev_get = DCMD_PROC_GETFPREG;
1250 dev_set = DCMD_PROC_SETFPREG;
1254 dev_get = DCMD_PROC_GETALTREG;
1255 dev_set = DCMD_PROC_SETALTREG;
1262 if (devctl (
ctl_fd, dev_get, buf, bufsize, regsize) != EOK)
1276 procfs_altreg altreg;
1292 sizeof (
reg), ®size);
1299 err = devctl (
ctl_fd, dev_set, &
reg, regsize, 0);
1302 "Warning unable to write regset %d: %s\n",
1317 regno, regset, &off);
1324 err = devctl (
ctl_fd, dev_set, &
reg, regsize, 0);
1327 "Warning unable to write regset %d: %s\n", regno,
1336 int numsigs,
unsigned char *pass_signals)
1340 sigfillset (&
run.trace);
1342 for (signo = 1; signo < NSIG; signo++)
1345 if (target_signo < numsigs && pass_signals[target_signo])
1346 sigdelset (&
run.trace, signo);
1350 static struct tidinfo *
1360 static char buf[1024];
1362 struct tidinfo *tip;
1367 n = snprintf (buf, 1023,
"process %d", pid);
1372 snprintf (&buf[n], 1023,
" (state = 0x%02x)", tip->state);
1421 t->
to_doc =
"QNX Neutrino local process (started by the \"run\" command).";
1460 t->
to_longname =
"QNX Neutrino local or remote process";
1461 t->
to_doc =
"QNX Neutrino process. target procfs <node>";
1467 #define OSTYPE_NTO 1
1479 sigaddset (&set, SIGUSR1);
1480 sigprocmask (SIG_BLOCK, &set, NULL);
1483 sigfillset (&
run.trace);
1504 brk.type = _DEBUG_BREAK_RD;
1507 brk.type = _DEBUG_BREAK_RW;
1511 brk.type = _DEBUG_BREAK_RW;
1513 brk.type |= _DEBUG_BREAK_HW;
1517 errno = devctl (
ctl_fd, DCMD_PROC_BREAK, &brk,
sizeof (brk), 0);
1520 perror (
_(
"Failed to set hardware watchpoint"));
1528 int type,
int cnt,
int othertype)
struct gdbarch * target_gdbarch(void)
static void procfs_update_thread_list(struct target_ops *ops)
void add_target(struct target_ops *t)
void target_terminal_ours(void)
ssize_t read(int fd, void *buf, size_t count)
static int procfs_remove_breakpoint(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
struct private_thread_info * priv
static int procfs_hw_watchpoint(int addr, int len, int type)
static int procfs_insert_hw_breakpoint(struct target_ops *self, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
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 void nto_interrupt_twice(int signo)
void target_stop(ptid_t ptid)
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)
static char nto_procfs_path[PATH_MAX]
int ptid_equal(ptid_t ptid1, ptid_t ptid2)
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)
static void procfs_create_inferior(struct target_ops *ops, char *exec_file, char *allargs, char **env, int from_tty)
void _initialize_procfs(void)
struct gdbarch * get_regcache_arch(const struct regcache *regcache)
static void procfs_fetch_registers(struct target_ops *ops, struct regcache *regcache, int regno)
char *(* to_pid_to_str)(struct target_ops *, ptid_t) TARGET_DEFAULT_FUNC(default_pid_to_str)
int query(const char *ctlstr,...)
void procfs_meminfo(char *args, int from_tty)
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 *(* to_extra_thread_info)(struct target_ops *, struct thread_info *) TARGET_DEFAULT_RETURN(NULL)
struct ui_file * gdb_stdout
char * phex(ULONGEST l, int sizeof_l)
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)
int(* to_remove_breakpoint)(struct target_ops *, struct gdbarch *, struct bp_target_info *) TARGET_DEFAULT_FUNC(memory_remove_breakpoint)
ptid_t(* to_wait)(struct target_ops *, ptid_t, struct target_waitstatus *, int TARGET_DEBUG_PRINTER(target_debug_print_options)) TARGET_DEFAULT_NORETURN(noprocess())
char * target_pid_to_str(ptid_t ptid)
static void procfs_stop(struct target_ops *self, ptid_t ptid)
static void do_closedir_cleanup(void *dir)
void inf_child_maybe_unpush_target(struct target_ops *ops)
static int procfs_can_use_hw_breakpoint(struct target_ops *self, int, int, int)
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)
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)
int(* to_insert_watchpoint)(struct target_ops *, CORE_ADDR, int, int, struct expression *) TARGET_DEFAULT_RETURN(-1)
#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 struct tidinfo * procfs_thread_info(pid_t pid, short tid)
static enum target_xfer_status procfs_xfer_memory(gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST memaddr, ULONGEST len, ULONGEST *xfered_len)
mach_port_t mach_port_t name mach_port_t mach_port_t name error_t err
static int procfs_remove_hw_watchpoint(struct target_ops *self, CORE_ADDR addr, int len, int type, struct expression *cond)
int(* to_remove_watchpoint)(struct target_ops *, CORE_ADDR, int, int, struct expression *) TARGET_DEFAULT_RETURN(-1)
void target_terminal_inferior(void)
void fprintf_unfiltered(struct ui_file *stream, const char *format,...)
mach_port_t mach_port_t name mach_port_t mach_port_t name error_t int status
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)
union target_waitstatus::@161 value
void inf_child_open_target(struct target_ops *target, const char *arg, 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)
struct cmd_list_element * add_info(const char *name, cmd_cfunc_ftype *fun, const char *doc)
#define nto_supply_altregset
void target_mourn_inferior(void)
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 void nto_interrupt(int signo)
static struct thread_info * new_thread(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)
int target_is_pushed(struct target_ops *t)
int ptid_get_pid(ptid_t ptid)
PTR xrealloc(PTR ptr, size_t size)
#define _DEBUG_FLAG_TRACE
static enum gdb_osabi procfs_is_nto_target(bfd *abfd)
void target_terminal_init(void)
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()
long ptid_get_tid(ptid_t ptid)
void(* to_mourn_inferior)(struct target_ops *) TARGET_DEFAULT_FUNC(default_mourn_inferior)
static unsigned nto_node(void)
static unsigned nto_procfs_node
int(* to_can_use_hw_breakpoint)(struct target_ops *, int, int, int) TARGET_DEFAULT_RETURN(0)
void(* to_pass_signals)(struct target_ops *, int, unsigned char *TARGET_DEBUG_PRINTER(target_debug_print_signals)) TARGET_DEFAULT_IGNORE()
void(* to_stop)(struct target_ops *, ptid_t) TARGET_DEFAULT_IGNORE()
enum target_waitkind kind
void(* to_kill)(struct target_ops *) TARGET_DEFAULT_NORETURN(noprocess())
struct ui_file * gdb_stderr
void detach_inferior(int pid)
char * safe_strerror(int)
static struct target_ops * nto_native_ops
void procfs_pidlist(char *args, int from_tty)
void solib_create_inferior_hook(int from_tty)
void(* to_open)(const char *, int)
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)
void(* to_create_inferior)(struct target_ops *, char *, char *, char **, int)
int parse_pid_to_attach(const char *args)
int(* to_stopped_by_watchpoint)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
static void procfs_detach(struct target_ops *ops, const char *args, int from_tty)
struct inferior * current_inferior(void)
const char * to_shortname
int to_have_continuable_watchpoint
char * get_exec_file(int err)
unsigned long long ULONGEST
static int ignore(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
static void interrupt_query(void)
static void procfs_attach(struct target_ops *ops, const char *args, int from_tty)
static int procfs_insert_hw_watchpoint(struct target_ops *self, CORE_ADDR addr, int len, int type, struct expression *cond)
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)
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()
void(* to_store_registers)(struct target_ops *, struct regcache *, int) TARGET_DEFAULT_NORETURN(noprocess())
#define nto_is_nto_target
void procfs_store_registers(struct target_ops *ops, struct regcache *regcache, int regno)
void error(const char *fmt,...)
char * nto_extra_thread_info(struct target_ops *self, struct thread_info *ti)
mach_port_t mach_port_t name mach_port_t mach_port_t name error_t int int rusage_t pid_t pid
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)
const ULONGEST const LONGEST len