Subversion Repositories HelenOS

Rev

Rev 2835 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2835 Rev 2853
1
/** @addtogroup sctrace
1
/** @addtogroup sctrace
2
 * @{
2
 * @{
3
 */
3
 */
4
/** @file
4
/** @file
5
 */
5
 */
6
 
6
 
7
#include <stdio.h>
7
#include <stdio.h>
8
#include <syscall.h>
8
#include <syscall.h>
9
#include <ipc/ipc.h>
9
#include <ipc/ipc.h>
10
#include <async.h>
10
#include <async.h>
11
#include <udebug.h>
11
#include <udebug.h>
12
 
12
 
13
#include "debug_api.h"
13
#include "debug_api.h"
14
 
14
 
15
int debug_begin(unsigned phoneid)
15
int debug_begin(unsigned phoneid)
16
{
16
{
17
    return async_req_1_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_BEGIN);
17
    return async_req_1_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_BEGIN);
18
}
18
}
19
 
19
 
20
int debug_end(unsigned phoneid)
20
int debug_end(unsigned phoneid)
21
{
21
{
22
    return async_req_1_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_END);
22
    return async_req_1_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_END);
23
}
23
}
24
 
24
 
25
int debug_thread_read(unsigned phoneid, void *buffer, unsigned n,
25
int debug_thread_read(unsigned phoneid, void *buffer, unsigned n,
26
    unsigned *copied, unsigned *needed)
26
    unsigned *copied, unsigned *needed)
27
{
27
{
28
    printf("send IPC_M_DEBUG_THREAD_READ message\n");
-
 
29
    return async_req_3_2(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_THREAD_READ,
28
    return async_req_3_2(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_THREAD_READ,
30
        (sysarg_t)buffer, n, copied, needed);
29
        (sysarg_t)buffer, n, copied, needed);
31
}
30
}
32
 
31
 
33
int debug_mem_read(unsigned phoneid, void *buffer, unsigned addr, unsigned n)
32
int debug_mem_read(unsigned phoneid, void *buffer, unsigned addr, unsigned n)
34
{
33
{
35
    return async_req_4_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_MEM_READ,
34
    return async_req_4_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_MEM_READ,
36
        (sysarg_t)buffer, addr, n);
35
        (sysarg_t)buffer, addr, n);
37
}
36
}
38
 
37
 
39
int debug_args_read(unsigned phoneid, unsigned tid, unsigned *buffer)
38
int debug_args_read(unsigned phoneid, unsigned tid, unsigned *buffer)
40
{
39
{
41
    return async_req_3_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_ARGS_READ,
40
    return async_req_3_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_ARGS_READ,
42
        tid, (sysarg_t)buffer);
41
        tid, (sysarg_t)buffer);
43
}
42
}
44
 
43
 
45
int debug_go(unsigned phoneid, unsigned tid, unsigned *ev_type,
44
int debug_go(unsigned phoneid, unsigned tid, unsigned *ev_type,
46
    unsigned *sc_id, unsigned *sc_rc)
45
    unsigned *sc_id, unsigned *sc_rc)
47
{
46
{
48
    /* Run thread until a syscall is executed */
47
    /* Run thread until a syscall is executed */
49
    return async_req_2_3(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_GO,
48
    return async_req_2_3(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_GO,
50
        tid, (sysarg_t)ev_type, (sysarg_t)sc_id, (sysarg_t)sc_rc);
49
        tid, (sysarg_t)ev_type, (sysarg_t)sc_id, (sysarg_t)sc_rc);
51
}
50
}
52
 
51
 
53
/** @}
52
/** @}
54
 */
53
 */
55
 
54