');
115 |
116 | dom.html(idump);
117 | graph.addVertex(addr, cnt, dom[0]);
118 |
119 | // add edges
120 | for (var i = 0; i < bb[cnt-1].dests.length; i++) {
121 | var dd = bb[cnt-1].dests[i];
122 | if (dd[1] == 3) continue;
123 |
124 | var col = "blue"; // base off dd[1]
125 | if (bb[cnt-1].dests.length > 1 && dd[1] == 4) {
126 | col = "red";
127 | } else if (dd[1] == 1) {
128 | col = "green";
129 | }
130 | graph.addEdge(addr, dd[0], col);
131 | }
132 |
133 | }
134 |
135 | graph.assignLevels();
136 | graph.render();
137 |
138 | rehighlight();
139 | replace_names();
140 | } stream.on('function', on_function);
141 |
142 |
--------------------------------------------------------------------------------
/web/client/strace.js:
--------------------------------------------------------------------------------
1 | stream = io.connect(STREAM_URL);
2 | Session.setDefault('sview', [0,10]);
3 |
4 | traces = {}
5 |
6 | function on_strace(msg) { DS("strace");
7 | traces[msg['forknum']] = msg['dat']
8 | redraw_strace();
9 | } stream.on('strace', on_strace);
10 |
11 | function redraw_strace() {
12 | var forknum = Session.get("forknum");
13 | var sview = Session.get('sview');
14 | if (traces[forknum] === undefined) return;
15 | var msg = traces[forknum].slice(sview[0], sview[1])
16 |
17 | var strace = "";
18 | for (i in msg) {
19 | var st = msg[i];
20 | strace += '
'+
21 | '
'+st.clnum+'
'+
22 | highlight_addresses(st.sc)+
23 | '
';
24 | }
25 | $('#strace').html(strace);
26 | rehighlight();
27 | }
28 |
29 | Deps.autorun(function() { DA("redrawing strace");
30 | redraw_strace();
31 | });
32 |
33 | Deps.autorun(function() { DA("updating sview on fork/cl change");
34 | var forknum = Session.get("forknum");
35 | var clnum = Session.get("clnum");
36 | if (traces[forknum] === undefined) return;
37 | var t = traces[forknum];
38 | var i;
39 | // ugh, slow...binary search here
40 | for (i = 0; i < t.length; i++) {
41 | if (t[i]['clnum'] > clnum) break;
42 | }
43 | //p(i);
44 | var size = get_size("#strace");
45 |
46 | var min = Math.max(0, i-3);
47 | var max = min+size;
48 | // ugh
49 | if (max > t.length) {
50 | var off = max-t.length;
51 | max -= off; min -= off;
52 | if (min < 0) {
53 | max -= min;
54 | min = 0;
55 | }
56 | }
57 | Session.set('sview', [min, max]);
58 | });
59 |
60 | $(document).ready(function() {
61 | $("#strace")[0].addEventListener("wheel", function(e) {
62 | var sv = Session.get('sview');
63 | var forknum = Session.get("forknum");
64 | if (traces[forknum] === undefined) return;
65 | var t = traces[forknum];
66 | if (e.deltaY > 0) {
67 | if (sv[1] < t.length) {
68 | Session.set('sview', [sv[0]+1, sv[1]+1]);
69 | }
70 | } else if (e.deltaY < 0) {
71 | if (sv[0] > 0) {
72 | Session.set('sview', [sv[0]-1, sv[1]-1]);
73 | }
74 | }
75 | });
76 | });
77 |
78 |
79 |
--------------------------------------------------------------------------------
/web/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/geohot/qira/5f34406410aa492bc491fe0e579dbe103390a432/web/favicon.ico
--------------------------------------------------------------------------------
/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
qira
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
47 |
48 |
51 |
52 |
58 |
59 |
62 |
63 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/web/qira_layout.css:
--------------------------------------------------------------------------------
1 | html, body {
2 | height: 100%;
3 | margin: 0;
4 | overflow: hidden;
5 | padding: 0;
6 | width: 100%;
7 | }
8 |
9 |
10 | /* universal things */
11 | input {
12 | font-family: monospace;
13 | }
14 |
15 | td {
16 | font-family: monospace;
17 | }
18 |
19 | .dynamic-info {
20 | width: 100%;
21 | background-color: #AAAAAA;
22 | }
23 |
24 | .splitter {
25 | position: absolute;
26 | top: 0px;
27 | left: 0px;
28 | right: 0px;
29 | bottom: 0px;
30 | overflow: hidden;
31 | }
32 |
33 | .fill {
34 | overflow-y: hidden;
35 | }
36 |
37 | /* controls */
38 |
39 | #controls {
40 | padding-top: 4px;
41 | padding-bottom: 4px;
42 | }
43 |
44 | .control {
45 | font-family: monospace;
46 | font-size: 12pt;
47 | /*width: 165px;*/
48 | border: 1px solid black;
49 | /*padding: 2px;
50 | margin: 3px;*/
51 | background-color: #ddd;
52 | }
53 |
54 | #control_fork {
55 | /*margin-left: 0px;
56 | width: 50px;*/
57 | }
58 |
59 | #control_changeeditor {
60 | /*margin-left: 0px;
61 | width: 30px;
62 | margin-right: 0px;*/
63 | }
64 |
65 | #control_analysis {
66 | /*margin-left: 0px;
67 | width: auto;
68 | padding-left: 5px;
69 | padding-right: 5px;*/
70 | }
71 |
72 | /* everything in the right panel */
73 |
74 | #onlypanel {
75 | width: 620px;
76 | height: 100%;
77 | /*border: 1px solid black;*/
78 | border-left: 1px solid black;
79 | border-right: 1px solid black;
80 | padding: 4px;
81 | box-sizing: border-box;
82 | z-index: 1;
83 | position: relative;
84 | }
85 |
86 | .panelthing {
87 | border: 1px solid gray;
88 | background-color: #DDDDDD;
89 | }
90 |
91 | /* instruction dump */
92 |
93 | #static {
94 | padding: 5px;
95 | overflow-x: auto;
96 | }
97 |
98 | #idump {
99 | padding: 5px;
100 | overflow-y: hidden;
101 | overflow-x: auto;
102 | }
103 |
104 |
105 | .container {
106 | background-color: #AAAAAA;
107 | }
108 |
109 | .container:after {
110 | content: "";
111 | display: table;
112 | clear: both;
113 | }
114 |
115 | .col {
116 | float: left;
117 | background-color: #AAAAAA;
118 | }
119 |
120 | #vtimelinebox {
121 | padding-top: 4px;
122 | height: 100%;
123 | width: 100%;
124 | /*background-color: #AAAAAA;*/
125 | overflow-x: auto;
126 | overflow-y: hidden;
127 | white-space: nowrap;
128 | box-sizing: border-box;
129 | z-index: 1;
130 | position: absolute;
131 | top: 0;
132 | }
133 |
134 | .tags {
135 | border: 1px solid grey;
136 | width: 49.8%;
137 | display: inline-block;
138 | height: 100%;
139 | min-height: 18px;
140 | position: absolute;
141 | top: 0;
142 | background-color: #BBBBBB;
143 | }
144 |
145 | #itags-static {
146 | border-color: #cc0000;
147 | }
148 |
149 | #dtags-static {
150 | border-color: #888800;
151 | left: 50%;
152 | }
153 |
154 |
155 |
--------------------------------------------------------------------------------
/web/qira_new.css:
--------------------------------------------------------------------------------
1 | .name {
2 | /*color: purple !important;*/
3 | /*background-color: #cccccc;*/
4 | }
5 |
6 | .autohighlight {
7 | background-color: #FF7777 !important;
8 | }
9 |
10 | .autohighlighti {
11 | background-color: #FFAA77;
12 | }
13 |
14 | .insaddr {
15 | min-width: 7em;
16 | display: inline-block;
17 | }
18 |
19 | .comment {
20 | color: blue;
21 | }
22 |
23 | .flat {
24 | border: 1px solid gray;
25 | background-color: #CCCCCC;
26 | padding: 10px;
27 | }
28 |
29 | #outergbox {
30 | position: absolute;
31 | height: 100%;
32 | width: 100%;
33 | }
34 |
35 |
--------------------------------------------------------------------------------