Rev 2908 | Rev 2917 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 2908 | Rev 2913 | ||
|---|---|---|---|
| Line 78... | Line 78... | ||
| 78 | TASK->debug_begin_call = NULL; |
78 | TASK->debug_begin_call = NULL; |
| 79 | spinlock_unlock(&TASK->lock); |
79 | spinlock_unlock(&TASK->lock); |
| 80 | interrupts_restore(ipl); |
80 | interrupts_restore(ipl); |
| 81 | 81 | ||
| 82 | IPC_SET_RETVAL(db_call->data, 0); |
82 | IPC_SET_RETVAL(db_call->data, 0); |
| 83 | klog_printf("udebug_stoppable_begin/ipc_answer"); |
83 | //klog_printf("udebug_stoppable_begin/ipc_answer"); |
| 84 | ipc_answer(&TASK->answerbox, db_call); |
84 | ipc_answer(&TASK->answerbox, db_call); |
| 85 | 85 | ||
| 86 | } else if (TASK->dt_state == UDEBUG_TS_ACTIVE) { |
86 | } else if (TASK->dt_state == UDEBUG_TS_ACTIVE) { |
| 87 | /* |
87 | /* |
| 88 | * Active debugging session |
88 | * Active debugging session |
| Line 145... | Line 145... | ||
| 145 | 145 | ||
| 146 | /* Lock order OK, THREAD->debug_lock is after TASK->lock */ |
146 | /* Lock order OK, THREAD->debug_lock is after TASK->lock */ |
| 147 | spinlock_lock(&THREAD->debug_lock); |
147 | spinlock_lock(&THREAD->debug_lock); |
| 148 | 148 | ||
| 149 | if (TASK->dt_state == UDEBUG_TS_ACTIVE) { |
149 | if (TASK->dt_state == UDEBUG_TS_ACTIVE) { |
| 150 | klog_printf("udebug_stoppable_end"); |
150 | //klog_printf("udebug_stoppable_end"); |
| 151 | klog_printf("debug_stop=%d", THREAD->debug_stop); |
151 | //klog_printf("debug_stop=%d", THREAD->debug_stop); |
| 152 | } |
152 | } |
| 153 | 153 | ||
| 154 | if (THREAD->debug_active && |
154 | if (THREAD->debug_active && |
| 155 | THREAD->debug_stop == true) { |
155 | THREAD->debug_stop == true) { |
| 156 | TASK->debug_begin_call = NULL; |
156 | TASK->debug_begin_call = NULL; |
| 157 | spinlock_unlock(&THREAD->debug_lock); |
157 | spinlock_unlock(&THREAD->debug_lock); |
| 158 | spinlock_unlock(&TASK->lock); |
158 | spinlock_unlock(&TASK->lock); |
| 159 | interrupts_restore(ipl); |
159 | interrupts_restore(ipl); |
| 160 | 160 | ||
| 161 | klog_printf("udebug_stoppable_end: waitq_sleep"); |
161 | //klog_printf("udebug_stoppable_end: waitq_sleep"); |
| 162 | waitq_sleep(&THREAD->go_wq); |
162 | waitq_sleep(&THREAD->go_wq); |
| 163 | goto restart; |
163 | goto restart; |
| 164 | /* must try again - have to lose stoppability atomically */ |
164 | /* must try again - have to lose stoppability atomically */ |
| 165 | } else { |
165 | } else { |
| 166 | ++TASK->not_stoppable_count; |
166 | ++TASK->not_stoppable_count; |
| Line 192... | Line 192... | ||
| 192 | spinlock_unlock(&THREAD->debug_lock); |
192 | spinlock_unlock(&THREAD->debug_lock); |
| 193 | interrupts_restore(ipl); |
193 | interrupts_restore(ipl); |
| 194 | return; |
194 | return; |
| 195 | } |
195 | } |
| 196 | 196 | ||
| 197 | klog_printf("udebug_syscall_event"); |
197 | //klog_printf("udebug_syscall_event"); |
| 198 | call = THREAD->debug_go_call; |
198 | call = THREAD->debug_go_call; |
| 199 | IPC_SET_RETVAL(call->data, 0); |
199 | IPC_SET_RETVAL(call->data, 0); |
| 200 | IPC_SET_ARG1(call->data, etype); |
200 | IPC_SET_ARG1(call->data, etype); |
| 201 | IPC_SET_ARG2(call->data, id); |
201 | IPC_SET_ARG2(call->data, id); |
| 202 | IPC_SET_ARG3(call->data, rc); |
202 | IPC_SET_ARG3(call->data, rc); |
| 203 | klog_printf("udebug_syscall_event/ipc_answer"); |
203 | //klog_printf("udebug_syscall_event/ipc_answer"); |
| 204 | 204 | ||
| 205 | THREAD->syscall_args[0] = a1; |
205 | THREAD->syscall_args[0] = a1; |
| 206 | THREAD->syscall_args[1] = a2; |
206 | THREAD->syscall_args[1] = a2; |
| 207 | THREAD->syscall_args[2] = a3; |
207 | THREAD->syscall_args[2] = a3; |
| 208 | THREAD->syscall_args[3] = a4; |
208 | THREAD->syscall_args[3] = a4; |