Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2924 → Rev 2935

/branches/tracing/uspace/app/debug/main.c
45,6 → 45,7
 
#include "cmd.h"
#include "include/arch.h"
#include "fib_synch.h"
#include "main.h"
 
void thread_debug_start(unsigned thread_hash);
71,6 → 72,8
breakpoint_t brk_list[MAX_BRKPTS];
int lifted_brkpt;
 
fcv_t go_cv;
 
void read_line(char *buffer, int n)
{
char c;
161,6 → 164,13
(*cmd_table[idx_found].proc)(cmd_argc, cmd_argv);
}
 
/*
* Called by a fibril (from arch code) when a breakpoint is hit.
*/
void breakpoint_hit(void)
{
fcv_wait(&go_cv);
}
 
int task_connect(int taskid)
{
269,16 → 279,16
 
while (!abort_debug) {
 
printf("go\n");
printf("[t%d] go...\n", thread_id);
/* Run thread until an event occurs */
rc = udebug_go(app_phone, thread_hash,
&ev_type, &val0, &val1);
printf("[t%d] stopped\n", thread_id);
 
if (ev_type == UDEBUG_EVENT_FINISHED) {
printf("thread %u debugging finished\n", thread_id);
break;
}
 
if (rc >= 0) debug_event(thread_hash, ev_type, val0);
}
 
310,7 → 320,7
while ((i = getchar()) != 'c')
putchar(i);
 
taskid = 13;
taskid = 14;
rc = task_connect(taskid);
if (rc < 0) {
printf("Failed to connect to task %d\n", taskid);
353,6 → 363,8
{
next_thread_id = 1;
paused = 0;
 
fcv_init(&go_cv);
}
 
int main(void)