source: mainline/abi/include/udebug.h@ 3322d95

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 3322d95 was c0699467, checked in by Martin Decky <martin@…>, 14 years ago

do not provide general access to kernel headers from uspace, only allow specific headers to be accessed or shared
externalize headers which serve as kernel/uspace API/ABI into a special tree

  • Property mode set to 100644
File size: 5.5 KB
Line 
1/*
2 * Copyright (c) 2008 Jiri Svoboda
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * - Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * - The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29/** @addtogroup generic
30 * @{
31 */
32/** @file
33 */
34
35#ifndef ABI_UDEBUG_H_
36#define ABI_UDEBUG_H_
37
38#define UDEBUG_EVMASK(event) (1 << ((event) - 1))
39
40typedef enum { /* udebug_method_t */
41
42 /** Start debugging the recipient.
43 *
44 * Causes all threads in the receiving task to stop. When they
45 * are all stoped, an answer with retval 0 is generated.
46 *
47 */
48 UDEBUG_M_BEGIN = 1,
49
50 /** Finish debugging the recipient.
51 *
52 * Answers all pending GO and GUARD messages.
53 *
54 */
55 UDEBUG_M_END,
56
57 /** Set which events should be captured. */
58 UDEBUG_M_SET_EVMASK,
59
60 /** Make sure the debugged task is still there.
61 *
62 * This message is answered when the debugged task dies
63 * or the debugging session ends.
64 *
65 */
66 UDEBUG_M_GUARD,
67
68 /** Run a thread until a debugging event occurs.
69 *
70 * This message is answered when the thread stops
71 * in a debugging event.
72 *
73 * - ARG2 - id of the thread to run
74 *
75 */
76 UDEBUG_M_GO,
77
78 /** Stop a thread being debugged.
79 *
80 * Creates a special STOP event in the thread, causing
81 * it to answer a pending GO message (if any).
82 *
83 */
84 UDEBUG_M_STOP,
85
86 /** Read arguments of a syscall.
87 *
88 * - ARG2 - thread identification
89 * - ARG3 - destination address in the caller's address space
90 *
91 */
92 UDEBUG_M_ARGS_READ,
93
94 /** Read thread's userspace register state (istate_t).
95 *
96 * - ARG2 - thread identification
97 * - ARG3 - destination address in the caller's address space
98 *
99 * or, on error, retval will be
100 * - ENOENT - thread does not exist
101 * - EBUSY - register state not available
102 */
103 UDEBUG_M_REGS_READ,
104
105 /** Read the list of the debugged tasks's threads.
106 *
107 * - ARG2 - destination address in the caller's address space
108 * - ARG3 - size of receiving buffer in bytes
109 *
110 * The kernel fills the buffer with a series of sysarg_t values
111 * (thread ids). On answer, the kernel will set:
112 *
113 * - ARG2 - number of bytes that were actually copied
114 * - ARG3 - number of bytes of the complete data
115 *
116 */
117 UDEBUG_M_THREAD_READ,
118
119 /** Read the name of the debugged task.
120 *
121 * - ARG2 - destination address in the caller's address space
122 * - ARG3 - size of receiving buffer in bytes
123 *
124 * The kernel fills the buffer with a non-terminated string.
125 *
126 * - ARG2 - number of bytes that were actually copied
127 * - ARG3 - number of bytes of the complete data
128 *
129 */
130 UDEBUG_M_NAME_READ,
131
132 /** Read the list of the debugged task's address space areas.
133 *
134 * - ARG2 - destination address in the caller's address space
135 * - ARG3 - size of receiving buffer in bytes
136 *
137 * The kernel fills the buffer with a series of as_area_info_t structures.
138 * Upon answer, the kernel will set:
139 *
140 * - ARG2 - number of bytes that were actually copied
141 * - ARG3 - number of bytes of the complete data
142 *
143 */
144 UDEBUG_M_AREAS_READ,
145
146 /** Read the debugged tasks's memory.
147 *
148 * - ARG2 - destination address in the caller's address space
149 * - ARG3 - source address in the recipient's address space
150 * - ARG4 - size of receiving buffer in bytes
151 *
152 */
153 UDEBUG_M_MEM_READ
154} udebug_method_t;
155
156typedef enum {
157 UDEBUG_EVENT_FINISHED = 1, /**< Debuging session has finished */
158 UDEBUG_EVENT_STOP, /**< Stopped on DEBUG_STOP request */
159 UDEBUG_EVENT_SYSCALL_B, /**< Before beginning syscall execution */
160 UDEBUG_EVENT_SYSCALL_E, /**< After finishing syscall execution */
161 UDEBUG_EVENT_THREAD_B, /**< The task created a new thread */
162 UDEBUG_EVENT_THREAD_E /**< A thread exited */
163} udebug_event_t;
164
165typedef enum {
166 UDEBUG_EM_FINISHED = UDEBUG_EVMASK(UDEBUG_EVENT_FINISHED),
167 UDEBUG_EM_STOP = UDEBUG_EVMASK(UDEBUG_EVENT_STOP),
168 UDEBUG_EM_SYSCALL_B = UDEBUG_EVMASK(UDEBUG_EVENT_SYSCALL_B),
169 UDEBUG_EM_SYSCALL_E = UDEBUG_EVMASK(UDEBUG_EVENT_SYSCALL_E),
170 UDEBUG_EM_THREAD_B = UDEBUG_EVMASK(UDEBUG_EVENT_THREAD_B),
171 UDEBUG_EM_THREAD_E = UDEBUG_EVMASK(UDEBUG_EVENT_THREAD_E),
172 UDEBUG_EM_ALL =
173 (UDEBUG_EVMASK(UDEBUG_EVENT_FINISHED) |
174 UDEBUG_EVMASK(UDEBUG_EVENT_STOP) |
175 UDEBUG_EVMASK(UDEBUG_EVENT_SYSCALL_B) |
176 UDEBUG_EVMASK(UDEBUG_EVENT_SYSCALL_E) |
177 UDEBUG_EVMASK(UDEBUG_EVENT_THREAD_B) |
178 UDEBUG_EVMASK(UDEBUG_EVENT_THREAD_E))
179} udebug_evmask_t;
180
181#endif
182
183/** @}
184 */
Note: See TracBrowser for help on using the repository browser.