Rev 2915 | Rev 2922 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 2915 | Rev 2918 | ||
|---|---|---|---|
| Line 159... | Line 159... | ||
| 159 | 159 | ||
| 160 | 160 | ||
| 161 | int task_connect(int taskid) |
161 | int task_connect(int taskid) |
| 162 | { |
162 | { |
| 163 | int rc; |
163 | int rc; |
| - | 164 | unsigned evmask; |
|
| 164 | 165 | ||
| 165 | printf("ipc_connect_kbox(%d)... ", taskid); |
166 | printf("ipc_connect_kbox(%d)... ", taskid); |
| 166 | rc = ipc_connect_kbox(taskid); |
167 | rc = ipc_connect_kbox(taskid); |
| 167 | printf("-> %d\n", rc); |
168 | printf("-> %d\n", rc); |
| 168 | app_phone = rc; |
169 | app_phone = rc; |
| Line 171... | Line 172... | ||
| 171 | printf("udebug_begin()... "); |
172 | printf("udebug_begin()... "); |
| 172 | rc = udebug_begin(app_phone); |
173 | rc = udebug_begin(app_phone); |
| 173 | printf("-> %d\n", rc); |
174 | printf("-> %d\n", rc); |
| 174 | if (rc < 0) return rc; |
175 | if (rc < 0) return rc; |
| 175 | 176 | ||
| - | 177 | evmask = UDEBUG_EM_ALL & ~(UDEBUG_EM_SYSCALL_B | UDEBUG_EM_SYSCALL_E); |
|
| 176 | printf("udebug_set_evmask(0x%x)... ", UDEBUG_EM_ALL); |
178 | printf("udebug_set_evmask(0x%x)... ", evmask); |
| 177 | rc = udebug_set_evmask(app_phone, UDEBUG_EM_ALL); |
179 | rc = udebug_set_evmask(app_phone, evmask); |
| 178 | printf("-> %d\n", rc); |
180 | printf("-> %d\n", rc); |
| 179 | if (rc < 0) return rc; |
181 | if (rc < 0) return rc; |
| 180 | 182 | ||
| 181 | return 0; |
183 | return 0; |
| 182 | } |
184 | } |
| Line 227... | Line 229... | ||
| 227 | 229 | ||
| 228 | printf("debug_loop(%d)\n", thread_id); |
230 | printf("debug_loop(%d)\n", thread_id); |
| 229 | 231 | ||
| 230 | while (!abort_debug) { |
232 | while (!abort_debug) { |
| 231 | 233 | ||
| - | 234 | printf("go\n"); |
|
| 232 | /* Run thread until an event occurs */ |
235 | /* Run thread until an event occurs */ |
| 233 | rc = udebug_go(app_phone, thread_hash, |
236 | rc = udebug_go(app_phone, thread_hash, |
| 234 | &ev_type, &val0, &val1); |
237 | &ev_type, &val0, &val1); |
| 235 | 238 | ||
| - | 239 | printf("..ev type %d\n", ev_type); |
|
| - | 240 | ||
| 236 | // printf("rc = %d, ev_type=%d\n", rc, ev_type); |
241 | // printf("rc = %d, ev_type=%d\n", rc, ev_type); |
| 237 | if (ev_type == UDEBUG_EVENT_FINISHED) { |
242 | if (ev_type == UDEBUG_EVENT_FINISHED) { |
| 238 | printf("thread %u debugging finished\n", thread_id); |
243 | printf("thread %u debugging finished\n", thread_id); |
| 239 | break; |
244 | break; |
| 240 | } |
245 | } |
| Line 256... | Line 261... | ||
| 256 | break; |
261 | break; |
| 257 | case UDEBUG_EVENT_THREAD_E: |
262 | case UDEBUG_EVENT_THREAD_E: |
| 258 | printf("thread 0x%x exited\n", val0); |
263 | printf("thread 0x%x exited\n", val0); |
| 259 | abort_debug = true; |
264 | abort_debug = true; |
| 260 | break; |
265 | break; |
| - | 266 | case UDEBUG_EVENT_BREAKPOINT: |
|
| - | 267 | printf("breakpoint reached\n"); |
|
| - | 268 | usleep(2000*2000); |
|
| - | 269 | break; |
|
| 261 | default: |
270 | default: |
| 262 | printf("unknown event type %d\n", ev_type); |
271 | printf("unknown event type %d\n", ev_type); |
| 263 | break; |
272 | break; |
| 264 | } |
273 | } |
| 265 | } |
274 | } |