1 /* Native-dependent code for FreeBSD.
3 Copyright (C) 2004-2018 Free Software Foundation, Inc.
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
23 #include "inf-ptrace.h"
26 /* MIPS does not set si_code for SIGTRAP. sparc64 reports
27 non-standard values in si_code for SIGTRAP. */
28 # if !defined(__mips__) && !defined(__sparc64__)
29 # define USE_SIGTRAP_SIGINFO
33 /* A prototype FreeBSD target. */
35 class fbsd_nat_target
: public inf_ptrace_target
38 char *pid_to_exec_file (int pid
) override
;
40 int find_memory_regions (find_memory_region_ftype func
, void *data
) override
;
42 bool info_proc (const char *, enum info_proc_what
) override
;
45 enum target_xfer_status
xfer_partial (enum target_object object
,
48 const gdb_byte
*writebuf
,
49 ULONGEST offset
, ULONGEST len
,
50 ULONGEST
*xfered_len
) override
;
54 bool thread_alive (ptid_t ptid
) override
;
55 const char *pid_to_str (ptid_t
) override
;
57 #ifdef HAVE_STRUCT_PTRACE_LWPINFO_PL_TDNAME
58 const char *thread_name (struct thread_info
*) override
;
61 void update_thread_list () override
;
63 thread_control_capabilities
get_thread_control_capabilities () override
64 { return tc_schedlock
; }
66 void resume (ptid_t
, int, enum gdb_signal
) override
;
68 ptid_t
wait (ptid_t
, struct target_waitstatus
*, int) override
;
70 void post_startup_inferior (ptid_t
) override
;
71 void post_attach (int) override
;
73 #ifdef USE_SIGTRAP_SIGINFO
74 bool supports_stopped_by_sw_breakpoint () override
;
75 bool stopped_by_sw_breakpoint () override
;
79 int follow_fork (int, int) override
;
81 int insert_fork_catchpoint (int) override
;
82 int remove_fork_catchpoint (int) override
;
84 int insert_vfork_catchpoint (int) override
;
85 int remove_vfork_catchpoint (int) override
;
89 int insert_exec_catchpoint (int) override
;
90 int remove_exec_catchpoint (int) override
;
93 #ifdef HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE
94 int set_syscall_catchpoint (int, bool, int, gdb::array_view
<const int>)
97 #endif /* PT_LWPINFO */
100 #endif /* fbsd-nat.h */