33,9 → 33,11 |
/** |
* @file |
* @brief Udebug IPC message handling. |
* |
* This module handles udebug IPC messages and calls the appropriate |
* functions from the udebug_ops module which implement them. |
*/ |
|
#include <print.h> |
#include <proc/task.h> |
#include <proc/thread.h> |
#include <arch.h> |
116,6 → 118,13 |
return 0; |
} |
|
/** Process a BEGIN call. |
* |
* Initiates a debugging session for the current task. The reply |
* to this call may or may not be sent before this function returns. |
* |
* @param call The call structure. |
*/ |
static void udebug_receive_begin(call_t *call) |
{ |
int rc; |
127,6 → 136,10 |
return; |
} |
|
/* |
* If the initialization of the debugging session has finished, |
* send a reply. |
*/ |
if (rc != 0) { |
IPC_SET_RETVAL(call->data, 0); |
ipc_answer(&TASK->kernel_box, call); |
133,6 → 146,11 |
} |
} |
|
/** Process an END call. |
* |
* Terminates the debugging session for the current task. |
* @param call The call structure. |
*/ |
static void udebug_receive_end(call_t *call) |
{ |
int rc; |
143,6 → 161,11 |
ipc_answer(&TASK->kernel_box, call); |
} |
|
/** Process a SET_EVMASK call. |
* |
* Sets an event mask for the current debugging session. |
* @param call The call structure. |
*/ |
static void udebug_receive_set_evmask(call_t *call) |
{ |
int rc; |
156,13 → 179,16 |
} |
|
|
/** Process a GO call. |
* |
* Resumes execution of the specified thread. |
* @param call The call structure. |
*/ |
static void udebug_receive_go(call_t *call) |
{ |
thread_t *t; |
int rc; |
|
//printf("debug_go()\n"); |
|
t = (thread_t *)IPC_GET_ARG2(call->data); |
|
rc = udebug_go(t, call); |
173,13 → 199,16 |
} |
} |
|
/** Process a STOP call. |
* |
* Suspends execution of the specified thread. |
* @param call The call structure. |
*/ |
static void udebug_receive_stop(call_t *call) |
{ |
thread_t *t; |
int rc; |
|
printf("debug_stop()\n"); |
|
t = (thread_t *)IPC_GET_ARG2(call->data); |
|
rc = udebug_stop(t, call); |
187,6 → 216,11 |
ipc_answer(&TASK->kernel_box, call); |
} |
|
/** Process a THREAD_READ call. |
* |
* Reads the list of hashes of the (userspace) threads in the current task. |
* @param call The call structure. |
*/ |
static void udebug_receive_thread_read(call_t *call) |
{ |
unative_t uspace_addr; |
237,6 → 271,11 |
ipc_answer(&TASK->kernel_box, call); |
} |
|
/** Process an ARGS_READ call. |
* |
* Reads the argument of a current syscall event (SYSCALL_B or SYSCALL_E). |
* @param call The call structure. |
*/ |
static void udebug_receive_args_read(call_t *call) |
{ |
thread_t *t; |
334,7 → 373,11 |
ipc_answer(&TASK->kernel_box, call); |
} |
|
|
/** Process an MEM_READ call. |
* |
* Reads memory of the current (debugged) task. |
* @param call The call structure. |
*/ |
static void udebug_receive_mem_read(call_t *call) |
{ |
unative_t uspace_dst; |
391,10 → 434,10 |
} |
|
|
/** |
* Handle a debug call received on the kernel answerbox. |
/** Handle a debug call received on the kernel answerbox. |
* |
* This is called by the kbox servicing thread. |
* This is called by the kbox servicing thread. Verifies that the sender |
* is indeed the debugger and calls the appropriate processing function. |
*/ |
void udebug_call_receive(call_t *call) |
{ |