Commit | Line | Data |
---|---|---|
578c1c03 MK |
1 | /* Native-dependent code for FreeBSD. |
2 | ||
42a4f53d | 3 | Copyright (C) 2004-2019 Free Software Foundation, Inc. |
578c1c03 MK |
4 | |
5 | This file is part of GDB. | |
6 | ||
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 | |
a9762ec7 | 9 | the Free Software Foundation; either version 3 of the License, or |
578c1c03 MK |
10 | (at your option) any later version. |
11 | ||
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. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
a9762ec7 | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
578c1c03 MK |
19 | |
20 | #ifndef FBSD_NAT_H | |
21 | #define FBSD_NAT_H | |
22 | ||
f8eb6a9e | 23 | #include <sys/proc.h> |
f6ac5f3d | 24 | |
d55e5aa6 TT |
25 | /* Local non-gdb includes. */ |
26 | #include "inf-ptrace.h" | |
27 | ||
f6ac5f3d PA |
28 | #ifdef TRAP_BRKPT |
29 | /* MIPS does not set si_code for SIGTRAP. sparc64 reports | |
30 | non-standard values in si_code for SIGTRAP. */ | |
31 | # if !defined(__mips__) && !defined(__sparc64__) | |
32 | # define USE_SIGTRAP_SIGINFO | |
33 | # endif | |
34 | #endif | |
35 | ||
36 | /* A prototype FreeBSD target. */ | |
37 | ||
38 | class fbsd_nat_target : public inf_ptrace_target | |
39 | { | |
40 | public: | |
41 | char *pid_to_exec_file (int pid) override; | |
42 | ||
bd583225 | 43 | int find_memory_regions (find_memory_region_ftype func, void *data) override; |
f6ac5f3d | 44 | |
bd583225 | 45 | bool info_proc (const char *, enum info_proc_what) override; |
f6ac5f3d | 46 | |
f6ac5f3d PA |
47 | enum target_xfer_status xfer_partial (enum target_object object, |
48 | const char *annex, | |
49 | gdb_byte *readbuf, | |
50 | const gdb_byte *writebuf, | |
51 | ULONGEST offset, ULONGEST len, | |
52 | ULONGEST *xfered_len) override; | |
f6ac5f3d PA |
53 | |
54 | #ifdef PT_LWPINFO | |
57810aa7 | 55 | bool thread_alive (ptid_t ptid) override; |
a068643d | 56 | std::string pid_to_str (ptid_t) override; |
f6ac5f3d PA |
57 | |
58 | #ifdef HAVE_STRUCT_PTRACE_LWPINFO_PL_TDNAME | |
59 | const char *thread_name (struct thread_info *) override; | |
60 | #endif | |
61 | ||
62 | void update_thread_list () override; | |
63 | ||
64 | thread_control_capabilities get_thread_control_capabilities () override | |
65 | { return tc_schedlock; } | |
66 | ||
67 | void resume (ptid_t, int, enum gdb_signal) override; | |
68 | ||
69 | ptid_t wait (ptid_t, struct target_waitstatus *, int) override; | |
70 | ||
71 | void post_startup_inferior (ptid_t) override; | |
72 | void post_attach (int) override; | |
73 | ||
74 | #ifdef USE_SIGTRAP_SIGINFO | |
57810aa7 PA |
75 | bool supports_stopped_by_sw_breakpoint () override; |
76 | bool stopped_by_sw_breakpoint () override; | |
f6ac5f3d PA |
77 | #endif |
78 | ||
79 | #ifdef TDP_RFPPWAIT | |
80 | int follow_fork (int, int) override; | |
81 | ||
82 | int insert_fork_catchpoint (int) override; | |
83 | int remove_fork_catchpoint (int) override; | |
84 | ||
85 | int insert_vfork_catchpoint (int) override; | |
86 | int remove_vfork_catchpoint (int) override; | |
87 | #endif | |
88 | ||
89 | #ifdef PL_FLAG_EXEC | |
90 | int insert_exec_catchpoint (int) override; | |
91 | int remove_exec_catchpoint (int) override; | |
92 | #endif | |
93 | ||
94 | #ifdef HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE | |
95 | int set_syscall_catchpoint (int, bool, int, gdb::array_view<const int>) | |
96 | override; | |
97 | #endif | |
98 | #endif /* PT_LWPINFO */ | |
99 | }; | |
578c1c03 | 100 | |
578c1c03 | 101 | #endif /* fbsd-nat.h */ |