Rev 3566 | Rev 3605 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3566 | Rev 3603 | ||
---|---|---|---|
Line 447... | Line 447... | ||
447 | 447 | ||
448 | printf("Start tracing thread [%d] (hash 0x%lx)\n", thread_id, thread_hash); |
448 | printf("Start tracing thread [%d] (hash 0x%lx)\n", thread_id, thread_hash); |
449 | 449 | ||
450 | while (!abort_trace) { |
450 | while (!abort_trace) { |
451 | 451 | ||
- | 452 | if (paused) { |
|
- | 453 | printf("Waiting for resume\n"); |
|
- | 454 | while (paused) { |
|
- | 455 | usleep(1000000); |
|
- | 456 | fibril_yield(); |
|
- | 457 | printf("."); |
|
- | 458 | } |
|
- | 459 | printf("Resumed\n"); |
|
- | 460 | } |
|
- | 461 | ||
452 | /* Run thread until an event occurs */ |
462 | /* Run thread until an event occurs */ |
453 | rc = udebug_go(phoneid, thread_hash, |
463 | rc = udebug_go(phoneid, thread_hash, |
454 | &ev_type, &val0, &val1); |
464 | &ev_type, &val0, &val1); |
455 | 465 | ||
456 | // printf("rc = %d, ev_type=%d\n", rc, ev_type); |
466 | // printf("rc = %d, ev_type=%d\n", rc, ev_type); |
Line 467... | Line 477... | ||
467 | case UDEBUG_EVENT_SYSCALL_E: |
477 | case UDEBUG_EVENT_SYSCALL_E: |
468 | event_syscall_e(thread_id, thread_hash, val0, (int)val1); |
478 | event_syscall_e(thread_id, thread_hash, val0, (int)val1); |
469 | break; |
479 | break; |
470 | case UDEBUG_EVENT_STOP: |
480 | case UDEBUG_EVENT_STOP: |
471 | printf("Stop event\n"); |
481 | printf("Stop event\n"); |
472 | printf("Waiting for resume\n"); |
- | |
473 | while (paused) { |
- | |
474 | usleep(1000000); |
- | |
475 | fibril_yield(); |
- | |
476 | printf("."); |
- | |
477 | } |
- | |
478 | printf("Resumed\n"); |
- | |
479 | break; |
482 | break; |
480 | case UDEBUG_EVENT_THREAD_B: |
483 | case UDEBUG_EVENT_THREAD_B: |
481 | event_thread_b(val0); |
484 | event_thread_b(val0); |
482 | break; |
485 | break; |
483 | case UDEBUG_EVENT_THREAD_E: |
486 | case UDEBUG_EVENT_THREAD_E: |
Line 578... | Line 581... | ||
578 | 581 | ||
579 | while(1) { |
582 | while(1) { |
580 | c = getchar(); |
583 | c = getchar(); |
581 | if (c == 'q') break; |
584 | if (c == 'q') break; |
582 | if (c == 'p') { |
585 | if (c == 'p') { |
- | 586 | printf("Pause...\n"); |
|
583 | paused = 1; |
587 | paused = 1; |
584 | rc = udebug_stop(phoneid, thash); |
588 | rc = udebug_stop(phoneid, thash); |
585 | printf("stop -> %d\n", rc); |
589 | printf("stop -> %d\n", rc); |
586 | } |
590 | } |
587 | if (c == 'r') { |
591 | if (c == 'r') { |
588 | paused = 0; |
592 | paused = 0; |
- | 593 | printf("Resume...\n"); |
|
589 | } |
594 | } |
590 | } |
595 | } |
591 | 596 | ||
592 | printf("\nTerminate debugging session...\n"); |
597 | printf("\nTerminate debugging session...\n"); |
593 | abort_trace = 1; |
598 | abort_trace = 1; |