/* Native-dependent code for FreeBSD.
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
This file is part of GDB.
#ifdef PT_GET_EVENT_MASK
int events;
- if (ptrace (PT_GET_EVENT_MASK, pid, (PTRACE_TYPE_ARG3)&events,
+ if (ptrace (PT_GET_EVENT_MASK, pid, (PTRACE_TYPE_ARG3) &events,
sizeof (events)) == -1)
perror_with_name (("ptrace (PT_GET_EVENT_MASK)"));
events |= PTRACE_FORK | PTRACE_LWP;
#ifdef PTRACE_VFORK
events |= PTRACE_VFORK;
#endif
- if (ptrace (PT_SET_EVENT_MASK, pid, (PTRACE_TYPE_ARG3)&events,
+ if (ptrace (PT_SET_EVENT_MASK, pid, (PTRACE_TYPE_ARG3) &events,
sizeof (events)) == -1)
perror_with_name (("ptrace (PT_SET_EVENT_MASK)"));
#else
#ifdef TDP_RFPPWAIT
- if (ptrace (PT_FOLLOW_FORK, pid, (PTRACE_TYPE_ARG3)0, 1) == -1)
+ if (ptrace (PT_FOLLOW_FORK, pid, (PTRACE_TYPE_ARG3) 0, 1) == -1)
perror_with_name (("ptrace (PT_FOLLOW_FORK)"));
#endif
#ifdef PT_LWP_EVENTS
- if (ptrace (PT_LWP_EVENTS, pid, (PTRACE_TYPE_ARG3)0, 1) == -1)
+ if (ptrace (PT_LWP_EVENTS, pid, (PTRACE_TYPE_ARG3) 0, 1) == -1)
perror_with_name (("ptrace (PT_LWP_EVENTS)"));
#endif
#endif
wptid = fbsd_next_vfork_done ();
if (wptid != null_ptid)
{
- ourstatus->kind = TARGET_WAITKIND_VFORK_DONE;
+ ourstatus->set_vfork_done ();
return wptid;
}
#endif
threads might be skipped during post_attach that
have not yet reported their PL_FLAG_EXITED event.
Ignore EXITED events for an unknown LWP. */
- thread_info *thr = find_thread_ptid (this, wptid);
+ thread_info *thr = this->find_thread (wptid);
if (thr != nullptr)
{
fbsd_lwp_debug_printf ("deleting thread for LWP %u",
gdb_assert (pid == child);
- if (ptrace (PT_LWPINFO, child, (caddr_t)&pl, sizeof pl) == -1)
+ if (ptrace (PT_LWPINFO, child, (caddr_t) &pl, sizeof pl) == -1)
perror_with_name (("ptrace (PT_LWPINFO)"));
gdb_assert (pl.pl_flags & PL_FLAG_CHILD);
SIGTRAP, so only treat SIGTRAP events as system call
entry/exit events. */
if (pl.pl_flags & (PL_FLAG_SCE | PL_FLAG_SCX)
- && ourstatus->sig () == SIGTRAP)
+ && ourstatus->sig () == GDB_SIGNAL_TRAP)
{
#ifdef HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE
if (catch_syscall_enabled ())
event loop keeps polling until no event is returned. */
if (is_async_p ()
&& ((ourstatus->kind () != TARGET_WAITKIND_IGNORE
- && ourstatus->kind() != TARGET_WAITKIND_NO_RESUMED)
+ && ourstatus->kind () != TARGET_WAITKIND_NO_RESUMED)
|| ptid != minus_one_ptid))
async_file_mark ();
/* Breakpoints have already been detached from the child by
infrun.c. */
- if (ptrace (PT_DETACH, child_pid, (PTRACE_TYPE_ARG3)1, 0) == -1)
+ if (ptrace (PT_DETACH, child_pid, (PTRACE_TYPE_ARG3) 1, 0) == -1)
perror_with_name (("ptrace (PT_DETACH)"));
#ifndef PTRACE_VFORK
if (regnum == -1
|| (regnum >= regbase && regcache_map_supplies (map, regnum - regbase,
- regcache->arch(), size)))
+ regcache->arch (), size)))
{
if (ptrace (fetch_op, pid, (PTRACE_TYPE_ARG3) regs, 0) == -1)
perror_with_name (_("Couldn't get registers"));
if (regnum == -1
|| (regnum >= regbase && regcache_map_supplies (map, regnum - regbase,
- regcache->arch(), size)))
+ regcache->arch (), size)))
{
if (ptrace (fetch_op, pid, (PTRACE_TYPE_ARG3) regs, 0) == -1)
perror_with_name (_("Couldn't get registers"));
if (regnum == -1
|| (regnum >= regbase && regcache_map_supplies (map, regnum - regbase,
- regcache->arch(), size)))
+ regcache->arch (), size)))
{
struct iovec iov;
if (regnum == -1
|| (regnum >= regbase && regcache_map_supplies (map, regnum - regbase,
- regcache->arch(), size)))
+ regcache->arch (), size)))
{
struct iovec iov;