21#include "gdbsupport/block-signals.h"
22#include "gdbsupport/byte-vector.h"
23#include "gdbsupport/event-loop.h"
31#include "gdbsupport/buildargv.h"
32#include "gdbsupport/gdb_wait.h"
36#ifdef HAVE_SYS_PROCCTL_H
37#include <sys/procctl.h>
39#include <sys/procfs.h>
40#include <sys/ptrace.h>
41#include <sys/signal.h>
42#include <sys/sysctl.h>
53#define PT_GETREGSET 42
54#define PT_SETREGSET 43
63 static char buf[PATH_MAX];
69 mib[2] = KERN_PROC_PATHNAME;
72 if (sysctl (mib, 4, buf, &buflen, NULL, 0) == 0)
76 return buflen == 0 ? NULL : buf;
90 struct kinfo_vmentry *kve;
94 gdb::unique_xmalloc_ptr<struct kinfo_vmentry>
95 vmentl (kinfo_getvmmap (
pid, &nitems));
99 for (i = 0, kve = vmentl.get (); i < nitems; i++, kve++)
102 if (!(kve->kve_protection & KVME_PROT_READ)
103 || kve->kve_flags & KVME_FLAG_NOCOREDUMP)
107 if (kve->kve_type != KVME_TYPE_DEFAULT
108 && kve->kve_type != KVME_TYPE_VNODE
109 && kve->kve_type != KVME_TYPE_SWAP
110 && kve->kve_type != KVME_TYPE_PHYS)
113 size = kve->kve_end - kve->kve_start;
116 gdb_printf (
"Save segment, %ld bytes at %s (%c%c%c)\n",
119 kve->kve_protection & KVME_PROT_READ ?
'r' :
'-',
120 kve->kve_protection & KVME_PROT_WRITE ?
'w' :
'-',
121 kve->kve_protection & KVME_PROT_EXEC ?
'x' :
'-');
126 func (kve->kve_start,
size, kve->kve_protection & KVME_PROT_READ,
127 kve->kve_protection & KVME_PROT_WRITE,
128 kve->kve_protection & KVME_PROT_EXEC, 1,
false, data);
135static gdb::unique_xmalloc_ptr<char>
144 mib[2] = KERN_PROC_ARGS;
146 if (sysctl (mib, 4, NULL, &len, NULL, 0) == -1)
152 gdb::unique_xmalloc_ptr<char> cmdline ((
char *)
xmalloc (len));
153 if (sysctl (mib, 4, cmdline.get (), &len, NULL, 0) == -1)
157 char *cp = cmdline.get ();
158 for (
size_t i = 0; i < len - 1; i++)
178 mib[2] = KERN_PROC_PID;
180 return (sysctl (mib, 4, kp, &len, NULL, 0) == 0);
188 gdb::unique_xmalloc_ptr<struct kinfo_file> fdtbl;
190 struct kinfo_proc kp;
192 bool do_cmdline =
false;
195 bool do_files =
false;
196 bool do_mappings =
false;
197 bool do_status =
false;
234 error (_(
"Not supported on this target."));
237 gdb_argv built_argv (args);
238 if (built_argv.count () == 0)
242 error (_(
"No current process: you must name one."));
244 else if (built_argv.count () == 1 && isdigit (built_argv[0][0]))
245 pid = strtol (built_argv[0], NULL, 10);
247 error (_(
"Invalid arguments."));
250 if (do_cwd || do_exe || do_files)
251 fdtbl.reset (kinfo_getfile (
pid, &nfd));
256 if (cmdline !=
nullptr)
257 gdb_printf (
"cmdline = '%s'\n", cmdline.get ());
259 warning (_(
"unable to fetch command line"));
263 const char *cwd = NULL;
264 struct kinfo_file *kf = fdtbl.get ();
265 for (
int i = 0; i < nfd; i++, kf++)
267 if (kf->kf_type == KF_TYPE_VNODE && kf->kf_fd == KF_FD_TYPE_CWD)
276 warning (_(
"unable to fetch current working directory"));
280 const char *exe = NULL;
281 struct kinfo_file *kf = fdtbl.get ();
282 for (
int i = 0; i < nfd; i++, kf++)
284 if (kf->kf_type == KF_TYPE_VNODE && kf->kf_fd == KF_FD_TYPE_TEXT)
295 warning (_(
"unable to fetch executable path name"));
299 struct kinfo_file *kf = fdtbl.get ();
304 for (
int i = 0; i < nfd; i++, kf++)
306 kf->kf_offset, kf->kf_vnode_type,
307 kf->kf_sock_domain, kf->kf_sock_type,
308 kf->kf_sock_protocol, &kf->kf_sa_local,
309 &kf->kf_sa_peer, kf->kf_path);
312 warning (_(
"unable to fetch list of open files"));
317 gdb::unique_xmalloc_ptr<struct kinfo_vmentry>
318 vmentl (kinfo_getvmmap (
pid, &nvment));
320 if (vmentl !=
nullptr)
322 int addr_bit = TARGET_CHAR_BIT *
sizeof (
void *);
325 struct kinfo_vmentry *kve = vmentl.get ();
326 for (
int i = 0; i < nvment; i++, kve++)
328 kve->kve_end, kve->kve_offset,
329 kve->kve_flags, kve->kve_protection,
333 warning (_(
"unable to fetch virtual memory map"));
338 warning (_(
"Failed to fetch process information"));
351 state =
"R (running)";
354 state =
"T (stopped)";
357 state =
"Z (zombie)";
360 state =
"S (sleeping)";
363 state =
"W (interrupt wait)";
366 state =
"L (blocked on lock)";
369 state =
"? (unknown)";
373 gdb_printf (
"Parent process: %d\n", kp.ki_ppid);
374 gdb_printf (
"Process group: %d\n", kp.ki_pgid);
376 gdb_printf (
"TTY: %s\n", pulongest (kp.ki_tdev));
377 gdb_printf (
"TTY owner process group: %d\n", kp.ki_tpgid);
378 gdb_printf (
"User IDs (real, effective, saved): %d %d %d\n",
379 kp.ki_ruid, kp.ki_uid, kp.ki_svuid);
380 gdb_printf (
"Group IDs (real, effective, saved): %d %d %d\n",
381 kp.ki_rgid, kp.ki_groups[0], kp.ki_svgid);
383 for (
int i = 0; i < kp.ki_ngroups; i++)
386 gdb_printf (
"Minor faults (no memory page): %ld\n",
387 kp.ki_rusage.ru_minflt);
389 kp.ki_rusage_ch.ru_minflt);
390 gdb_printf (
"Major faults (memory page faults): %ld\n",
391 kp.ki_rusage.ru_majflt);
393 kp.ki_rusage_ch.ru_majflt);
395 plongest (kp.ki_rusage.ru_utime.tv_sec),
396 kp.ki_rusage.ru_utime.tv_usec);
398 plongest (kp.ki_rusage.ru_stime.tv_sec),
399 kp.ki_rusage.ru_stime.tv_usec);
401 plongest (kp.ki_rusage_ch.ru_utime.tv_sec),
402 kp.ki_rusage_ch.ru_utime.tv_usec);
404 plongest (kp.ki_rusage_ch.ru_stime.tv_sec),
405 kp.ki_rusage_ch.ru_stime.tv_usec);
406 gdb_printf (
"'nice' value: %d\n", kp.ki_nice);
408 plongest (kp.ki_start.tv_sec),
409 kp.ki_start.tv_usec);
410 pgtok = getpagesize () / 1024;
412 pulongest (kp.ki_size / 1024));
414 pulongest (kp.ki_dsize * pgtok));
416 pulongest (kp.ki_ssize * pgtok));
418 pulongest (kp.ki_tsize * pgtok));
420 pulongest (kp.ki_rssize * pgtok));
422 pulongest (kp.ki_rusage.ru_maxrss));
424 for (
int i = 0; i < _SIG_WORDS; i++)
425 gdb_printf (
"%08x ", kp.ki_siglist.__bits[i]);
428 for (
int i = 0; i < _SIG_WORDS; i++)
429 gdb_printf (
"%08x ", kp.ki_sigignore.__bits[i]);
432 for (
int i = 0; i < _SIG_WORDS; i++)
433 gdb_printf (
"%08x ", kp.ki_sigcatch.__bits[i]);
463 union sigval32 si_value;
500 return sizeof (
struct siginfo32);
502 return sizeof (siginfo_t);
519 struct siginfo32 si32;
521 si32.si_signo = si->si_signo;
522 si32.si_errno = si->si_errno;
523 si32.si_code = si->si_code;
524 si32.si_pid = si->si_pid;
525 si32.si_uid = si->si_uid;
526 si32.si_status = si->si_status;
527 si32.si_addr = (uintptr_t) si->si_addr;
532#if _BYTE_ORDER == _BIG_ENDIAN
533 if (si->si_value.sival_int == 0)
534 si32.si_value.sival_ptr = (uintptr_t) si->si_value.sival_ptr;
536 si32.si_value.sival_int = si->si_value.sival_int;
538 si32.si_value.sival_int = si->si_value.sival_int;
543 si32._reason.__spare__.__spare1__ = si->_reason.__spare__.__spare1__;
544 for (
int i = 0; i < 7; i++)
545 si32._reason.__spare__.__spare2__[i] = si->_reason.__spare__.__spare2__[i];
546 switch (si->si_signo) {
551 si32.si_trapno = si->si_trapno;
554 switch (si->si_code) {
556 si32.si_timerid = si->si_timerid;
557 si32.si_overrun = si->si_overrun;
560 si32.si_mqd = si->si_mqd;
564 memcpy(si, &si32,
sizeof (si32));
572 const char *annex, gdb_byte *readbuf,
573 const gdb_byte *writebuf,
574 ULONGEST offset, ULONGEST len,
575 ULONGEST *xfered_len)
583 struct ptrace_lwpinfo pl;
587 if (writebuf != NULL)
594 if (offset > siginfo_size)
604 if (offset + len > siginfo_size)
605 len = siginfo_size - offset;
607 memcpy (readbuf, ((gdb_byte *) &pl.pl_siginfo) + offset, len);
614 gdb::byte_vector buf_storage;
619 if (writebuf != NULL)
623 mib[2] = KERN_PROC_AUXV;
632 buflen = offset + len;
633 buf_storage.resize (buflen);
634 buf = buf_storage.data ();
636 if (sysctl (mib, 4, buf, &buflen, NULL, 0) == 0)
643 memcpy (readbuf, buf + offset, buflen);
648 *xfered_len = buflen;
654#if defined(KERN_PROC_VMMAP) && defined(KERN_PROC_PS_STRINGS)
658 gdb::byte_vector buf_storage;
664 uint32_t struct_size;
668 proc_target = KERN_PROC_VMMAP;
669 struct_size =
sizeof (
struct kinfo_vmentry);
672 proc_target = KERN_PROC_PS_STRINGS;
673 struct_size =
sizeof (
void *);
677 if (writebuf != NULL)
682 mib[2] = proc_target;
685 if (sysctl (mib, 4, NULL, &buflen, NULL, 0) != 0)
687 buflen +=
sizeof (struct_size);
689 if (offset >= buflen)
695 buf_storage.resize (buflen);
696 buf = buf_storage.data ();
698 memcpy (buf, &struct_size,
sizeof (struct_size));
699 buflen -=
sizeof (struct_size);
700 if (sysctl (mib, 4, buf +
sizeof (struct_size), &buflen, NULL, 0) != 0)
702 buflen +=
sizeof (struct_size);
704 if (buflen - offset < len)
705 len = buflen - offset;
706 memcpy (readbuf, buf + offset, len);
713 readbuf, writebuf, offset,
725 gdb_printf (file, _(
"Debugging of FreeBSD lwp module is %s.\n"),
value);
732 gdb_printf (file, _(
"Debugging of FreeBSD native target is %s.\n"),
736#define fbsd_lwp_debug_printf(fmt, ...) \
737 debug_prefixed_printf_cond (debug_fbsd_lwp, "fbsd-lwp", fmt, ##__VA_ARGS__)
739#define fbsd_nat_debug_printf(fmt, ...) \
740 debug_prefixed_printf_cond (debug_fbsd_nat, "fbsd-nat", fmt, ##__VA_ARGS__)
777 struct ptrace_lwpinfo pl;
779 if (
ptrace (PT_LWPINFO, ptid.lwp (), (caddr_t) &pl,
sizeof pl)
783 if (pl.pl_flags & PL_FLAG_EXITED)
801 int pid = ptid.pid ();
803 return string_printf (
"LWP %d of process %d", lwp,
pid);
809#ifdef HAVE_STRUCT_PTRACE_LWPINFO_PL_TDNAME
816 struct ptrace_lwpinfo pl;
817 struct kinfo_proc kp;
819 long lwp = thr->
ptid.lwp ();
820 static char buf[
sizeof pl.pl_tdname + 1];
827 if (
ptrace (PT_LWPINFO, lwp, (caddr_t) &pl,
sizeof pl) == -1)
829 if (strcmp (kp.ki_comm, pl.pl_tdname) == 0)
831 xsnprintf (buf,
sizeof buf,
"%s", pl.pl_tdname);
852#ifdef PT_GET_EVENT_MASK
856 sizeof (events)) == -1)
858 events |= PTRACE_FORK | PTRACE_LWP;
860 events |= PTRACE_VFORK;
863 sizeof (events)) == -1)
889 nlwps =
ptrace (PT_GETNUMLWPS,
pid, NULL, 0);
893 gdb::unique_xmalloc_ptr<lwpid_t[]> lwps (XCNEWVEC (lwpid_t, nlwps));
895 nlwps =
ptrace (PT_GETLWPLIST,
pid, (caddr_t) lwps.get (), nlwps);
899 for (i = 0; i < nlwps; i++)
901 ptid_t ptid = ptid_t (
pid, lwps[i]);
906 struct ptrace_lwpinfo pl;
910 if (
ptrace (PT_LWPINFO, lwps[i], (caddr_t) &pl,
sizeof pl) == -1)
912 if (pl.pl_flags & PL_FLAG_EXITED)
956 int old_errno = errno;
981 gdb::block_signals blocker;
986 internal_error (
"failed to create event pipe.");
1035static std::list<ptid_t> fbsd_pending_children;
1041fbsd_remember_child (ptid_t
pid)
1043 fbsd_pending_children.push_front (
pid);
1050fbsd_is_child_pending (pid_t
pid)
1052 for (
auto it = fbsd_pending_children.begin ();
1053 it != fbsd_pending_children.end (); it++)
1054 if (it->pid () ==
pid)
1057 fbsd_pending_children.erase (it);
1064static std::forward_list<ptid_t> fbsd_pending_vfork_done;
1069fbsd_add_vfork_done (ptid_t
pid)
1071 fbsd_pending_vfork_done.push_front (
pid);
1082fbsd_is_vfork_done_pending (pid_t
pid)
1084 for (
auto it = fbsd_pending_vfork_done.begin ();
1085 it != fbsd_pending_vfork_done.end (); it++)
1086 if (it->pid () ==
pid)
1095fbsd_next_vfork_done (
void)
1097 if (!fbsd_pending_vfork_done.empty ())
1099 ptid_t ptid = fbsd_pending_vfork_done.front ();
1100 fbsd_pending_vfork_done.pop_front ();
1113#if defined(TDP_RFPPWAIT) && !defined(PTRACE_VFORK)
1117 if (minus_one_ptid == ptid)
1121 if (fbsd_is_vfork_done_pending (
pid))
1127 gdb_signal_to_name (signo));
1137 if (tp->ptid.lwp () == ptid.lwp ())
1138 request = PT_RESUME;
1140 request = PT_SUSPEND;
1142 if (
ptrace (request, tp->ptid.lwp (), NULL, 0) == -1)
1144 (
"ptrace (PT_RESUME)") :
1145 (
"ptrace (PT_SUSPEND)"));
1146 if (request == PT_RESUME)
1156 if (
ptrace (PT_RESUME, tp->ptid.lwp (), NULL, 0) == -1)
1163#if __FreeBSD_version < 1200052
1192 ptid = ptid_t (ptid.pid ());
1197#ifdef USE_SIGTRAP_SIGINFO
1204 const struct ptrace_lwpinfo &pl)
1215 if (pl.pl_flags !=
PL_FLAG_SI || pl.pl_siginfo.si_signo != SIGTRAP)
1220 if (pl.pl_siginfo.si_code == TRAP_TRACE)
1226 if (pl.pl_siginfo.si_code == TRAP_BRKPT)
1254 target_wait_flags target_options)
1261 wptid = fbsd_next_vfork_done ();
1262 if (wptid != null_ptid)
1271 struct ptrace_lwpinfo pl;
1276 if (
ptrace (PT_LWPINFO,
pid, (caddr_t) &pl,
sizeof pl) == -1)
1279 wptid = ptid_t (
pid, pl.pl_lwpid);
1284 pl.pl_lwpid, pl.pl_event, pl.pl_flags);
1287 pl.pl_siginfo.si_signo,
1288 pl.pl_siginfo.si_code);
1292 if (pl.pl_flags & PL_FLAG_EXITED)
1329 if (pl.pl_flags & PL_FLAG_BORN)
1347 if (pl.pl_flags & PL_FLAG_FORKED)
1350 struct kinfo_proc kp;
1352 bool is_vfork =
false;
1356 child = pl.pl_child_pid;
1358 if (pl.pl_flags & PL_FLAG_VFORKED)
1363 child_ptid = fbsd_is_child_pending (child);
1364 if (child_ptid == null_ptid)
1370 gdb_assert (
pid == child);
1372 if (
ptrace (PT_LWPINFO, child, (caddr_t)&pl,
sizeof pl) == -1)
1375 gdb_assert (pl.pl_flags & PL_FLAG_CHILD);
1376 child_ptid = ptid_t (child, pl.pl_lwpid);
1387 if (kp.ki_flag & P_PPWAIT)
1391 warning (_(
"Failed to fetch process information"));
1404 if (pl.pl_flags & PL_FLAG_CHILD)
1409 fbsd_remember_child (wptid);
1414 if (pl.pl_flags & PL_FLAG_VFORK_DONE)
1422 if (pl.pl_flags & PL_FLAG_EXEC)
1429#ifdef USE_SIGTRAP_SIGINFO
1430 if (fbsd_handle_debug_trap (
this, wptid, pl))
1441 if (pl.pl_flags & (PL_FLAG_SCE | PL_FLAG_SCX)
1442 && ourstatus->
sig () == SIGTRAP)
1444#ifdef HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE
1449 if (pl.pl_flags & PL_FLAG_SCE)
1474 target_wait_flags target_options)
1485 wptid =
wait_1 (ptid, ourstatus, target_options);
1493 || ptid != minus_one_ptid))
1502#ifdef USE_SIGTRAP_SIGINFO
1508 struct ptrace_lwpinfo pl;
1515 && pl.pl_siginfo.si_signo == SIGTRAP
1516 && pl.pl_siginfo.si_code == TRAP_BRKPT);
1537 if (procctl (P_PID, getpid (), PROC_ASLR_STATUS, &m_aslr_ctl) == -1)
1539 warning (_(
"Failed to fetch current address space randomization "
1540 "status: %s"), safe_strerror (errno));
1544 m_aslr_ctl &= ~PROC_ASLR_ACTIVE;
1545 if (m_aslr_ctl == PROC_ASLR_FORCE_DISABLE)
1548 int ctl = PROC_ASLR_FORCE_DISABLE;
1549 if (procctl (P_PID, getpid (), PROC_ASLR_CTL, &ctl) == -1)
1551 warning (_(
"Error disabling address space randomization: %s"),
1552 safe_strerror (errno));
1556 m_aslr_ctl_set =
true;
1564 if (procctl (P_PID, getpid (), PROC_ASLR_CTL, &m_aslr_ctl) == -1)
1565 warning (_(
"Error restoring address space randomization: %s"),
1566 safe_strerror (errno));
1573 bool m_aslr_ctl_set =
false;
1580 const std::string &allargs,
1581 char **env,
int from_tty)
1605 pid_t child_pid = child_ptid.pid ();
1700#ifdef HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE
1704 gdb::array_view<const int> syscall_counts)
1735 int regbase,
void *regs,
size_t size)
1758 int fetch_op,
int store_op,
1760 void *regs,
size_t size)
1790 iov.iov_base =
nullptr;
1802 void *regs,
size_t size)
1814 iov.iov_base = regs;
1828 void *regs,
size_t size)
1840 iov.iov_base = regs;
1859 struct ptrace_lwpinfo pl;
1862 if (
ptrace (PT_LWPINFO,
pid, (caddr_t) &pl,
sizeof pl) == -1)
1866 *siginfo = pl.pl_siginfo;
1876Set debugging of FreeBSD lwp module."), _(
"\
1877Show debugging of FreeBSD lwp module."), _(
"\
1878Enables printf debugging output."),
1884Set debugging of FreeBSD native target."), _(
"\
1885Show debugging of FreeBSD native target."), _(
"\
1886Enables printf debugging output."),
struct gdbarch * target_gdbarch(void)
int catch_syscall_enabled(void)
bool catching_syscall_number(int syscall_number)
bool can_async_p() override
size_t have_regset(ptid_t ptid, int note)
int find_memory_regions(find_memory_region_ftype func, void *data) override
bool store_regset(struct regcache *regcache, int regnum, int note, const struct regset *regset, int regbase, void *regs, size_t size)
bool fetch_register_set(struct regcache *regcache, int regnum, int fetch_op, const struct regset *regset, int regbase, void *regs, size_t size)
enum target_xfer_status xfer_partial(enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len) override
int remove_exec_catchpoint(int) override
bool store_register_set(struct regcache *regcache, int regnum, int fetch_op, int store_op, const struct regset *regset, int regbase, void *regs, size_t size)
int insert_exec_catchpoint(int) override
std::string pid_to_str(ptid_t) override
bool supports_multi_process() override
void create_inferior(const char *, const std::string &, char **, int) override
void async(bool) override
bool supports_disable_randomization() override
virtual void low_new_fork(ptid_t parent, pid_t child)
void update_thread_list() override
void post_startup_inferior(ptid_t) override
bool info_proc(const char *, enum info_proc_what) override
bool thread_alive(ptid_t ptid) override
const char * pid_to_exec_file(int pid) override
virtual void low_delete_thread(thread_info *)
bool fetch_regset(struct regcache *regcache, int regnum, int note, const struct regset *regset, int regbase, void *regs, size_t size)
virtual void low_prepare_to_resume(thread_info *)
ptid_t wait(ptid_t, struct target_waitstatus *, target_wait_flags) override
ptid_t wait_1(ptid_t, struct target_waitstatus *, target_wait_flags)
void resume(ptid_t, int, enum gdb_signal) override
void post_attach(int) override
DISABLE_COPY_AND_ASSIGN(maybe_disable_address_space_randomization)
~maybe_disable_address_space_randomization()
void follow_fork(inferior *child_inf, ptid_t child_ptid, target_waitkind fork_kind, bool follow_child, bool detach_on_fork) override
process_stratum_target * target() const
struct cmd_list_element * showdebuglist
struct cmd_list_element * setdebuglist
set_show_commands add_setshow_boolean_cmd(const char *name, enum command_class theclass, bool *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
int(* find_memory_region_ftype)(CORE_ADDR addr, unsigned long size, int read, int write, int exec, int modified, bool memory_tagged, void *data)
#define fbsd_lwp_debug_printf(fmt,...)
static gdb::unique_xmalloc_ptr< char > fbsd_fetch_cmdline(pid_t pid)
static void show_fbsd_nat_debug(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void sigchld_handler(int signo)
#define fbsd_nat_debug_printf(fmt,...)
void _initialize_fbsd_nat()
static bool fbsd_fetch_kinfo_proc(pid_t pid, struct kinfo_proc *kp)
static void fbsd_add_threads(fbsd_nat_target *target, pid_t pid)
static size_t fbsd_siginfo_size()
static bool debug_fbsd_nat
static void handle_target_event(int error, gdb_client_data client_data)
static void fbsd_enable_proc_events(pid_t pid)
static void show_fbsd_lwp_debug(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
bool fbsd_nat_get_siginfo(ptid_t ptid, siginfo_t *siginfo)
static void fbsd_convert_siginfo(siginfo_t *si)
static bool debug_fbsd_lwp
void fbsd_info_proc_files_entry(int kf_type, int kf_fd, int kf_flags, LONGEST kf_offset, int kf_vnode_type, int kf_sock_domain, int kf_sock_type, int kf_sock_protocol, const void *kf_sa_local, const void *kf_sa_peer, const void *kf_path)
void fbsd_info_proc_mappings_entry(int addr_bit, ULONGEST kve_start, ULONGEST kve_end, ULONGEST kve_offset, int kve_flags, int kve_protection, const void *kve_path)
void fbsd_info_proc_mappings_header(int addr_bit)
void fbsd_info_proc_files_header()
struct gdbarch * get_frame_arch(frame_info_ptr this_frame)
frame_info_ptr get_current_frame(void)
#define ptrace(request, pid, addr, data)
CORE_ADDR gdbarch_decr_pc_after_break(struct gdbarch *gdbarch)
int gdbarch_long_bit(struct gdbarch *gdbarch)
struct thread_info * add_thread(process_stratum_target *targ, ptid_t ptid)
thread_info * find_thread_ptid(inferior *inf, ptid_t ptid)
all_non_exited_threads_range all_non_exited_threads(process_stratum_target *proc_target=nullptr, ptid_t filter_ptid=minus_one_ptid)
void delete_thread(struct thread_info *thread)
void thread_change_ptid(process_stratum_target *targ, ptid_t old_ptid, ptid_t new_ptid)
bool in_thread_list(process_stratum_target *targ, ptid_t ptid)
void delete_exited_threads(void)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int int rusage_t pid_t pid
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int status
void inferior_event_handler(enum inferior_event_type event_type)
pid_t get_ptrace_pid(ptid_t ptid)
struct inferior * find_inferior_ptid(process_stratum_target *targ, ptid_t ptid)
bool disable_randomization
CORE_ADDR regcache_read_pc(struct regcache *regcache)
bool regcache_map_supplies(const struct regcache_map_entry *map, int regnum, struct gdbarch *gdbarch, size_t size)
void regcache_write_pc(struct regcache *regcache, CORE_ADDR pc)
struct regcache * get_thread_regcache(process_stratum_target *target, ptid_t ptid)
void(* func)(remote_target *remote, char *)
void create_inferior(const char *, const std::string &, char **, int) override
int async_wait_fd() override
bool is_async_p() override
void resume(ptid_t, int, enum gdb_signal) override
static void async_file_mark_if_open()
enum target_xfer_status xfer_partial(enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len) override
ptid_t wait(ptid_t, struct target_waitstatus *, target_wait_flags) override
collect_regset_ftype * collect_regset
supply_regset_ftype * supply_regset
virtual bool stopped_by_sw_breakpoint() TARGET_DEFAULT_RETURN(false)
virtual int insert_fork_catchpoint(int) TARGET_DEFAULT_RETURN(1)
virtual bool supports_stopped_by_sw_breakpoint() TARGET_DEFAULT_RETURN(false)
virtual const char * thread_name(thread_info *) TARGET_DEFAULT_RETURN(NULL)
virtual int insert_vfork_catchpoint(int) TARGET_DEFAULT_RETURN(1)
virtual int remove_fork_catchpoint(int) TARGET_DEFAULT_RETURN(1)
virtual int remove_vfork_catchpoint(int) TARGET_DEFAULT_RETURN(1)
virtual int set_syscall_catchpoint(int, bool, int, gdb::array_view< const int >) TARGET_DEFAULT_RETURN(1)
target_waitstatus & set_spurious()
target_waitstatus & set_syscall_return(int syscall_number)
target_waitstatus & set_vfork_done()
target_waitstatus & set_forked(ptid_t child_ptid)
target_waitstatus & set_execd(gdb::unique_xmalloc_ptr< char > execd_pathname)
target_waitstatus & set_vforked(ptid_t child_ptid)
target_waitstatus & set_syscall_entry(int syscall_number)
target_waitkind kind() const
std::string to_string() const
bool target_async_permitted
std::string target_options_to_string(target_wait_flags target_options)
std::string target_pid_to_str(ptid_t ptid)
std::string normal_pid_to_str(ptid_t ptid)
@ TARGET_OBJECT_FREEBSD_PS_STRINGS
@ TARGET_OBJECT_SIGNAL_INFO
@ TARGET_OBJECT_FREEBSD_VMMAP
void perror_with_name(const char *string)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
void gdb_printf(struct ui_file *stream, const char *format,...)
@ TARGET_WAITKIND_NO_RESUMED
@ TARGET_WAITKIND_VFORK_DONE
@ TARGET_WAITKIND_STOPPED
@ TARGET_WAITKIND_VFORKED