Rev 2832 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2832 | svoboda | 1 | /** @addtogroup sctrace |
2 | * @{ |
||
3 | */ |
||
4 | /** @file |
||
5 | */ |
||
6 | |||
7 | #include <stdio.h> |
||
8 | #include <syscall.h> |
||
9 | #include <ipc/ipc.h> |
||
10 | #include <udebug.h> |
||
11 | |||
12 | #include "debug_api.h" |
||
13 | |||
14 | int debug_begin(unsigned phoneid) |
||
15 | { |
||
16 | return ipc_call_sync_1_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_BEGIN); |
||
17 | } |
||
18 | |||
19 | int debug_thread_read(unsigned phoneid, void *buffer, unsigned n, |
||
20 | unsigned *copied, unsigned *needed) |
||
21 | { |
||
22 | printf("send IPC_M_DEBUG_THREAD_READ message\n"); |
||
23 | return ipc_call_sync_3_2(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_THREAD_READ, |
||
24 | (sysarg_t)buffer, n, copied, needed); |
||
25 | } |
||
26 | |||
27 | int debug_mem_read(unsigned phoneid, void *buffer, unsigned addr, unsigned n) |
||
28 | { |
||
29 | return ipc_call_sync_4_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_MEM_READ, |
||
30 | (sysarg_t)buffer, addr, n); |
||
31 | } |
||
32 | |||
33 | int debug_args_read(unsigned phoneid, unsigned tid, unsigned *buffer) |
||
34 | { |
||
2833 | svoboda | 35 | return ipc_call_sync_3_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_ARGS_READ, |
36 | tid, (sysarg_t)buffer); |
||
2832 | svoboda | 37 | } |
38 | |||
39 | int debug_go(unsigned phoneid, unsigned tid, unsigned *ev_type, |
||
40 | unsigned *sc_id, unsigned *sc_rc) |
||
41 | { |
||
42 | /* Run thread until a syscall is executed */ |
||
43 | return ipc_call_sync_2_3(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_GO, |
||
44 | tid, (sysarg_t)ev_type, (sysarg_t)sc_id, (sysarg_t)sc_rc); |
||
45 | } |
||
46 | |||
47 | /** @} |
||
48 | */ |