OSDN Git Service

Add support for the Linux NPTL (New POSIX Thread Library) thread
[pf3gnuchains/pf3gnuchains3x.git] / rda / unix / lwp-ctrl.h
1 /* lwp-ctrl.h --- interface to functions for controlling LWP's
2
3    Copyright 2004 Red Hat, Inc.
4
5    This file is part of RDA, the Red Hat Debug Agent (and library).
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
9    the Free Software Foundation; either version 2 of the License, or
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
18    along with this program; if not, write to the Free Software
19    Foundation, Inc., 59 Temple Place - Suite 330,
20    Boston, MA 02111-1307, USA.
21    
22    Alternative licenses for RDA may be arranged by contacting Red Hat,
23    Inc.  */
24
25 #ifndef RDA_UNIX_LWP_CTRL_H
26 #define RDA_UNIX_LWP_CTRL_H
27
28 #include <sys/types.h>
29
30 struct gdbserv;
31
32 /* Do a PTRACE_ATTACH on LWP.  Do not wait for the resulting wait
33    status.  On success, return zero; on failure, print a message, set
34    errno, and return -1.  */
35 int attach_lwp (pid_t lwp);
36
37 /* Singlestep the stopped lwp LWP, which is managed by SERV.  If LWP
38    successfully completes the next instruction, it will receive a
39    SIGTRAP signal.  If SIGNAL is non-zero, send it to LWP.  Do not
40    wait for the resulting wait status.  On success, return zero; on
41    failure, print a message, set errno, and return -1.  */
42 int singlestep_lwp (struct gdbserv *serv, pid_t lwp, int signal);
43
44 /* Continue the stopped lwp LWP.  If SIGNAL is non-zero, send it to
45    LWP.  Do not wait for the resulting wait status.  On success,
46    return zero; on failure, print a message, set errno, and return
47    -1.  */
48 int continue_lwp (pid_t lwp, int signal);
49
50 /* Send LWP the signal SIGNAL.  Do not wait for the resulting wait
51    status.  On success, return zero; on failure, print a message, set
52    errno, and return -1.  
53
54    If possible, this uses the 'tkill' system call to ensure the signal
55    is sent to that exact LWP, and not distributed to whatever thread
56    in the process is ready to handle it (as POSIX says ordinary 'kill'
57    must do).  */
58 int kill_lwp (pid_t lwp, int signal);
59
60
61 #endif /* RDA_UNIX_LWP_CTRL_H */