comparison src/debug/debugserver.h @ 0:2cf249471370

convert mercurial for git
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Tue, 08 May 2018 16:09:12 +0900
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:2cf249471370
1 struct MVMDebugServerHandleTableEntry {
2 MVMuint64 id;
3 MVMObject *target;
4 };
5
6 struct MVMDebugServerHandleTable {
7 MVMuint32 allocated;
8 MVMuint32 used;
9
10 MVMuint64 next_id;
11
12 MVMDebugServerHandleTableEntry *entries;
13 };
14
15 struct MVMDebugServerBreakpointInfo {
16 MVMuint64 breakpoint_id;
17 MVMuint32 line_no;
18
19 MVMuint8 shall_suspend;
20 MVMuint8 send_backtrace;
21 };
22
23 struct MVMDebugServerBreakpointFileTable {
24 char *filename;
25 MVMuint32 filename_length;
26 MVMuint32 lines_active_alloc;
27
28 MVMuint8 *lines_active;
29
30 MVMDebugServerBreakpointInfo *breakpoints;
31 MVMuint32 breakpoints_alloc;
32 MVMuint32 breakpoints_used;
33 };
34
35 struct MVMDebugServerBreakpointTable {
36 MVMDebugServerBreakpointFileTable *files;
37 MVMuint32 files_used;
38 MVMuint32 files_alloc;
39 };
40
41 struct MVMDebugServerData {
42 /* Debug Server thread */
43 uv_thread_t thread;
44
45 /* Protect the debugserver-related condvars */
46 uv_mutex_t mutex_cond;
47
48 /* Protect sending data on the network */
49 uv_mutex_t mutex_network_send;
50
51 /* Protect the open requests list */
52 uv_mutex_t mutex_request_list;
53
54 /* Condition variable to tell threads to check their state for changes
55 * like "i should suspend" */
56 uv_cond_t tell_threads;
57
58 /* Condition variable to tell the worker to check thread states
59 * for changes like "i just suspended" */
60 uv_cond_t tell_worker;
61
62 MVMuint32 port;
63 MVMuint32 thread_id;
64
65 MVMuint64 event_id;
66
67 MVMDebugServerHandleTable *handle_table;
68
69 MVMDebugServerBreakpointTable *breakpoints;
70 MVMuint32 any_breakpoints_at_all;
71 MVMuint32 breakpoints_alloc;
72 MVMuint32 breakpoints_used;
73 uv_mutex_t mutex_breakpoints;
74
75 void *messagepack_data;
76
77 MVMuint8 debugspam_network;
78 MVMuint8 debugspam_protocol;
79 };
80
81 MVM_PUBLIC void MVM_debugserver_init(MVMThreadContext *tc, MVMuint32 port);
82 MVM_PUBLIC void MVM_debugserver_mark_handles(MVMThreadContext *tc, MVMGCWorklist *worklist, MVMHeapSnapshotState *snapshot);
83
84 MVM_PUBLIC void MVM_debugserver_notify_thread_creation(MVMThreadContext *tc);
85 MVM_PUBLIC void MVM_debugserver_notify_thread_destruction(MVMThreadContext *tc);
86
87 MVM_PUBLIC void MVM_debugserver_notify_unhandled_exception(MVMThreadContext *tc, MVMException *ex);
88
89 MVM_PUBLIC void MVM_debugserver_register_line(MVMThreadContext *tc, char *filename, MVMuint32 filename_len, MVMuint32 line_no, MVMuint32 *file_idx);
90 MVM_PUBLIC void MVM_debugserver_breakpoint_check(MVMThreadContext *tc, MVMuint32 file_idx, MVMuint32 line_no);