/trunk/kernel/generic/src/ipc/ipc_kbox.c |
---|
39,7 → 39,7 |
#include <ipc/ipcrsc.h> |
#include <arch.h> |
#include <errno.h> |
#include <print.h> |
#include <debug.h> |
#include <udebug/udebug_ipc.h> |
#include <ipc/ipc_kbox.h> |
65,10 → 65,10 |
ipc_answerbox_slam_phones(&TASK->kernel_box, have_kb_thread); |
if (have_kb_thread) { |
printf("join kb_thread..\n"); |
LOG("join kb_thread..\n"); |
thread_join(TASK->kb_thread); |
thread_detach(TASK->kb_thread); |
printf("join done\n"); |
LOG("join done\n"); |
TASK->kb_thread = NULL; |
} |
88,11 → 88,10 |
ipl_t ipl; |
(void)arg; |
printf("kbox_thread_proc()\n"); |
LOG("kbox_thread_proc()\n"); |
done = false; |
while (!done) { |
//printf("kbox: wait for call\n"); |
call = ipc_wait_for_call(&TASK->kernel_box, SYNCH_NO_TIMEOUT, |
SYNCH_FLAGS_NONE); |
104,12 → 103,12 |
} |
if (method == IPC_M_PHONE_HUNGUP) { |
printf("kbox: handle hangup message\n"); |
LOG("kbox: handle hangup message\n"); |
/* Was it our debugger, who hung up? */ |
if (call->sender == TASK->udebug.debugger) { |
/* Terminate debugging session (if any) */ |
printf("kbox: terminate debug session\n"); |
LOG("kbox: terminate debug session\n"); |
ipl = interrupts_disable(); |
spinlock_lock(&TASK->lock); |
udebug_task_cleanup(TASK); |
116,10 → 115,10 |
spinlock_unlock(&TASK->lock); |
interrupts_restore(ipl); |
} else { |
printf("kbox: was not debugger\n"); |
LOG("kbox: was not debugger\n"); |
} |
printf("kbox: continue with hangup message\n"); |
LOG("kbox: continue with hangup message\n"); |
IPC_SET_RETVAL(call->data, 0); |
ipc_answer(&TASK->kernel_box, call); |
130,7 → 129,7 |
/* Last phone has been disconnected */ |
TASK->kb_thread = NULL; |
done = true; |
printf("phone list is empty\n"); |
LOG("phone list is empty\n"); |
} |
spinlock_unlock(&TASK->answerbox.lock); |
spinlock_unlock(&TASK->lock); |
139,7 → 138,7 |
} |
} |
printf("kbox: finished\n"); |
LOG("kbox: finished\n"); |
} |
/trunk/kernel/generic/src/ipc/sysipc.c |
---|
45,7 → 45,6 |
#include <ipc/ipc_kbox.h> |
#include <udebug/udebug_ipc.h> |
#include <arch/interrupt.h> |
#include <print.h> |
#include <syscall/copy.h> |
#include <security/cap.h> |
#include <mm/as.h> |
899,7 → 898,7 |
if (rc != 0) |
return (unative_t) rc; |
printf("sys_ipc_connect_kbox(%lld, %d)\n", taskid_arg.value); |
LOG("sys_ipc_connect_kbox(%" PRIu64 ")\n", taskid_arg.value); |
return ipc_connect_kbox(taskid_arg.value); |
#else |
/trunk/kernel/generic/src/udebug/udebug_ipc.c |
---|
35,7 → 35,6 |
* @brief Udebug IPC message handling. |
*/ |
#include <print.h> |
#include <proc/task.h> |
#include <proc/thread.h> |
#include <arch.h> |
102,8 → 101,6 |
thread_t *t; |
int rc; |
//printf("debug_go()\n"); |
t = (thread_t *)IPC_GET_ARG2(call->data); |
rc = udebug_go(t, call); |
119,8 → 116,6 |
thread_t *t; |
int rc; |
printf("debug_stop()\n"); |
t = (thread_t *)IPC_GET_ARG2(call->data); |
rc = udebug_stop(t, call); |
/trunk/kernel/generic/src/udebug/udebug.c |
---|
48,7 → 48,7 |
*/ |
#include <synch/waitq.h> |
#include <print.h> |
#include <debug.h> |
#include <udebug/udebug.h> |
#include <errno.h> |
#include <arch.h> |
331,12 → 331,12 |
mutex_lock(&TASK->udebug.lock); |
mutex_lock(&THREAD->udebug.lock); |
printf("udebug_thread_b_event\n"); |
printf("- check state\n"); |
LOG("udebug_thread_b_event\n"); |
LOG("- check state\n"); |
/* Must only generate events when in debugging session */ |
if (THREAD->udebug.debug_active != true) { |
printf("- debug_active: %s, udebug.stop: %s\n", |
LOG("- debug_active: %s, udebug.stop: %s\n", |
THREAD->udebug.debug_active ? "yes(+)" : "no(-)", |
THREAD->udebug.stop ? "yes(-)" : "no(+)"); |
mutex_unlock(&THREAD->udebug.lock); |
344,7 → 344,7 |
return; |
} |
printf("- trigger event\n"); |
LOG("- trigger event\n"); |
call = THREAD->udebug.go_call; |
THREAD->udebug.go_call = NULL; |
365,7 → 365,7 |
mutex_unlock(&THREAD->udebug.lock); |
mutex_unlock(&TASK->udebug.lock); |
printf("- sleep\n"); |
LOG("- sleep\n"); |
udebug_wait_for_go(&THREAD->udebug.go_wq); |
udebug_int_unlock(); |
380,8 → 380,8 |
mutex_lock(&TASK->udebug.lock); |
mutex_lock(&THREAD->udebug.lock); |
// printf("udebug_thread_e_event\n"); |
// printf("- check state\n"); |
LOG("udebug_thread_e_event\n"); |
LOG("- check state\n"); |
/* Must only generate events when in debugging session */ |
if (THREAD->udebug.debug_active != true) { |
393,7 → 393,7 |
return; |
} |
// printf("- trigger event\n"); |
LOG("- trigger event\n"); |
call = THREAD->udebug.go_call; |
THREAD->udebug.go_call = NULL; |
427,14 → 427,14 |
int flags; |
ipl_t ipl; |
printf("udebug_task_cleanup()\n"); |
printf("task %llu\n", ta->taskid); |
LOG("udebug_task_cleanup()\n"); |
LOG("task %" PRIu64 "\n", ta->taskid); |
udebug_int_lock(); |
if (ta->udebug.dt_state != UDEBUG_TS_BEGINNING && |
ta->udebug.dt_state != UDEBUG_TS_ACTIVE) { |
printf("udebug_task_cleanup(): task not being debugged\n"); |
LOG("udebug_task_cleanup(): task not being debugged\n"); |
return EINVAL; |
} |
467,7 → 467,7 |
t->udebug.stop = true; |
/* Answer GO call */ |
printf("answer GO call with EVENT_FINISHED\n"); |
LOG("answer GO call with EVENT_FINISHED\n"); |
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 |
---|
35,7 → 35,7 |
* @brief Udebug operations. |
*/ |
#include <print.h> |
#include <debug.h> |
#include <proc/task.h> |
#include <proc/thread.h> |
#include <arch.h> |
162,14 → 162,14 |
thread_t *t; |
link_t *cur; |
printf("udebug_begin()\n"); |
LOG("udebug_begin()\n"); |
mutex_lock(&TASK->udebug.lock); |
printf("debugging task %llu\n", TASK->taskid); |
LOG("debugging task %llu\n", TASK->taskid); |
if (TASK->udebug.dt_state != UDEBUG_TS_INACTIVE) { |
mutex_unlock(&TASK->udebug.lock); |
printf("udebug_begin(): busy error\n"); |
LOG("udebug_begin(): busy error\n"); |
return EBUSY; |
} |
199,7 → 199,7 |
mutex_unlock(&TASK->udebug.lock); |
printf("udebug_begin() done (%s)\n", |
LOG("udebug_begin() done (%s)\n", |
reply ? "reply" : "stoppability wait"); |
return reply; |
209,10 → 209,10 |
{ |
int rc; |
printf("udebug_end()\n"); |
LOG("udebug_end()\n"); |
mutex_lock(&TASK->udebug.lock); |
printf("task %llu\n", TASK->taskid); |
LOG("task %" PRIu64 "\n", TASK->taskid); |
rc = udebug_task_cleanup(TASK); |
223,15 → 223,13 |
int udebug_set_evmask(udebug_evmask_t mask) |
{ |
printf("udebug_set_mask()\n"); |
LOG("udebug_set_mask()\n"); |
printf("debugging task %llu\n", TASK->taskid); |
mutex_lock(&TASK->udebug.lock); |
if (TASK->udebug.dt_state != UDEBUG_TS_ACTIVE) { |
mutex_unlock(&TASK->udebug.lock); |
printf("udebug_set_mask(): not active debuging session\n"); |
LOG("udebug_set_mask(): not active debuging session\n"); |
return EINVAL; |
} |
248,8 → 246,6 |
{ |
int rc; |
// printf("udebug_go()\n"); |
/* On success, this will lock t->udebug.lock */ |
rc = _thread_op_begin(t, false); |
if (rc != EOK) { |
274,7 → 270,7 |
{ |
int rc; |
printf("udebug_stop()\n"); |
LOG("udebug_stop()\n"); |
mutex_lock(&TASK->udebug.lock); |
/* |
298,7 → 294,7 |
/* |
* Answer GO call |
*/ |
printf("udebug_stop - answering go call\n"); |
LOG("udebug_stop - answering go call\n"); |
/* Make sure nobody takes this call away from us */ |
call = t->udebug.go_call; |
306,7 → 302,7 |
IPC_SET_RETVAL(call->data, 0); |
IPC_SET_ARG1(call->data, UDEBUG_EVENT_STOP); |
printf("udebug_stop/ipc_answer\n"); |
LOG("udebug_stop/ipc_answer\n"); |
THREAD->udebug.cur_event = UDEBUG_EVENT_STOP; |
315,7 → 311,7 |
ipc_answer(&TASK->answerbox, call); |
mutex_unlock(&TASK->udebug.lock); |
printf("udebog_stop/done\n"); |
LOG("udebog_stop/done\n"); |
return 0; |
} |
330,7 → 326,7 |
int flags; |
size_t max_ids; |
printf("udebug_thread_read()\n"); |
LOG("udebug_thread_read()\n"); |
/* Allocate a buffer to hold thread IDs */ |
id_buffer = malloc(buf_size, 0); |
385,8 → 381,6 |
int rc; |
unative_t *arg_buffer; |
// printf("udebug_args_read()\n"); |
/* Prepare a buffer to hold the arguments */ |
arg_buffer = malloc(6 * sizeof(unative_t), 0); |
427,8 → 421,6 |
data_buffer = malloc(n, 0); |
// printf("udebug_mem_read: src=%u, size=%u\n", uspace_addr, n); |
/* NOTE: this is not strictly from a syscall... but that shouldn't |
* be a problem */ |
rc = copy_from_uspace(data_buffer, (void *)uspace_addr, n); |