Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
RaoulSchaffranek committed Oct 14, 2024
1 parent 5f42e64 commit a9530d8
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 187 deletions.
17 changes: 17 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@
],
"preLaunchTask": "${defaultBuildTask}",
"debugWebviews": true,
},
{
"name": "Simbolik: Client (Tests)",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"${workspaceFolder}/../simbolik/src/tests/data/foundry"
],
"outFiles": [
"${workspaceFolder}/build/*.js",
"${workspaceFolder}/build/**/*.js",
"${workspaceFolder}/build-web/*.js",
"${workspaceFolder}/build-web/**/*.js",
],
"preLaunchTask": "${defaultBuildTask}",
"debugWebviews": true,
}
]
}
68 changes: 13 additions & 55 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,101 +55,59 @@
"description": "The websocket URL where the simbolik server is listening. Do not change this unless you are running your own simbolik server.",
"order": 1
},
"simbolik.json-rpc-url": {
"type": "string",
"default": "http://localhost:8545",
"description": "The URL of the JSON-RPC server. Notice, that the JSON RPC server must be reachable from the simbolik server. `localhost` here refers to the machine where the simbolik server is running.",
"order": 2
},
"simbolik.forge-path": {
"type": "string",
"default": "forge",
"description": "The path to the forge executable. Simbolik uses forge to compile the smart contracts. If forge is not in the PATH, you can set the path here.",
"order": 23
"order": 2
},
"simbolik.autobuild": {
"type": "boolean",
"default": true,
"description": "If set to true, the debugger will automatically build the project before starting the debugger.",
"order": 4
"order": 3
},
"simbolik.incremental-build": {
"type": "boolean",
"default": false,
"description": "If autobuild is eanbled and incremental-build is set to true, the debugger will use incremental builds. Notice, that the support for incremental builds is experimental and sometimes leads to unexpected behavior.",
"order": 5
"order": 4
},
"simbolik.stop-at-first-opcode": {
"type": "boolean",
"description": "If set to true, the debugger will stop at the first opcode. Otherwise it will stop at the function entry. Disabling this option is experimental and may lead to unexpected behavior.",
"default": true,
"order": 6
},
"simbolik.simbolik-autostart": {
"type": "boolean",
"default": false,
"description": "If set to true, the debugger will start the simbolik server automatically with VSCode. This option can only be used if you have the simbolik server installed on your machine.",
"order": 7
},
"simbolik.simbolik-path": {
"type": "string",
"default": "simbolik",
"description": "The path to the simbolik executable. If simbolik-autostart is set to true, the debugger will start the simbolik server with this executable. If simbolik is not in the PATH, you can set the path here.",
"order": 8
},
"simbolik.anvil-autostart": {
"type": "boolean",
"default": false,
"description": "If set to true, the debugger will start the anvil server for every debugging session. Only set this to true if you are running your own simbolik server.",
"order": 9
},
"simbolik.anvil-path": {
"type": "string",
"default": "anvil",
"description": "The path to the anvil executable. If anvil-autostart is set to true, the debugger will start the anvil server with this executable. If anvil is not in the PATH, you can set the path here.",
"order": 10
"order": 5
},
"simbolik.enable-parameters": {
"type": "boolean",
"default": false,
"description": "If set to true, the debugger will show a debug button above functions with parameters. Notice, that this requires a backend that supports parameter debugging. The default Foundry backend does not support parameter debugging.",
"order": 11
"order": 6
},
"simbolik.show-sourcemaps": {
"type": "boolean",
"default": false,
"description": "If set to true, the debugger will include sourcemaps in the disassembly view. This is useful when debugging sourcemaps.",
"order": 12
},
"simbolik.bmc-depth": {
"type": "integer",
"description": "Signals the backend that it should only unroll loops up to this depth. This parameter is only relevant for symbolic execution backends.",
"default": 3,
"order": 13
"order": 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,
"order": 14
},
"simbolik.sourcify-autostart": {
"type": "boolean",
"description": "If set to true, the debugger will start the sourcify server for every debugging session. Only set this to true if you are running your own simbolik server.",
"default": false,
"order": 15
"order": 8
},
"simbolik.sourcify-solc-repo": {
"simbolik.json-rpc-url": {
"type": "string",
"description": "The folder containing different solidity compiler versions.",
"default": "~/.local/bin",
"order": 16
"default": "http://localhost:8545",
"description": "Attach requests use this URL as the JSON-RPC endpoint. Notice, that the JSON RPC server must be reachable from the simbolik server. `localhost` here refers to the machine where the simbolik server is running.",
"order": 9
},
"simbolik.sourcify-url": {
"type": "string",
"description": "The URL of the Sourcify server. This is only relevant if you are running your own Sourcify server.",
"description": "Attach requests use this Sourcify endpoint to download the source code of the debugged transaction.",
"default": "http://localhost:5555",
"order": 17
"order": 10
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/DebugAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class SolidityDebugAdapterDescriptorFactory
executable: vscode.DebugAdapterExecutable | undefined
): Promise<vscode.ProviderResult<vscode.DebugAdapterDescriptor>> {
return new Promise((resolve, reject) => {
const server = getConfigValue('server', 'ws://localhost:6789');
const server = getConfigValue('server', 'ws://beta.simbolik.runtimeverification.com:3000');
const websocket = new WebSocket(server);
websocket.once('open', () => {
const websocketAdapter = new WebsocketDebugAdapter(websocket, session.configuration);
Expand Down
2 changes: 1 addition & 1 deletion src/DebugAdapter.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class SolidityDebugAdapterDescriptorFactory
executable: vscode.DebugAdapterExecutable | undefined
): Promise<vscode.ProviderResult<vscode.DebugAdapterDescriptor>> {
return new Promise((resolve, reject) => {
const server = getConfigValue('server', 'ws://localhost:6789');
const server = getConfigValue('server', 'ws://beta.simbolik.runtimeverification.com:3000');
const websocket = new WebSocket(server);
websocket.onopen = () => {
const websocketAdapter = new WebsocketDebugAdapter(websocket);
Expand Down
11 changes: 1 addition & 10 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import {CodelensProvider} from './CodelensProvider';
import {SolidityDebugAdapterDescriptorFactory} from './DebugAdapter';
import {startDebugging} from './startDebugging';
import {KastProvider, viewKast} from './KastProvider';
import {Supervisor} from './supevervisor';
import {getConfigValue} from './utils';
import { debug } from 'console';

const outputChannel = vscode.window.createOutputChannel(
'Simbolik Solidity Debugger',
Expand All @@ -23,12 +21,6 @@ export function activate(context: vscode.ExtensionContext) {

let disposable: vscode.Disposable;

const supervisor = new Supervisor();
if (getConfigValue('simbolik-autostart', true)) {
supervisor.simbolik();
}
context.subscriptions.push(supervisor);

const codelensProvider = new CodelensProvider();
disposable = vscode.languages.registerCodeLensProvider(
'solidity',
Expand All @@ -45,7 +37,7 @@ export function activate(context: vscode.ExtensionContext) {

disposable = vscode.commands.registerCommand(
'simbolik.startDebugging',
(contract, method) => startDebugging(supervisor, contract, method),
(contract, method) => startDebugging(contract, method),
);
context.subscriptions.push(disposable);

Expand Down Expand Up @@ -101,7 +93,6 @@ export function activate(context: vscode.ExtensionContext) {
});

vscode.debug.onDidTerminateDebugSession(session => {
supervisor.anvilTerminate();
outputChannel.info(`Debug session ended: ${session.id}`);
});

Expand Down
9 changes: 1 addition & 8 deletions src/startDebugging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,12 @@ import {
} from '@solidity-parser/parser/dist/src/ast-types';
import * as vscode from 'vscode';
import { getConfigValue } from './utils';
import { Supervisor } from './supevervisor';
import { forgeBuildTask, foundryRoot, loadBuildInfo } from './foundry';

export async function startDebugging(
supervisor: Supervisor,
contract: ContractDefinition,
method: FunctionDefinition
) {
if (getConfigValue('anvil-autostart', true)) {
supervisor.anvilTerminate();
supervisor.anvil();
}

const activeTextEditor = vscode.window.activeTextEditor;
if (!activeTextEditor) {
throw new Error('No active text editor.');
Expand Down Expand Up @@ -57,7 +50,7 @@ export async function startDebugging(
const file = activeTextEditor.document.uri.toString();
const contractName = contract['name'];
const methodSignature = `${method['name']}(${parameters.join(',')})`;
const stopAtFirstOpcode = getConfigValue('stop-at-first-opcode', false);
const stopAtFirstOpcode = getConfigValue('stop-at-first-opcode', true);
const showSourcemaps = getConfigValue('show-sourcemaps', false);
const debugConfigName = `${contractName}.${methodSignature}`;
const jsonRpcUrl = getConfigValue('json-rpc-url', 'http://localhost:8545');
Expand Down
112 changes: 0 additions & 112 deletions src/supevervisor.ts

This file was deleted.

0 comments on commit a9530d8

Please sign in to comment.