Rev 3018 | Rev 3606 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 3018 | Rev 3026 | ||
|---|---|---|---|
| Line 174... | Line 174... | ||
| 174 | } udebug_evmask_t; |
174 | } udebug_evmask_t; |
| 175 | 175 | ||
| 176 | #ifdef KERNEL |
176 | #ifdef KERNEL |
| 177 | 177 | ||
| 178 | #include <synch/mutex.h> |
178 | #include <synch/mutex.h> |
| - | 179 | #include <arch/interrupt.h> |
|
| - | 180 | #include <atomic.h> |
|
| 179 | 181 | ||
| 180 | typedef enum { |
182 | typedef enum { |
| 181 | /** Task is not being debugged */ |
183 | /** Task is not being debugged */ |
| 182 | UDEBUG_TS_INACTIVE, |
184 | UDEBUG_TS_INACTIVE, |
| 183 | /** BEGIN operation in progress (waiting for threads to stop) */ |
185 | /** BEGIN operation in progress (waiting for threads to stop) */ |
| Line 191... | Line 193... | ||
| 191 | /** Debugging part of task_t structure. |
193 | /** Debugging part of task_t structure. |
| 192 | */ |
194 | */ |
| 193 | typedef struct { |
195 | typedef struct { |
| 194 | /** Synchronize debug ops on this task / access to this structure */ |
196 | /** Synchronize debug ops on this task / access to this structure */ |
| 195 | mutex_t lock; |
197 | mutex_t lock; |
| - | 198 | char *lock_owner; |
|
| 196 | 199 | ||
| 197 | udebug_task_state_t dt_state; |
200 | udebug_task_state_t dt_state; |
| 198 | call_t *begin_call; |
201 | call_t *begin_call; |
| 199 | int not_stoppable_count; |
202 | int not_stoppable_count; |
| 200 | struct task *debugger; |
203 | struct task *debugger; |
| Line 202... | Line 205... | ||
| 202 | } udebug_task_t; |
205 | } udebug_task_t; |
| 203 | 206 | ||
| 204 | /** Debugging part of thread_t structure. |
207 | /** Debugging part of thread_t structure. |
| 205 | */ |
208 | */ |
| 206 | typedef struct { |
209 | typedef struct { |
| - | 210 | /** |
|
| - | 211 | * Prevent deadlock with udebug_before_thread_runs() in interrupt |
|
| - | 212 | * handler, without actually disabling interrupts. |
|
| - | 213 | * ==0 means "unlocked", >0 means "locked" |
|
| - | 214 | */ |
|
| - | 215 | atomic_t int_lock; |
|
| - | 216 | ||
| 207 | /** Synchronize debug ops on this thread / access to this structure */ |
217 | /** Synchronize debug ops on this thread / access to this structure */ |
| 208 | SPINLOCK_DECLARE(lock); |
218 | mutex_t lock; |
| 209 | 219 | ||
| 210 | waitq_t go_wq; |
220 | waitq_t go_wq; |
| 211 | call_t *go_call; |
221 | call_t *go_call; |
| 212 | unative_t syscall_args[6]; |
222 | unative_t syscall_args[6]; |
| 213 | istate_t *uspace_state; |
223 | istate_t *uspace_state; |
| 214 | bool in_before_thread_runs; |
- | |
| 215 | 224 | ||
| 216 | /** What type of event are we stopped in or 0 if none */ |
225 | /** What type of event are we stopped in or 0 if none */ |
| 217 | udebug_event_t cur_event; |
226 | udebug_event_t cur_event; |
| 218 | bool stop; |
227 | bool stop; |
| 219 | bool stoppable; |
228 | bool stoppable; |