]>
Commit | Line | Data |
---|---|---|
0274a8ce | 1 | /* Native debugging support for GNU/Linux (LWP layer). |
10d6c8cd | 2 | |
6aba47ca | 3 | Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 |
10d6c8cd | 4 | Free Software Foundation, Inc. |
0274a8ce MS |
5 | |
6 | This file is part of GDB. | |
7 | ||
8 | This program is free software; you can redistribute it and/or modify | |
9 | it under the terms of the GNU General Public License as published by | |
a9762ec7 | 10 | the Free Software Foundation; either version 3 of the License, or |
0274a8ce MS |
11 | (at your option) any later version. |
12 | ||
13 | This program is distributed in the hope that it will be useful, | |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | GNU General Public License for more details. | |
17 | ||
18 | You should have received a copy of the GNU General Public License | |
a9762ec7 | 19 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
0274a8ce | 20 | |
a2f23071 DJ |
21 | #include "target.h" |
22 | ||
0274a8ce MS |
23 | /* Structure describing an LWP. */ |
24 | ||
25 | struct lwp_info | |
26 | { | |
27 | /* The process id of the LWP. This is a combination of the LWP id | |
28 | and overall process id. */ | |
29 | ptid_t ptid; | |
30 | ||
31 | /* Non-zero if this LWP is cloned. In this context "cloned" means | |
32 | that the LWP is reporting to its parent using a signal other than | |
33 | SIGCHLD. */ | |
34 | int cloned; | |
35 | ||
36 | /* Non-zero if we sent this LWP a SIGSTOP (but the LWP didn't report | |
37 | it back yet). */ | |
38 | int signalled; | |
39 | ||
40 | /* Non-zero if this LWP is stopped. */ | |
41 | int stopped; | |
42 | ||
43 | /* Non-zero if this LWP will be/has been resumed. Note that an LWP | |
44 | can be marked both as stopped and resumed at the same time. This | |
45 | happens if we try to resume an LWP that has a wait status | |
46 | pending. We shouldn't let the LWP run until that wait status has | |
47 | been processed, but we should not report that wait status if GDB | |
48 | didn't try to let the LWP run. */ | |
49 | int resumed; | |
50 | ||
51 | /* If non-zero, a pending wait status. */ | |
52 | int status; | |
53 | ||
54 | /* Non-zero if we were stepping this LWP. */ | |
55 | int step; | |
56 | ||
a2f23071 DJ |
57 | /* If WAITSTATUS->KIND != TARGET_WAITKIND_SPURIOUS, the waitstatus |
58 | for this LWP's last event. This may correspond to STATUS above, | |
59 | or to a local variable in lin_lwp_wait. */ | |
60 | struct target_waitstatus waitstatus; | |
61 | ||
0274a8ce MS |
62 | /* Next LWP in list. */ |
63 | struct lwp_info *next; | |
64 | }; | |
65 | ||
0ec9a092 DJ |
66 | /* Attempt to initialize libthread_db. */ |
67 | void check_for_thread_db (void); | |
0274a8ce | 68 | |
83eba059 DJ |
69 | /* Tell the thread_db layer what native target operations to use. */ |
70 | void thread_db_init (struct target_ops *); | |
71 | ||
bfb39158 DJ |
72 | /* Find process PID's pending signal set from /proc/pid/status. */ |
73 | void linux_proc_pending_signals (int pid, sigset_t *pending, sigset_t *blocked, sigset_t *ignored); | |
74 | ||
4de4c07c | 75 | /* linux-nat functions for handling fork events. */ |
4de4c07c | 76 | extern void linux_enable_event_reporting (ptid_t ptid); |
0274a8ce | 77 | |
9ee57c33 DJ |
78 | extern int lin_lwp_attach_lwp (ptid_t ptid, int verbose); |
79 | ||
0274a8ce MS |
80 | /* Iterator function for lin-lwp's lwp list. */ |
81 | struct lwp_info *iterate_over_lwps (int (*callback) (struct lwp_info *, | |
82 | void *), | |
83 | void *data); | |
10d6c8cd | 84 | |
155bd5d1 AC |
85 | /* Create a prototype generic GNU/Linux target. The client can |
86 | override it with local methods. */ | |
10d6c8cd | 87 | struct target_ops * linux_target (void); |
f973ed9c | 88 | |
910122bf UW |
89 | /* Create a generic GNU/Linux target using traditional |
90 | ptrace register access. */ | |
91 | struct target_ops * | |
7714d83a | 92 | linux_trad_target (CORE_ADDR (*register_u_offset)(struct gdbarch *, int, int)); |
910122bf | 93 | |
155bd5d1 | 94 | /* Register the customized GNU/Linux target. This should be used |
f973ed9c DJ |
95 | instead of calling add_target directly. */ |
96 | void linux_nat_add_target (struct target_ops *); | |
97 | ||
98 | /* Update linux-nat internal state when changing from one fork | |
99 | to another. */ | |
100 | void linux_nat_switch_fork (ptid_t new_ptid); |