Rev 2806 | Rev 2808 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2806 | Rev 2807 | ||
---|---|---|---|
Line 35... | Line 35... | ||
35 | "sys_sysinfo_value", |
35 | "sys_sysinfo_value", |
36 | "sys_debug_enable_console", |
36 | "sys_debug_enable_console", |
37 | "sys_ipc_connect_task" |
37 | "sys_ipc_connect_task" |
38 | }; |
38 | }; |
39 | 39 | ||
- | 40 | #define TIDBUF_SIZE 64 |
|
- | 41 | ||
40 | char * test_debug1(bool quiet) |
42 | char * test_debug1(bool quiet) |
41 | { |
43 | { |
42 | int taskid; |
44 | int taskid; |
43 | int rc; |
45 | int rc; |
44 | int phoneid; |
46 | int phoneid; |
Line 46... | Line 48... | ||
46 | unsigned sc_args[6]; |
48 | unsigned sc_args[6]; |
47 | unsigned copied; |
49 | unsigned copied; |
48 | unsigned ev_type; |
50 | unsigned ev_type; |
49 | unsigned sc_id; |
51 | unsigned sc_id; |
50 | int sc_rc; |
52 | int sc_rc; |
- | 53 | unsigned threadid_buf[TIDBUF_SIZE]; |
|
- | 54 | int tb_copied, tb_needed; |
|
51 | 55 | ||
52 | printf("running debug1 test\n"); |
56 | printf("running debug1 test\n"); |
53 | taskid = 12; |
57 | taskid = 12; |
54 | printf("ipc_connect_task(%d)...\n", taskid); |
58 | printf("ipc_connect_task(%d)...\n", taskid); |
55 | rc = ipc_connect_task(taskid); |
59 | rc = ipc_connect_task(taskid); |
Line 58... | Line 62... | ||
58 | 62 | ||
59 | printf("send IPC_M_DEBUG_BEGIN message\n"); |
63 | printf("send IPC_M_DEBUG_BEGIN message\n"); |
60 | rc = ipc_call_sync_0_0(phoneid, IPC_M_DEBUG_BEGIN); |
64 | rc = ipc_call_sync_0_0(phoneid, IPC_M_DEBUG_BEGIN); |
61 | printf("-> %d\n", rc); |
65 | printf("-> %d\n", rc); |
62 | 66 | ||
- | 67 | printf("send IPC_M_DEBUG_THREAD_READ message\n"); |
|
- | 68 | rc = ipc_call_sync_2_2(phoneid, IPC_M_DEBUG_THREAD_READ, |
|
- | 69 | &threadid_buf, TIDBUF_SIZE*sizeof(unsigned), |
|
- | 70 | &tb_copied, &tb_needed); |
|
- | 71 | printf("-> %d\n", rc); |
|
- | 72 | ||
- | 73 | printf("thread IDs:"); |
|
- | 74 | for (i=0; i<tb_copied / sizeof(unsigned); i++) { |
|
- | 75 | printf("%u", threadid_buf[i]); |
|
- | 76 | } |
|
- | 77 | printf("\ntotal of %u threads\n", tb_needed/sizeof(unsigned)); |
|
- | 78 | ||
63 | while (1) { |
79 | while (1) { |
64 | rc = ipc_call_sync_0_3(phoneid, IPC_M_DEBUG_GO, &ev_type, |
80 | rc = ipc_call_sync_1_3(phoneid, IPC_M_DEBUG_GO, threadid_buf[0], |
65 | &sc_id, &sc_rc); |
81 | &ev_type, &sc_id, &sc_rc); |
- | 82 | if (rc >= 0) { |
|
66 | rc = ipc_call_sync_3_1(phoneid, IPC_M_DEBUG_ARGS_READ, NULL, |
83 | rc = ipc_call_sync_3_1(phoneid, IPC_M_DEBUG_ARGS_READ, |
67 | sc_args, 6 * sizeof(unsigned), &copied); |
84 | threadid_buf[0], sc_args, 6 * sizeof(unsigned), &copied); |
- | 85 | } |
|
68 | if (rc >= 0) { |
86 | if (rc >= 0) { |
69 | printf("%s[%d](%u, %u, %u, %u, %u, %u) -> %d\n", |
87 | printf("%s[%d](%u, %u, %u, %u, %u, %u) -> %d\n", |
70 | syscall_name[sc_id], sc_id, |
88 | syscall_name[sc_id], sc_id, |
71 | sc_args[0], sc_args[1], sc_args[2], |
89 | sc_args[0], sc_args[1], sc_args[2], |
72 | sc_args[3], sc_args[4], sc_args[5], |
90 | sc_args[3], sc_args[4], sc_args[5], |