forked from bmeurer/emscripten-dbg-stories
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stepping-with-state-and-threads-sourcemaps.html
50 lines (47 loc) · 2 KB
/
stepping-with-state-and-threads-sourcemaps.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html>
<head>
<title>Step with state</title>
<script src="stepping-with-state-and-threads.js"></script>
</head>
<body>
<h1>Stepping in original source with state and threads</h1>
<p>
This tests that we can successfully complete a debugging session with source maps, including
setting breakpoints, deleting breakpoints, and stepping.
</p>
<h2>Steps</h2>
<p>
<li>Inspect main thread:</li>
<ol>
<li>Open DevTools</li>
<li>Open stepping-with-state-and-threads.c</li>
<li>Set a breakpoint at function <code>main</code> on line <code>args *thread_args = (args*) malloc(sizeof(args));
</code></li>
<li>Reload</li>
<li>Breakpoint should hit set breakpoint</li>
<li>Step a few times until the next line is hit and inspect wasm variables</li>
<li>Remove breakpoint</li>
<li>Set a breakpoint at function <code>addConstant</code> on line <code>for (int i = 0; i < length; ++i) {</code></li>
<li>Reload</li>
<li>Breakpoint should hit the new breakpoint</li>
<li>Step a few times and inspect the wasm variables in the scope view</li>
<li>Resume</li>
</ol>
<li>Inspect worker thread:</li>
<ol>
<li>Set a breakpoint at function <code>threadEntryPoint</code> on line <code>args *arguments = (args*) input;</code></li>
<li>Reload</li>
<li>Breakpoint should hit set breakpoint</li>
<li>Step a few times until the next line is hit and inspect wasm variables</li>
<li>Remove breakpoint</li>
<li>Set a breakpoint at function <code>multiplyByConstant</code> on line <code>for (int i = 0; i < length; ++i) {</code></li>
<li>Reload</li>
<li>Breakpoint should hit the new breakpoint</li>
<li>Step a few times until the next line is hit and inspect the wasm variables in the scope view</li>
<li>Remove breakpoint</li>
<li>Resume</li>
</ol>
</p>
</body>
</html>