({url, scriptId})
| 18 | }).then(params => loadScript(params)); |
| 19 | |
| 20 | async function loadScript({url, scriptId}) { |
| 21 | InspectorTest.log(`Session #${sessionId}: Script parsed. URL: ${url}.`); |
| 22 | ({result: {scriptSource, bytecode}} = |
| 23 | await Protocol.Debugger.getScriptSource({scriptId})); |
| 24 | ({result: { |
| 25 | streamId, |
| 26 | totalNumberOfLines, |
| 27 | functionBodyOffsets, |
| 28 | chunk: {lines, bytecodeOffsets} |
| 29 | }} = await Protocol.Debugger.disassembleWasmModule({scriptId})); |
| 30 | |
| 31 | InspectorTest.log(`Session #${sessionId}: Source for ${url}:`); |
| 32 | bytecode = InspectorTest.decodeBase64(bytecode); |
| 33 | const bytes = []; |
| 34 | for (let i = 0; i < bytecode.length; i++) { |
| 35 | let byte = bytecode[i]; |
| 36 | bytes.push((byte < 0x10 ? '0x0' : '0x') + byte.toString(16) + " "); |
| 37 | if ((i & 7) == 7) bytes.push(` ;; offset ${i-7}..${i}\n`); |
| 38 | } |
| 39 | InspectorTest.log(`bytecode:\n${bytes.join("")}`); |
| 40 | |
| 41 | InspectorTest.log(`streamid: ${streamId}`); |
| 42 | InspectorTest.log(`functionBodyOffsets: ${functionBodyOffsets}`); |
| 43 | InspectorTest.log(`totalNumberOfLines: ${totalNumberOfLines}`); |
| 44 | InspectorTest.log(`lines: \n${lines.join("\n")}`); |
| 45 | InspectorTest.log(`bytecodeOffsets: ${bytecodeOffsets}`); |
| 46 | |
| 47 | if (streamId) { |
| 48 | ({result: {chunk: {lines, bytecodeOffsets}}} = |
| 49 | await Protocol.Debugger.nextWasmDissassemblyChunk({streamId})); |
| 50 | InspectorTest.log(`chunk #2:`); |
| 51 | InspectorTest.log(`lines: \n${lines.join("\n")}`); |
| 52 | InspectorTest.log(`bytecodeOffsets: ${bytecodeOffsets}`); |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | const builder = new WasmModuleBuilder(); |
| 57 | builder.addFunction('f1', kSig_i_r) |
no test coverage detected