Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 3423 → Rev 3424

/branches/tracing/kernel/generic/src/udebug/udebug_ops.c
35,7 → 35,7
* @brief Udebug operations.
*/
#include <console/klog.h>
#include <print.h>
#include <proc/task.h>
#include <proc/thread.h>
#include <arch.h>
162,14 → 162,14
thread_t *t;
link_t *cur;
 
klog_printf("udebug_begin()");
printf("udebug_begin()\n");
 
mutex_lock(&TASK->udebug.lock);
klog_printf("debugging task %llu", TASK->taskid);
printf("debugging task %llu\n", TASK->taskid);
 
if (TASK->udebug.dt_state != UDEBUG_TS_INACTIVE) {
mutex_unlock(&TASK->udebug.lock);
klog_printf("udebug_begin(): busy error");
printf("udebug_begin(): busy error\n");
 
return EBUSY;
}
199,7 → 199,7
 
mutex_unlock(&TASK->udebug.lock);
 
klog_printf("udebug_begin() done (%s)",
printf("udebug_begin() done (%s)\n",
reply ? "reply" : "stoppability wait");
 
return reply;
209,10 → 209,10
{
int rc;
 
klog_printf("udebug_end()");
printf("udebug_end()\n");
 
mutex_lock(&TASK->udebug.lock);
klog_printf("task %llu", TASK->taskid);
printf("task %llu\n", TASK->taskid);
 
rc = udebug_task_cleanup(TASK);
 
223,15 → 223,15
 
int udebug_set_evmask(udebug_evmask_t mask)
{
klog_printf("udebug_set_mask()");
printf("udebug_set_mask()\n");
 
klog_printf("debugging task %llu", TASK->taskid);
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);
klog_printf("udebug_set_mask(): not active debuging session");
printf("udebug_set_mask(): not active debuging session\n");
 
return EINVAL;
}
248,7 → 248,7
{
int rc;
 
// klog_printf("udebug_go()");
// printf("udebug_go()\n");
 
/* On success, this will lock t->udebug.lock */
rc = _thread_op_begin(t, false);
274,7 → 274,7
{
int rc;
 
klog_printf("udebug_stop()");
printf("udebug_stop()\n");
mutex_lock(&TASK->udebug.lock);
 
/*
298,7 → 298,7
/*
* Answer GO call
*/
klog_printf("udebug_stop - answering go call");
printf("udebug_stop - answering go call\n");
 
/* Make sure nobody takes this call away from us */
call = t->udebug.go_call;
306,7 → 306,7
 
IPC_SET_RETVAL(call->data, 0);
IPC_SET_ARG1(call->data, UDEBUG_EVENT_STOP);
klog_printf("udebug_stop/ipc_answer");
printf("udebug_stop/ipc_answer\n");
 
THREAD->udebug.cur_event = UDEBUG_EVENT_STOP;
 
315,7 → 315,7
ipc_answer(&TASK->answerbox, call);
mutex_unlock(&TASK->udebug.lock);
 
klog_printf("udebog_stop/done");
printf("udebog_stop/done\n");
return 0;
}
 
330,7 → 330,7
int flags;
size_t max_ids;
 
klog_printf("udebug_thread_read()");
printf("udebug_thread_read()\n");
 
/* Allocate a buffer to hold thread IDs */
id_buffer = malloc(buf_size, 0);
385,7 → 385,7
int rc;
unative_t *arg_buffer;
 
// klog_printf("udebug_args_read()");
// printf("udebug_args_read()\n");
 
/* Prepare a buffer to hold the arguments */
arg_buffer = malloc(6 * sizeof(unative_t), 0);
417,7 → 417,7
istate_t *state;
int rc;
 
// klog_printf("udebug_regs_read()");
// printf("udebug_regs_read()\n");
 
/* On success, this will lock t->udebug.lock */
rc = _thread_op_begin(t, false);
428,7 → 428,7
state = t->udebug.uspace_state;
if (state == NULL) {
_thread_op_end(t);
klog_printf("udebug_regs_read() - istate not available");
printf("udebug_regs_read() - istate not available\n");
return EBUSY;
}
 
445,7 → 445,7
int rc;
istate_t *state;
 
klog_printf("udebug_regs_write()");
printf("udebug_regs_write()\n");
 
/* Try to change the thread's uspace_state */
 
452,7 → 452,7
/* On success, this will lock t->udebug.lock */
rc = _thread_op_begin(t, false);
if (rc != EOK) {
klog_printf("error locking thread");
printf("error locking thread\n");
return rc;
}
 
459,7 → 459,7
state = t->udebug.uspace_state;
if (state == NULL) {
_thread_op_end(t);
klog_printf("udebug_regs_write() - istate not available");
printf("udebug_regs_write() - istate not available\n");
return EBUSY;
}
 
486,7 → 486,7
 
data_buffer = malloc(n, 0);
 
// klog_printf("udebug_mem_read: src=%u, size=%u", uspace_addr, n);
// 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 */
503,7 → 503,7
{
int rc;
 
klog_printf("udebug_mem_write()");
printf("udebug_mem_write()\n");
 
/* n must be positive */
if (n < 1)
517,7 → 517,7
return EBUSY;
}
klog_printf("dst=%u, size=%u", uspace_addr, n);
printf("dst=%u, size=%u\n", uspace_addr, n);
 
/* NOTE: this is not strictly from a syscall... but that shouldn't
* be a problem */
526,7 → 526,7
 
rc = as_debug_write(uspace_addr, data, n);
klog_printf("rc=%d\n", rc);
printf("rc=%d\n", rc);
 
mutex_unlock(&TASK->udebug.lock);