Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4383 → Rev 4384

/trunk/kernel/generic/src/main/main.c
250,10 → 250,10
count_t i;
for (i = 0; i < init.cnt; i++)
LOG("init[%" PRIc "].addr=%#" PRIp ", init[%" PRIc
"].size=%#" PRIs "\n", i, init.tasks[i].addr, i,
"].size=%#" PRIs, i, init.tasks[i].addr, i,
init.tasks[i].size);
} else
printf("No init binaries found\n");
printf("No init binaries found.\n");
LOG_EXEC(ipc_init());
LOG_EXEC(event_init());
/trunk/kernel/generic/src/syscall/syscall.c
61,7 → 61,7
unative_t rc;
#ifdef CONFIG_UDEBUG
udebug_syscall_event(a1, a2, a3, a4, a5, a6, id, 0, false);
// udebug_syscall_event(a1, a2, a3, a4, a5, a6, id, 0, false);
#endif
if (id < SYSCALL_END) {
76,7 → 76,7
thread_exit();
#ifdef CONFIG_UDEBUG
udebug_syscall_event(a1, a2, a3, a4, a5, a6, id, rc, true);
// udebug_syscall_event(a1, a2, a3, a4, a5, a6, id, rc, true);
/*
* Stopping point needed for tasks that only invoke non-blocking
/trunk/kernel/generic/src/ipc/kbox.c
84,10 → 84,10
interrupts_restore(ipl);
if (have_kb_thread) {
LOG("join kb.thread..\n");
LOG("Join kb.thread.");
thread_join(TASK->kb.thread);
thread_detach(TASK->kb.thread);
LOG("join done\n");
LOG("...join done.");
TASK->kb.thread = NULL;
}
 
108,12 → 108,10
{
ipl_t ipl;
 
LOG("kbox_proc_phone_hungup()\n");
 
/* Was it our debugger, who hung up? */
if (call->sender == TASK->udebug.debugger) {
/* Terminate debugging session (if any). */
LOG("kbox: terminate debug session\n");
LOG("Terminate debugging session.");
ipl = interrupts_disable();
spinlock_lock(&TASK->lock);
udebug_task_cleanup(TASK);
120,10 → 118,10
spinlock_unlock(&TASK->lock);
interrupts_restore(ipl);
} else {
LOG("kbox: was not debugger\n");
LOG("Was not debugger.");
}
 
LOG("kbox: continue with hangup message\n");
LOG("Continue with hangup message.");
IPC_SET_RETVAL(call->data, 0);
ipc_answer(&TASK->kb.box, call);
 
145,7 → 143,7
}
mutex_unlock(&TASK->kb.cleanup_lock);
 
LOG("phone list is empty\n");
LOG("Phone list is empty.");
*last = true;
} else {
*last = false;
169,7 → 167,7
bool done;
 
(void)arg;
LOG("kbox_thread_proc()\n");
LOG("Starting.");
done = false;
 
while (!done) {
201,7 → 199,7
}
}
 
LOG("kbox: finished\n");
LOG("Exiting.");
}
 
 
/trunk/kernel/generic/src/udebug/udebug.c
271,7 → 271,7
return;
}
 
//printf("udebug_syscall_event\n");
/* Fill in the GO response. */
call = THREAD->udebug.go_call;
THREAD->udebug.go_call = NULL;
 
279,7 → 279,6
IPC_SET_ARG1(call->data, etype);
IPC_SET_ARG2(call->data, id);
IPC_SET_ARG3(call->data, rc);
//printf("udebug_syscall_event/ipc_answer\n");
 
THREAD->udebug.syscall_args[0] = a1;
THREAD->udebug.syscall_args[1] = a2;
329,21 → 328,19
 
thread_attach(t, ta);
 
LOG("udebug_thread_b_event\n");
LOG("- check state\n");
LOG("Check state");
 
/* Must only generate events when in debugging session */
if (THREAD->udebug.active != true) {
LOG("- udebug.active: %s, udebug.go: %s\n",
THREAD->udebug.active ? "yes(+)" : "no(-)",
THREAD->udebug.go ? "yes(-)" : "no(+)");
LOG("udebug.active: %s, udebug.go: %s",
THREAD->udebug.active ? "Yes(+)" : "No",
THREAD->udebug.go ? "Yes(-)" : "No");
mutex_unlock(&THREAD->udebug.lock);
mutex_unlock(&TASK->udebug.lock);
return;
}
 
LOG("- trigger event\n");
 
LOG("Trigger event");
call = THREAD->udebug.go_call;
THREAD->udebug.go_call = NULL;
IPC_SET_RETVAL(call->data, 0);
363,7 → 360,7
mutex_unlock(&THREAD->udebug.lock);
mutex_unlock(&TASK->udebug.lock);
 
LOG("- sleep\n");
LOG("Wait for Go");
udebug_wait_for_go(&THREAD->udebug.go_wq);
}
 
379,21 → 376,19
mutex_lock(&TASK->udebug.lock);
mutex_lock(&THREAD->udebug.lock);
 
LOG("udebug_thread_e_event\n");
LOG("- check state\n");
LOG("Check state");
 
/* Must only generate events when in debugging session. */
if (THREAD->udebug.active != true) {
/* printf("- udebug.active: %s, udebug.go: %s\n",
THREAD->udebug.active ? "yes(+)" : "no(-)",
THREAD->udebug.go ? "yes(-)" : "no(+)");*/
LOG("udebug.active: %s, udebug.go: %s",
THREAD->udebug.active ? "Yes" : "No",
THREAD->udebug.go ? "Yes" : "No");
mutex_unlock(&THREAD->udebug.lock);
mutex_unlock(&TASK->udebug.lock);
return;
}
 
LOG("- trigger event\n");
 
LOG("Trigger event");
call = THREAD->udebug.go_call;
THREAD->udebug.go_call = NULL;
IPC_SET_RETVAL(call->data, 0);
432,15 → 427,13
int flags;
ipl_t ipl;
 
LOG("udebug_task_cleanup()\n");
LOG("task %" PRIu64 "\n", ta->taskid);
 
if (ta->udebug.dt_state != UDEBUG_TS_BEGINNING &&
ta->udebug.dt_state != UDEBUG_TS_ACTIVE) {
LOG("udebug_task_cleanup(): task not being debugged\n");
return EINVAL;
}
 
LOG("Task %" PRIu64, ta->taskid);
 
/* Finish debugging of all userspace threads */
for (cur = ta->th_head.next; cur != &ta->th_head; cur = cur->next) {
t = list_get_instance(cur, thread_t, th_link);
470,7 → 463,7
t->udebug.go = false;
 
/* Answer GO call */
LOG("answer GO call with EVENT_FINISHED\n");
LOG("Answer GO call with EVENT_FINISHED.");
IPC_SET_RETVAL(t->udebug.go_call->data, 0);
IPC_SET_ARG1(t->udebug.go_call->data,
UDEBUG_EVENT_FINISHED);
/trunk/kernel/generic/src/udebug/udebug_ops.c
181,15 → 181,11
thread_t *t;
link_t *cur;
 
LOG("udebug_begin()\n");
 
LOG("Debugging task %llu", TASK->taskid);
mutex_lock(&TASK->udebug.lock);
LOG("debugging task %llu\n", TASK->taskid);
 
if (TASK->udebug.dt_state != UDEBUG_TS_INACTIVE) {
mutex_unlock(&TASK->udebug.lock);
LOG("udebug_begin(): busy error\n");
 
return EBUSY;
}
 
217,10 → 213,6
}
 
mutex_unlock(&TASK->udebug.lock);
 
LOG("udebug_begin() done (%s)\n",
reply ? "reply" : "stoppability wait");
 
return reply;
}
 
233,13 → 225,10
{
int rc;
 
LOG("udebug_end()\n");
LOG("Task %" PRIu64, TASK->taskid);
 
mutex_lock(&TASK->udebug.lock);
LOG("task %" PRIu64 "\n", TASK->taskid);
 
rc = udebug_task_cleanup(TASK);
 
mutex_unlock(&TASK->udebug.lock);
 
return rc;
254,19 → 243,16
*/
int udebug_set_evmask(udebug_evmask_t mask)
{
LOG("udebug_set_mask()\n");
LOG("mask = 0x%x", mask);
 
mutex_lock(&TASK->udebug.lock);
 
if (TASK->udebug.dt_state != UDEBUG_TS_ACTIVE) {
mutex_unlock(&TASK->udebug.lock);
LOG("udebug_set_mask(): not active debuging session\n");
 
return EINVAL;
}
 
TASK->udebug.evmask = mask;
 
mutex_unlock(&TASK->udebug.lock);
 
return 0;
317,7 → 303,7
{
int rc;
 
LOG("udebug_stop()\n");
LOG("udebug_stop()");
 
/*
* On success, this will lock t->udebug.lock. Note that this makes sure
340,7 → 326,6
/*
* Answer GO call.
*/
LOG("udebug_stop - answering go call\n");
 
/* Make sure nobody takes this call away from us. */
call = t->udebug.go_call;
348,7 → 333,6
 
IPC_SET_RETVAL(call->data, 0);
IPC_SET_ARG1(call->data, UDEBUG_EVENT_STOP);
LOG("udebug_stop/ipc_answer\n");
 
THREAD->udebug.cur_event = UDEBUG_EVENT_STOP;
 
358,7 → 342,6
ipc_answer(&TASK->answerbox, call);
mutex_unlock(&TASK->udebug.lock);
 
LOG("udebog_stop/done\n");
return 0;
}
 
392,7 → 375,7
int flags;
size_t max_ids;
 
LOG("udebug_thread_read()\n");
LOG("udebug_thread_read()");
 
/* Allocate a buffer to hold thread IDs */
id_buffer = malloc(buf_size, 0);