From b2dcfc3b433829f1e188c93ae131a42251d5d2f3 Mon Sep 17 00:00:00 2001 From: Raoul Schaffranek Date: Tue, 29 Oct 2024 11:34:59 +0100 Subject: [PATCH 1/8] Fix web extension --- package-lock.json | 160 ++++++++++------------------------------ package.json | 2 +- src/DebugAdapter.ts | 2 +- src/DebugAdapter.web.ts | 80 ++++++++++++++++++-- src/extension.web.ts | 11 ++- src/foundry.ts | 48 ++++++------ src/startDebugging.ts | 9 ++- tsconfig.web.json | 7 +- 8 files changed, 160 insertions(+), 159 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3eee916..e426b2b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,12 +35,13 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.25.7.tgz", - "integrity": "sha512-0xZJFNE5XMpENsgfHYTw8FbX4kv53mFLn2i3XPoq69LyhYSCBJtitaHx9QnsVTrsogI4Z3+HtEfZ2/GFPOtf5g==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.0.tgz", + "integrity": "sha512-INCKxTtbXtcNbUZ3YXutwMpEleqttcswhAdee7dhuoVrD2cnuc3PqtERBtxkX5nziX9vnBL8WXmSGwv8CuPV6g==", "dev": true, "dependencies": { - "@babel/highlight": "^7.25.7", + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", "picocolors": "^1.0.0" }, "engines": { @@ -48,100 +49,14 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.7.tgz", - "integrity": "sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", "dev": true, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/highlight": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.25.7.tgz", - "integrity": "sha512-iYyACpW3iW8Fw+ZybQK+drQre+ns/tKpXbNESfrhNnPLIklLbXr7MYJ6gPEd0iETGLOK+SxMjVvKb/ffmk+FEw==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.25.7", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/highlight/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/@babel/highlight/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@babel/highlight/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/@esbuild/aix-ppc64": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", @@ -511,24 +426,27 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", + "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", "dev": true, "dependencies": { - "eslint-visitor-keys": "^3.3.0" + "eslint-visitor-keys": "^3.4.3" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, + "funding": { + "url": "https://opencollective.com/eslint" + }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, "node_modules/@eslint-community/regexpp": { - "version": "4.11.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.1.tgz", - "integrity": "sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" @@ -1178,9 +1096,9 @@ "peer": true }, "node_modules/acorn": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", - "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -1435,9 +1353,9 @@ "dev": true }, "node_modules/browserslist": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.0.tgz", - "integrity": "sha512-Rmb62sR1Zpjql25eSanFGEhAxcFwfA1K0GuQcLoaJBAcENegrQut3hYdhXFF1obQfiDyqIW/cLM5HSJ/9k884A==", + "version": "4.24.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz", + "integrity": "sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg==", "dev": true, "funding": [ { @@ -1455,10 +1373,10 @@ ], "peer": true, "dependencies": { - "caniuse-lite": "^1.0.30001663", - "electron-to-chromium": "^1.5.28", + "caniuse-lite": "^1.0.30001669", + "electron-to-chromium": "^1.5.41", "node-releases": "^2.0.18", - "update-browserslist-db": "^1.1.0" + "update-browserslist-db": "^1.1.1" }, "bin": { "browserslist": "cli.js" @@ -1543,9 +1461,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001669", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001669.tgz", - "integrity": "sha512-DlWzFDJqstqtIVx1zeSpIMLjunf5SmwOw0N2Ck/QSQdS8PLS4+9HrLaYei4w8BIAL7IB/UEDu889d8vhCTPA0w==", + "version": "1.0.30001674", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001674.tgz", + "integrity": "sha512-jOsKlZVRnzfhLojb+Ykb+gyUSp9Xb57So+fAiFlLzzTKpqg8xxSav0e40c8/4F/v9N8QSvrRRaLeVzQbLqomYw==", "dev": true, "funding": [ { @@ -1823,9 +1741,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.5.39", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.39.tgz", - "integrity": "sha512-4xkpSR6CjuiaNyvwiWDI85N9AxsvbPawB8xc7yzLPonYTuP19BVgYweKyUMFtHEZgIcHWMt1ks5Cqx2m+6/Grg==", + "version": "1.5.49", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.49.tgz", + "integrity": "sha512-ZXfs1Of8fDb6z7WEYZjXpgIRF6MEu8JdeGA0A40aZq6OQbS+eJpnnV49epZRna2DU/YsEjSQuGtQPPtvt6J65A==", "dev": true, "peer": true }, @@ -3903,9 +3821,9 @@ } }, "node_modules/picocolors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", - "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "dev": true }, "node_modules/picomatch": { @@ -4644,9 +4562,9 @@ } }, "node_modules/terser": { - "version": "5.34.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.34.1.tgz", - "integrity": "sha512-FsJZ7iZLd/BXkz+4xrRTGJ26o/6VTjQytUk8b8OxkwcD2I+79VPJlz7qss1+zE7h8GNIScFqXcDyJ/KqBYZFVA==", + "version": "5.36.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.36.0.tgz", + "integrity": "sha512-IYV9eNMuFAV4THUspIRXkLakHnV6XO7FEdtKjf/mDyrnqUg9LnlOn6/RwRvM9SZjR4GUq8Nk8zj67FzVARr74w==", "dev": true, "peer": true, "dependencies": { diff --git a/package.json b/package.json index 20453c3..555d724 100644 --- a/package.json +++ b/package.json @@ -210,7 +210,7 @@ "build": "npm run vscode:prepublish", "vscode:prepublish": "npm run esbuild-base -- --minify && npm run esbuild-base-web -- --minify", "esbuild-base": "esbuild ./src/extension.ts --bundle --outfile=build/extension.js --external:vscode --format=cjs --platform=node", - "esbuild-base-web": "esbuild ./src/extension.web.ts --bundle --outfile=build/extension.web.js --external:vscode --format=esm --platform=browser", + "esbuild-base-web": "esbuild ./src/extension.web.ts --bundle --outfile=build/extension.web.js --external:vscode --format=cjs --platform=browser --target=es2020 --minify", "esbuild": "npm run esbuild-base -- --sourcemap", "compile": "tsc -p ./tsconfig.json", "compile-web": "tsc -p ./tsconfig.web.json", diff --git a/src/DebugAdapter.ts b/src/DebugAdapter.ts index dd38a03..cc2f356 100644 --- a/src/DebugAdapter.ts +++ b/src/DebugAdapter.ts @@ -76,7 +76,7 @@ class WebsocketDebugAdapter implements vscode.DebugAdapter { } foundryRoot() : string { - return this.configuration['clientMount'] + return (this.configuration['clientMount'] as vscode.Uri).toString(); } /** diff --git a/src/DebugAdapter.web.ts b/src/DebugAdapter.web.ts index 6ae8e0a..6c278eb 100644 --- a/src/DebugAdapter.web.ts +++ b/src/DebugAdapter.web.ts @@ -15,7 +15,7 @@ export class SolidityDebugAdapterDescriptorFactory const server = getConfigValue('server', 'ws://beta.simbolik.runtimeverification.com:3000'); const websocket = new WebSocket(server); websocket.onopen = () => { - const websocketAdapter = new WebsocketDebugAdapter(websocket); + const websocketAdapter = new WebsocketDebugAdapter(websocket, session.configuration); const implementation = new vscode.DebugAdapterInlineImplementation(websocketAdapter); resolve(implementation); }; @@ -45,22 +45,88 @@ export class SolidityDebugAdapterDescriptorFactory class WebsocketDebugAdapter implements vscode.DebugAdapter { _onDidSendMessage = new vscode.EventEmitter(); - constructor(private websocket: WebSocket) { + constructor(private websocket: WebSocket, private configuration: vscode.DebugConfiguration) { websocket.onmessage = (message: MessageEvent) => { - message.data.text().then((payload: string) => { - const json = JSON.parse(payload); - this._onDidSendMessage.fire(json); - }); + const data = JSON.parse(message.data); + const dataWithAbsolutePaths = this.prependPaths(data); + this._onDidSendMessage.fire(dataWithAbsolutePaths); }; } onDidSendMessage = this._onDidSendMessage.event; handleMessage(message: vscode.DebugProtocolMessage): void { - this.websocket.send(JSON.stringify(message)); + const messageWithRelativePaths = this.trimPaths(message); + this.websocket.send(JSON.stringify(messageWithRelativePaths)); } dispose() { this.websocket.close(); } + + + foundryRoot() : string { + const uri = vscode.Uri.from(this.configuration['clientMount']); + return uri.toString(); + } + + /** + * Recursively walk over all object properties and for each property + * named `path` and type `string`, remove the foundry root from the path. + * @param message + */ + trimPaths(message: {[key: string]: any} | any[] ) : {[key: string]: any} | any[] { + if (Array.isArray(message)) { + return message.map((item) => this.trimPaths(item)); + } else if (message instanceof Object) { + const result = Object.assign({}, message); + for (const key in message) { + if (['path', 'symbolFilePath'].includes(key) && typeof message[key] === 'string') { + console.log('before', result[key]); + result[key] = stripPrefix(message[key], this.foundryRoot()); + console.log('after', result[key]); + } else if (key == 'file' && typeof message[key] === 'string') { + console.log('before', result[key]); + result[key] = stripPrefix(message[key], this.foundryRoot()); + console.log('after', result[key]); + } else if (typeof message[key] === 'object') { + result[key] = this.trimPaths(message[key]); + } + } + return result; + } + return message; + } + + /** + * Recursively walk over all object properties and for each property + * named `path` and type `string`, prepend the foundry root to the path. + * @param message + */ + prependPaths(message: {[key: string]: any} | any[]) : {[key: string]: any} | any[] { + if (Array.isArray(message)) { + return message.map((item) => this.prependPaths(item)); + } else if (message instanceof Object) { + const result = Object.assign({}, message); + for (const key in message) { + if (['path', 'symbolFilePath', 'file'].includes(key) && typeof message[key] === 'string') { + result[key] = `${this.foundryRoot()}/${message[key]}`; + } else if (key == 'file' && typeof message[key] === 'string') { + result[key] = `file://${this.foundryRoot()}/${message[key]}`; + } else if (typeof message[key] === 'object') { + result[key] = this.prependPaths(message[key]); + } + } + return result; + } + return message; + } } + + +function stripPrefix(s: string, prefix: string): string { + if (s.startsWith(prefix)) { + return s.slice(prefix.length); + } + return s; +} \ No newline at end of file diff --git a/src/extension.web.ts b/src/extension.web.ts index caaf109..6f16cc0 100644 --- a/src/extension.web.ts +++ b/src/extension.web.ts @@ -6,6 +6,8 @@ import {SolidityDebugAdapterDescriptorFactory} from './DebugAdapter.web'; import {startDebugging} from './startDebugging'; import {KastProvider, viewKast} from './KastProvider'; +console.log("Hello from Simbolik!"); + const outputChannel = vscode.window.createOutputChannel( 'Simbolik Solidity Debugger', {log: true} @@ -36,7 +38,7 @@ export function activate(context: vscode.ExtensionContext) { disposable = vscode.commands.registerCommand( 'simbolik.startDebugging', - startDebugging + (contract, method) => startDebugging(contract, method), ); context.subscriptions.push(disposable); @@ -51,6 +53,13 @@ export function activate(context: vscode.ExtensionContext) { vscode.debug.onDidStartDebugSession(session => { outputChannel.info(`Debug session started: ${session.id}`); + if (session.type === 'solidity') { + vscode.commands.executeCommand('debug.action.openDisassemblyView'); + } + }); + + vscode.debug.onDidTerminateDebugSession(session => { + outputChannel.info(`Debug session ended: ${session.id}`); }); } diff --git a/src/foundry.ts b/src/foundry.ts index 33853f1..8f87dd9 100644 --- a/src/foundry.ts +++ b/src/foundry.ts @@ -3,10 +3,10 @@ import {getConfigValue} from './utils'; import {parse as parseToml} from 'smol-toml'; export -function forgeBuildTask(file: string) { +function forgeBuildTask(file: vscode.Uri) { const incrementalBuild = getConfigValue('incremental-build', false); const forgePath = getConfigValue('forge-path', 'forge'); - const cwd = file.substring(0, file.lastIndexOf('/')); + const cwd = file.with({path: file.path.split('/').slice(0, -1).join('/')}).fsPath; const task = new vscode.Task( { label: 'forge build', @@ -33,56 +33,59 @@ function forgeBuildTask(file: string) { } export -async function loadBuildInfo(file: string): Promise { +async function loadBuildInfo(file: vscode.Uri): Promise { const root = await foundryRoot(file); const buildInfo = await forgeBuildInfo(root); return buildInfo; } export -async function foundryRoot(file: string) { +async function foundryRoot(file: vscode.Uri): Promise { // Find the root of the project, which is the directory containing the foundry.toml file - let root = file; + let base = file.with({'path': '/'}) + let pathSegments = file.path.split('/'); let stat; try { - stat = await vscode.workspace.fs.stat(vscode.Uri.file(`${root}/foundry.toml`)); + const uri = vscode.Uri.joinPath(base, ...pathSegments, 'foundry.toml'); + stat = await vscode.workspace.fs.stat(uri); } catch (e) { stat = false; } while (!stat) { - const lastSlash = root.lastIndexOf('/'); - if (lastSlash === -1) { - throw new Error('Could not find foundry.toml'); + if (pathSegments.length === 0) { + throw new Error('No foundry.toml found'); } - root = root.substring(0, lastSlash); + pathSegments.pop(); try { - stat = await vscode.workspace.fs.stat(vscode.Uri.file(`${root}/foundry.toml`)); + const uri = vscode.Uri.joinPath(base, ...pathSegments, 'foundry.toml'); + stat = await vscode.workspace.fs.stat(uri); } catch (e) { stat = false; } } - return root; + return vscode.Uri.joinPath(base, ...pathSegments); } export type FoundryConfig = { 'profile'?: { [profile: string]: { [key: string]: string } } }; export -async function foundryConfig(root: string): Promise { - const configPath = `${root}/foundry.toml`; - const config = await vscode.workspace.fs.readFile(vscode.Uri.file(configPath)); - return parseToml(config.toString()); +async function foundryConfig(root: vscode.Uri): Promise { + const configPath = vscode.Uri.joinPath(root, 'foundry.toml'); + const config = await vscode.workspace.fs.readFile(configPath); + const text = new TextDecoder().decode(config); + return parseToml(text); } -async function forgeBuildInfo(root: string): Promise { +async function forgeBuildInfo(root: vscode.Uri): Promise { const config = await foundryConfig(root); const out = config?.profile?.default?.out ?? 'out'; // Get the contents of the youngest build-info file - const buildInfoDir = `${root}/${out}/build-info`; + const buildInfoDir = vscode.Uri.joinPath(root, out, 'build-info'); // Get list of build-info files - const files = await vscode.workspace.fs.readDirectory(vscode.Uri.file(buildInfoDir)); + const files = await vscode.workspace.fs.readDirectory(buildInfoDir); const buildInfoFiles = files.filter(([file, type]) => type === vscode.FileType.File && file.endsWith('.json')); if (buildInfoFiles.length === 0) { @@ -95,13 +98,14 @@ async function forgeBuildInfo(root: string): Promise { // Read the youngest build-info file const youngestBuildInfo = await vscode.workspace.fs.readFile(sortedFiles[0].uri); - return youngestBuildInfo.toString(); + const text = new TextDecoder().decode(youngestBuildInfo); + return text; } -async function getSortedFilesByCreationTime(buildInfoDir: string, buildInfoFiles: [string, vscode.FileType][]): Promise<{ file: string, uri: vscode.Uri, ctime: number }[]> { +async function getSortedFilesByCreationTime(buildInfoDir: vscode.Uri, buildInfoFiles: [string, vscode.FileType][]): Promise<{ file: string, uri: vscode.Uri, ctime: number }[]> { const filesWithStats = await Promise.all( buildInfoFiles.map(async ([file]) => { - const fileUri = vscode.Uri.file(`${buildInfoDir}/${file}`); + const fileUri = vscode.Uri.joinPath(buildInfoDir, file); const fileStat = await vscode.workspace.fs.stat(fileUri); return { file, uri: fileUri, ctime: fileStat.ctime }; }) diff --git a/src/startDebugging.ts b/src/startDebugging.ts index 4332c84..f9f48ba 100644 --- a/src/startDebugging.ts +++ b/src/startDebugging.ts @@ -57,7 +57,7 @@ export async function startDebugging( const sourcifyUrl = getConfigValue('sourcify-url', 'http://localhost:5555'); const autobuild = getConfigValue('autobuild', true); if (autobuild) { - const build = forgeBuildTask(activeTextEditor.document.uri.fsPath); + const build = forgeBuildTask(activeTextEditor.document.uri); const buildExecution = await vscode.tasks.executeTask(build); try { await completed(buildExecution); @@ -65,8 +65,8 @@ export async function startDebugging( vscode.window.showErrorMessage('Failed to build project.'); } } - const myFoundryRoot = await foundryRoot(activeTextEditor.document.uri.fsPath); - const buildInfo = await loadBuildInfo(activeTextEditor.document.uri.fsPath); + const myFoundryRoot = await foundryRoot(activeTextEditor.document.uri); + const buildInfo = await loadBuildInfo(activeTextEditor.document.uri); const myDebugConfig = debugConfig( debugConfigName, file, @@ -79,6 +79,7 @@ export async function startDebugging( buildInfo, myFoundryRoot ); + console.log(myDebugConfig); const session = await vscode.debug.startDebugging( workspaceFolder, myDebugConfig @@ -109,7 +110,7 @@ function debugConfig( jsonRpcUrl: string, sourcifyUrl: string, buildInfo: string, - clientMount: string + clientMount: vscode.Uri ) { return { name: name, diff --git a/tsconfig.web.json b/tsconfig.web.json index 4e81f55..7adcb77 100644 --- a/tsconfig.web.json +++ b/tsconfig.web.json @@ -3,8 +3,11 @@ "compilerOptions": { "rootDir": "src", "outDir": "build-web", - "lib": ["ES2020", "DOM"], - "target": "ES2020" + "lib": ["ES2022", "DOM"], + "target": "ES2022", + "moduleResolution": "node", + "esModuleInterop": true, + "sourceMap": true }, "include": [ "src/**/*.ts", From 03250d20e53412b1bad81a84dd834bcbd11fa611 Mon Sep 17 00:00:00 2001 From: Raoul Schaffranek Date: Tue, 29 Oct 2024 21:27:45 +0100 Subject: [PATCH 2/8] Fix typo --- src/DebugAdapter.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DebugAdapter.ts b/src/DebugAdapter.ts index cc2f356..d1097b6 100644 --- a/src/DebugAdapter.ts +++ b/src/DebugAdapter.ts @@ -56,8 +56,8 @@ class WebsocketDebugAdapter implements vscode.DebugAdapter { websocket.onmessage = (message: MessageEvent) => { const payload = message.data.toString(); const data = JSON.parse(payload); - const dataWithAbsolutePaht = this.prependPaths(data); - this._onDidSendMessage.fire(dataWithAbsolutePaht); + const dataWithAbsolutePaths = this.prependPaths(data); + this._onDidSendMessage.fire(dataWithAbsolutePaths); }; } From 78c07d85d5ab9504269a7272873f00c44534a329 Mon Sep 17 00:00:00 2001 From: Raoul Schaffranek Date: Tue, 29 Oct 2024 21:28:37 +0100 Subject: [PATCH 3/8] Decorate debugging requests with API key --- src/DebugAdapter.web.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/DebugAdapter.web.ts b/src/DebugAdapter.web.ts index 6c278eb..1b07123 100644 --- a/src/DebugAdapter.web.ts +++ b/src/DebugAdapter.web.ts @@ -42,11 +42,17 @@ export class SolidityDebugAdapterDescriptorFactory } } +type WithApiKey = { apiKey: string }; +type WithClientVersion = { clientVersion: string }; + +type DebugProtocolMessage = vscode.DebugProtocolMessage & WithApiKey & WithClientVersion; + class WebsocketDebugAdapter implements vscode.DebugAdapter { _onDidSendMessage = new vscode.EventEmitter(); constructor(private websocket: WebSocket, private configuration: vscode.DebugConfiguration) { websocket.onmessage = (message: MessageEvent) => { + console.log('Received message', message); const data = JSON.parse(message.data); const dataWithAbsolutePaths = this.prependPaths(data); this._onDidSendMessage.fire(dataWithAbsolutePaths); @@ -56,7 +62,12 @@ class WebsocketDebugAdapter implements vscode.DebugAdapter { onDidSendMessage = this._onDidSendMessage.event; handleMessage(message: vscode.DebugProtocolMessage): void { - const messageWithRelativePaths = this.trimPaths(message); + console.log('Sending message', message); + const apiKey = getConfigValue('api-key', ''); + const clientVersion = vscode.extensions.getExtension('simbolik.simbolik')?.packageJSON.version; + const messageWithApiKey : DebugProtocolMessage = Object.assign({}, message, {apiKey, clientVersion}); + const messageWithRelativePaths = this.trimPaths(messageWithApiKey); + console.log('Sending message with relative paths', messageWithRelativePaths); this.websocket.send(JSON.stringify(messageWithRelativePaths)); } From 65771da710cad50ba42c14186a453f8641d775a4 Mon Sep 17 00:00:00 2001 From: Raoul Schaffranek Date: Thu, 31 Oct 2024 17:40:33 +0100 Subject: [PATCH 4/8] Fix path mapping --- src/DebugAdapter.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DebugAdapter.ts b/src/DebugAdapter.ts index 6d47511..45c8d37 100644 --- a/src/DebugAdapter.ts +++ b/src/DebugAdapter.ts @@ -76,7 +76,7 @@ class WebsocketDebugAdapter implements vscode.DebugAdapter { } foundryRoot() : string { - return (this.configuration['clientMount'] as vscode.Uri).toString(); + return vscode.Uri.from(this.configuration['clientMount']).toString(); } /** @@ -93,7 +93,7 @@ class WebsocketDebugAdapter implements vscode.DebugAdapter { if (['path', 'symbolFilePath'].includes(key) && typeof message[key] === 'string') { result[key] = stripPrefix(message[key], `${this.foundryRoot()}/`); } else if (key == 'file' && typeof message[key] === 'string') { - result[key] = stripPrefix(message[key], `file://${this.foundryRoot()}/`); + result[key] = stripPrefix(message[key], `${this.foundryRoot()}/`); } else if (typeof message[key] === 'object') { result[key] = this.trimPaths(message[key]); } From 662bd7d0730c58134d3b65966e0a5ff6da80692a Mon Sep 17 00:00:00 2001 From: Raoul Schaffranek Date: Thu, 31 Oct 2024 23:37:39 +0100 Subject: [PATCH 5/8] Disable disassembly view by default --- package.json | 2 +- src/extension.ts | 3 ++- src/foundry.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 7eec8bb..82bee4d 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "simbolik.auto-open-disassembly-view": { "type": "boolean", "description": "If set to true, the debugger will automatically open the disassembly view when starting a debugging session.", - "default": true, + "default": false, "order": 8 }, "simbolik.json-rpc-url": { diff --git a/src/extension.ts b/src/extension.ts index 38e93a9..21c561c 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -83,10 +83,11 @@ export function activate(context: vscode.ExtensionContext) { kastProvider ); + vscode.debug.onDidStartDebugSession(session => { outputChannel.info(`Debug session started: ${session.id}`); if (session.type === 'solidity') { - if (getConfigValue('auto-open-disassembly-view', true)) { + if (getConfigValue('auto-open-disassembly-view', false)) { vscode.commands.executeCommand('debug.action.openDisassemblyView'); } } diff --git a/src/foundry.ts b/src/foundry.ts index 8f87dd9..edf2bcd 100644 --- a/src/foundry.ts +++ b/src/foundry.ts @@ -20,7 +20,7 @@ function forgeBuildTask(file: vscode.Uri) { env: { 'FOUNDRY_OPTIMIZER': 'false', 'FOUNDRY_BUILD_INFO': 'true', - 'FOUNDRY_EXTRA_OUTPUT': '["storageLayout", "evm.bytecode.generatedSources", "evm.legacyAssembly"]', + 'FOUNDRY_EXTRA_OUTPUT': '["storageLayout", "evm.bytecode.generatedSources", "evm.legacyAssembly", "evm.deployedBytecode.immutableReferences"]', 'FOUNDRY_BYTECODE_HASH': 'ipfs', 'FOUNDRY_CBOR_METADATA': 'true', 'FOUNDRY_FORCE': incrementalBuild ? 'false' : 'true', From 79ebe05b2d358c4f41465ec33a5197834ed9cf68 Mon Sep 17 00:00:00 2001 From: Raoul Schaffranek Date: Fri, 1 Nov 2024 17:54:23 +0100 Subject: [PATCH 6/8] Don't open disassembly view automatically --- src/extension.ts | 2 +- src/extension.web.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index 21c561c..a2e7e77 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -89,7 +89,7 @@ export function activate(context: vscode.ExtensionContext) { if (session.type === 'solidity') { if (getConfigValue('auto-open-disassembly-view', false)) { vscode.commands.executeCommand('debug.action.openDisassemblyView'); - } + } } }); diff --git a/src/extension.web.ts b/src/extension.web.ts index 6f16cc0..8a23374 100644 --- a/src/extension.web.ts +++ b/src/extension.web.ts @@ -5,6 +5,7 @@ import {CodelensProvider} from './CodelensProvider'; import {SolidityDebugAdapterDescriptorFactory} from './DebugAdapter.web'; import {startDebugging} from './startDebugging'; import {KastProvider, viewKast} from './KastProvider'; +import {getConfigValue} from './utils'; console.log("Hello from Simbolik!"); @@ -54,7 +55,9 @@ export function activate(context: vscode.ExtensionContext) { vscode.debug.onDidStartDebugSession(session => { outputChannel.info(`Debug session started: ${session.id}`); if (session.type === 'solidity') { - vscode.commands.executeCommand('debug.action.openDisassemblyView'); + if (getConfigValue('auto-open-disassembly-view', false)) { + vscode.commands.executeCommand('debug.action.openDisassemblyView'); + } } }); From bf723a64a075b629c2339cab9814432beb393084 Mon Sep 17 00:00:00 2001 From: Raoul Schaffranek Date: Mon, 4 Nov 2024 09:27:39 +0100 Subject: [PATCH 7/8] Fix Breakpoints --- src/DebugAdapter.ts | 24 +++++++++++++++++++----- src/DebugAdapter.web.ts | 33 ++++++++++++++++++++------------- 2 files changed, 39 insertions(+), 18 deletions(-) diff --git a/src/DebugAdapter.ts b/src/DebugAdapter.ts index 45c8d37..0ec1ba3 100644 --- a/src/DebugAdapter.ts +++ b/src/DebugAdapter.ts @@ -75,8 +75,12 @@ class WebsocketDebugAdapter implements vscode.DebugAdapter { this.websocket.close(); } - foundryRoot() : string { - return vscode.Uri.from(this.configuration['clientMount']).toString(); + foundryRoot() : vscode.Uri { + if (!this.configuration['clientMount']) { + return vscode.Uri.parse('file:///'); + } + const uri = vscode.Uri.from(this.configuration['clientMount']); + return uri; } /** @@ -91,9 +95,11 @@ class WebsocketDebugAdapter implements vscode.DebugAdapter { const result = Object.assign({}, message); for (const key in message) { if (['path', 'symbolFilePath'].includes(key) && typeof message[key] === 'string') { - result[key] = stripPrefix(message[key], `${this.foundryRoot()}/`); + const uri = vscode.Uri.parse(message[key]); + result[key] = relativeTo(uri, this.foundryRoot()); } else if (key == 'file' && typeof message[key] === 'string') { - result[key] = stripPrefix(message[key], `${this.foundryRoot()}/`); + const uri = vscode.Uri.parse(message[key]); + result[key] = relativeTo(uri, this.foundryRoot()); } else if (typeof message[key] === 'object') { result[key] = this.trimPaths(message[key]); } @@ -117,7 +123,7 @@ class WebsocketDebugAdapter implements vscode.DebugAdapter { if (['path', 'symbolFilePath', 'file'].includes(key) && typeof message[key] === 'string') { result[key] = `${this.foundryRoot()}/${message[key]}`; } else if (key == 'file' && typeof message[key] === 'string') { - result[key] = `file://${this.foundryRoot()}/${message[key]}`; + result[key] = `${this.foundryRoot()}/${message[key]}`; } else if (typeof message[key] === 'object') { result[key] = this.prependPaths(message[key]); } @@ -129,6 +135,14 @@ class WebsocketDebugAdapter implements vscode.DebugAdapter { } +function relativeTo(uri: vscode.Uri, prefixUri: vscode.Uri): string { + const s = uri.path; + const prefix = prefixUri.path + '/'; + const relative = stripPrefix(s, prefix); + const result = stripPrefix(relative, '/'); + return result; +} + function stripPrefix(s: string, prefix: string): string { if (s.startsWith(prefix)) { return s.slice(prefix.length); diff --git a/src/DebugAdapter.web.ts b/src/DebugAdapter.web.ts index b94d982..fbd4e34 100644 --- a/src/DebugAdapter.web.ts +++ b/src/DebugAdapter.web.ts @@ -52,7 +52,6 @@ class WebsocketDebugAdapter implements vscode.DebugAdapter { constructor(private websocket: WebSocket, private configuration: vscode.DebugConfiguration) { websocket.onmessage = (message: MessageEvent) => { - console.log('Received message', message); const data = JSON.parse(message.data); const dataWithAbsolutePaths = this.prependPaths(data); this._onDidSendMessage.fire(dataWithAbsolutePaths); @@ -62,12 +61,10 @@ class WebsocketDebugAdapter implements vscode.DebugAdapter { onDidSendMessage = this._onDidSendMessage.event; handleMessage(message: vscode.DebugProtocolMessage): void { - console.log('Sending message', message); const apiKey = getConfigValue('api-key', ''); const clientVersion = vscode.extensions.getExtension('simbolik.simbolik')?.packageJSON.version; const messageWithApiKey : DebugProtocolMessage = Object.assign({}, message, {apiKey, clientVersion}); const messageWithRelativePaths = this.trimPaths(messageWithApiKey); - console.log('Sending message with relative paths', messageWithRelativePaths); this.websocket.send(JSON.stringify(messageWithRelativePaths)); } @@ -75,10 +72,12 @@ class WebsocketDebugAdapter implements vscode.DebugAdapter { this.websocket.close(); } - - foundryRoot() : string { + foundryRoot() : vscode.Uri { + if (!this.configuration['clientMount']) { + return vscode.Uri.parse('file:///'); + } const uri = vscode.Uri.from(this.configuration['clientMount']); - return uri.toString(); + return uri; } /** @@ -93,13 +92,11 @@ class WebsocketDebugAdapter implements vscode.DebugAdapter { const result = Object.assign({}, message); for (const key in message) { if (['path', 'symbolFilePath'].includes(key) && typeof message[key] === 'string') { - console.log('before', result[key]); - result[key] = stripPrefix(message[key], this.foundryRoot()); - console.log('after', result[key]); + const uri = vscode.Uri.parse(message[key]); + result[key] = relativeTo(uri, this.foundryRoot()); } else if (key == 'file' && typeof message[key] === 'string') { - console.log('before', result[key]); - result[key] = stripPrefix(message[key], this.foundryRoot()); - console.log('after', result[key]); + const uri = vscode.Uri.parse(message[key]); + result[key] = relativeTo(uri, this.foundryRoot()); } else if (typeof message[key] === 'object') { result[key] = this.trimPaths(message[key]); } @@ -123,7 +120,7 @@ class WebsocketDebugAdapter implements vscode.DebugAdapter { if (['path', 'symbolFilePath', 'file'].includes(key) && typeof message[key] === 'string') { result[key] = `${this.foundryRoot()}/${message[key]}`; } else if (key == 'file' && typeof message[key] === 'string') { - result[key] = `file://${this.foundryRoot()}/${message[key]}`; + result[key] = `${this.foundryRoot()}/${message[key]}`; } else if (typeof message[key] === 'object') { result[key] = this.prependPaths(message[key]); } @@ -134,6 +131,16 @@ class WebsocketDebugAdapter implements vscode.DebugAdapter { } } +function relativeTo(uri: vscode.Uri, prefixUri: vscode.Uri): string { + const s = uri.path; + const prefix = prefixUri.path; + const relative = stripPrefix(s, prefix); + const result = stripPrefix(relative, '/'); + console.log('uri', uri); + console.log('prefixUri', prefixUri); + console.log('result', result); + return result; +} function stripPrefix(s: string, prefix: string): string { if (s.startsWith(prefix)) { From 04a2d027793966760333142c1bbf8cced1e2c7b9 Mon Sep 17 00:00:00 2001 From: Raoul Schaffranek Date: Sat, 9 Nov 2024 18:44:19 +0100 Subject: [PATCH 8/8] Version bump --- package-lock.json | 246 ++++++++++++++++++++++++---------------------- package.json | 2 +- 2 files changed, 130 insertions(+), 118 deletions(-) diff --git a/package-lock.json b/package-lock.json index 476ea5d..66dd385 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "simbolik", - "version": "3.1.1", + "version": "4.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "simbolik", - "version": "3.1.1", + "version": "4.0.0", "dependencies": { "@solidity-parser/parser": "^0.18.0", "@types/ws": "^8.5.10", @@ -35,9 +35,9 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.0.tgz", - "integrity": "sha512-INCKxTtbXtcNbUZ3YXutwMpEleqttcswhAdee7dhuoVrD2cnuc3PqtERBtxkX5nziX9vnBL8WXmSGwv8CuPV6g==", + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.25.9", @@ -635,6 +635,28 @@ "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.18.0.tgz", "integrity": "sha512-yfORGUIPgLck41qyN7nbwJRAx17/jAIXCTanHOJZhB6PJ1iAk/84b/xlsVKFSyNyLXIj0dhppoE0+CRws7wlzA==" }, + "node_modules/@types/eslint": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", + "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==", + "dev": true, + "peer": true, + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "node_modules/@types/eslint-scope": { + "version": "3.7.7", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", + "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", + "dev": true, + "peer": true, + "dependencies": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, "node_modules/@types/estree": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", @@ -703,9 +725,9 @@ "dev": true }, "node_modules/@types/ws": { - "version": "8.5.12", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.12.tgz", - "integrity": "sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ==", + "version": "8.5.13", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.13.tgz", + "integrity": "sha512-osM/gWBTPKgHV8XkTunnegTRIsvF6owmf5w+JtAfOw472dptdm0dlGv4xCt6GwQRcC2XVOvvRE/0bAoQcL2QkA==", "dependencies": { "@types/node": "*" } @@ -921,73 +943,73 @@ } }, "node_modules/@webassemblyjs/ast": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", - "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz", + "integrity": "sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==", "dev": true, "peer": true, "dependencies": { - "@webassemblyjs/helper-numbers": "1.11.6", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6" + "@webassemblyjs/helper-numbers": "1.13.2", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2" } }, "node_modules/@webassemblyjs/floating-point-hex-parser": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz", - "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz", + "integrity": "sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA==", "dev": true, "peer": true }, "node_modules/@webassemblyjs/helper-api-error": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz", - "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz", + "integrity": "sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ==", "dev": true, "peer": true }, "node_modules/@webassemblyjs/helper-buffer": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz", - "integrity": "sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz", + "integrity": "sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA==", "dev": true, "peer": true }, "node_modules/@webassemblyjs/helper-numbers": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz", - "integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz", + "integrity": "sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA==", "dev": true, "peer": true, "dependencies": { - "@webassemblyjs/floating-point-hex-parser": "1.11.6", - "@webassemblyjs/helper-api-error": "1.11.6", + "@webassemblyjs/floating-point-hex-parser": "1.13.2", + "@webassemblyjs/helper-api-error": "1.13.2", "@xtuc/long": "4.2.2" } }, "node_modules/@webassemblyjs/helper-wasm-bytecode": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz", - "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz", + "integrity": "sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA==", "dev": true, "peer": true }, "node_modules/@webassemblyjs/helper-wasm-section": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz", - "integrity": "sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz", + "integrity": "sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw==", "dev": true, "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.12.1", - "@webassemblyjs/helper-buffer": "1.12.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/wasm-gen": "1.12.1" + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/wasm-gen": "1.14.1" } }, "node_modules/@webassemblyjs/ieee754": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz", - "integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz", + "integrity": "sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw==", "dev": true, "peer": true, "dependencies": { @@ -995,9 +1017,9 @@ } }, "node_modules/@webassemblyjs/leb128": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.6.tgz", - "integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.13.2.tgz", + "integrity": "sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw==", "dev": true, "peer": true, "dependencies": { @@ -1005,79 +1027,79 @@ } }, "node_modules/@webassemblyjs/utf8": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.6.tgz", - "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.13.2.tgz", + "integrity": "sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ==", "dev": true, "peer": true }, "node_modules/@webassemblyjs/wasm-edit": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz", - "integrity": "sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz", + "integrity": "sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==", "dev": true, "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.12.1", - "@webassemblyjs/helper-buffer": "1.12.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/helper-wasm-section": "1.12.1", - "@webassemblyjs/wasm-gen": "1.12.1", - "@webassemblyjs/wasm-opt": "1.12.1", - "@webassemblyjs/wasm-parser": "1.12.1", - "@webassemblyjs/wast-printer": "1.12.1" + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/helper-wasm-section": "1.14.1", + "@webassemblyjs/wasm-gen": "1.14.1", + "@webassemblyjs/wasm-opt": "1.14.1", + "@webassemblyjs/wasm-parser": "1.14.1", + "@webassemblyjs/wast-printer": "1.14.1" } }, "node_modules/@webassemblyjs/wasm-gen": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz", - "integrity": "sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz", + "integrity": "sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg==", "dev": true, "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.12.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/ieee754": "1.11.6", - "@webassemblyjs/leb128": "1.11.6", - "@webassemblyjs/utf8": "1.11.6" + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/ieee754": "1.13.2", + "@webassemblyjs/leb128": "1.13.2", + "@webassemblyjs/utf8": "1.13.2" } }, "node_modules/@webassemblyjs/wasm-opt": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz", - "integrity": "sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz", + "integrity": "sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw==", "dev": true, "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.12.1", - "@webassemblyjs/helper-buffer": "1.12.1", - "@webassemblyjs/wasm-gen": "1.12.1", - "@webassemblyjs/wasm-parser": "1.12.1" + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/wasm-gen": "1.14.1", + "@webassemblyjs/wasm-parser": "1.14.1" } }, "node_modules/@webassemblyjs/wasm-parser": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz", - "integrity": "sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz", + "integrity": "sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==", "dev": true, "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.12.1", - "@webassemblyjs/helper-api-error": "1.11.6", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/ieee754": "1.11.6", - "@webassemblyjs/leb128": "1.11.6", - "@webassemblyjs/utf8": "1.11.6" + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-api-error": "1.13.2", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/ieee754": "1.13.2", + "@webassemblyjs/leb128": "1.13.2", + "@webassemblyjs/utf8": "1.13.2" } }, "node_modules/@webassemblyjs/wast-printer": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz", - "integrity": "sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz", + "integrity": "sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==", "dev": true, "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/ast": "1.14.1", "@xtuc/long": "4.2.2" } }, @@ -1107,16 +1129,6 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-import-attributes": { - "version": "1.9.5", - "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", - "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", - "dev": true, - "peer": true, - "peerDependencies": { - "acorn": "^8" - } - }, "node_modules/acorn-jsx": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", @@ -1461,9 +1473,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001675", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001675.tgz", - "integrity": "sha512-/wV1bQwPrkLiQMjaJF5yUMVM/VdRPOCU8QZ+PmG6uW6DvYSrNY1bpwHI/3mOcUosLaJCzYDi5o91IQB51ft6cg==", + "version": "1.0.30001679", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001679.tgz", + "integrity": "sha512-j2YqID/YwpLnKzCmBOS4tlZdWprXm3ZmQLBH9ZBXFOhoxLA46fwyBvx6toCBWBmnuwUY/qB3kEU6gFx8qgCroA==", "dev": true, "funding": [ { @@ -1631,9 +1643,9 @@ "dev": true }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.5.tgz", + "integrity": "sha512-ZVJrKKYunU38/76t0RMOulHOnUcbU9GbpWKAOZ0mhjr7CX6FVrH+4FrAapSOekrgFQ3f/8gwMEuIft0aKq6Hug==", "dev": true, "dependencies": { "path-key": "^3.1.0", @@ -1741,9 +1753,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.5.49", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.49.tgz", - "integrity": "sha512-ZXfs1Of8fDb6z7WEYZjXpgIRF6MEu8JdeGA0A40aZq6OQbS+eJpnnV49epZRna2DU/YsEjSQuGtQPPtvt6J65A==", + "version": "1.5.55", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.55.tgz", + "integrity": "sha512-6maZ2ASDOTBtjt9FhqYPRnbvKU5tjG0IN9SztUOWYw2AzNDNpKJYLJmlK0/En4Hs/aiWnB+JZ+gW19PIGszgKg==", "dev": true, "peer": true }, @@ -3356,9 +3368,9 @@ } }, "node_modules/mocha": { - "version": "10.8.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.1.tgz", - "integrity": "sha512-WxSpEWgF03HfgNKBuysfK40DUaOSVX5zxgLDoieMGO+zyE69iq2eQ1vBypvIJ5mOPKpuVAqWiTbt4Orj7L6wVw==", + "version": "10.8.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz", + "integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==", "dev": true, "dependencies": { "ansi-colors": "^4.1.3", @@ -4547,9 +4559,9 @@ } }, "node_modules/synckit/node_modules/tslib": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.0.tgz", - "integrity": "sha512-jWVzBLplnCmoaTr13V9dYbiQ99wvZRd0vNWaDRg+aVYRcjDF3nDksxFDE/+fkXnKhpnUUkmx5pK/v8mCtLVqZA==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "dev": true }, "node_modules/tapable": { @@ -4814,19 +4826,19 @@ } }, "node_modules/webpack": { - "version": "5.95.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.95.0.tgz", - "integrity": "sha512-2t3XstrKULz41MNMBF+cJ97TyHdyQ8HCt//pqErqDvNjU9YQBnZxIHa11VXsi7F3mb5/aO2tuDxdeTPdU7xu9Q==", + "version": "5.96.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.96.1.tgz", + "integrity": "sha512-l2LlBSvVZGhL4ZrPwyr8+37AunkcYj5qh8o6u2/2rzoPc8gxFJkLj1WxNgooi9pnoc06jh0BjuXnamM4qlujZA==", "dev": true, "peer": true, "dependencies": { - "@types/estree": "^1.0.5", + "@types/eslint-scope": "^3.7.7", + "@types/estree": "^1.0.6", "@webassemblyjs/ast": "^1.12.1", "@webassemblyjs/wasm-edit": "^1.12.1", "@webassemblyjs/wasm-parser": "^1.12.1", - "acorn": "^8.7.1", - "acorn-import-attributes": "^1.9.5", - "browserslist": "^4.21.10", + "acorn": "^8.14.0", + "browserslist": "^4.24.0", "chrome-trace-event": "^1.0.2", "enhanced-resolve": "^5.17.1", "es-module-lexer": "^1.2.1", diff --git a/package.json b/package.json index 82bee4d..8e4f1b3 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ }, "publisher": "runtimeverification", "description": "Advanced Solidity and EVM Debugger", - "version": "3.1.1", + "version": "4.0.0", "engines": { "vscode": "^1.79.0" },