diff --git a/README.md b/README.md index b4949b0..6f2a7b3 100644 --- a/README.md +++ b/README.md @@ -2,23 +2,25 @@ [![](https://vsmarketplacebadge.apphb.com/version/Herbert-Karl.digital-asm.svg)](https://marketplace.visualstudio.com/items?itemName=Herbert-Karl.digital-asm) -This VS Code Plugin provides support for Assembler files for the _digital logic designer and circuit simulator_ [Digital](https://github.com/hneemann/Digital). +This VS Code extension provides support for Assembler files for the _digital logic designer and circuit simulator_ [Digital](https://github.com/hneemann/Digital). It is created as part of a study work at the DHBW Mosbach. ## Features * Language Grammar Definition for the Assembler * Commands - * Parsing `.asm` into `.hex` and `.lst` + * Parsing `.asm` into `.hex`, `.lst` and `.map` * Running file in the digital simulator -* code completion for asm mnemonics -* hover texts for asm mnemonics +* code completion for assembler mnemonics +* hover texts for assembler mnemonics * Debugging of `.asm` files in the digital simulator ## Requirements * Circuit simulator [Digital](https://github.com/hneemann/Digital) for the digital processor. + * developed and tested with v0.20.0 (2018-09-03) * Assembler [ASM 3](https://github.com/hneemann/Assembler) for parsing the file. + * needs at least v0.6.1 These are not included in the extension and have to be downloaded seperately. @@ -29,7 +31,7 @@ This extension contributes the following settings: * `asm.simulatorHost`: ip address of the host running the digital simulator * `asm.simulatorPort`: port, at which the digital simulator runs its TcpListener * `asm.assembler`: location of the jar file of the ASM3 programm -* `asm.brkHandling`: option to handle BRK Mnemonics as BreakPoints when debugging +* `asm.brkHandling`: option to handle BRK Mnemonics as Breakpoints when debugging ## Known Issues diff --git a/package.json b/package.json index 51c9af2..95882f0 100644 --- a/package.json +++ b/package.json @@ -103,12 +103,17 @@ "configurationAttributes": { "launch": { "required": [ - "file" + "file", + "stopOnEntry" ], "properties": { "file": { "type": "string", "description": "the file to debug" + }, + "stopOnEntry": { + "type": "boolean", + "description": "if the debugger should halt at the first file line" } } } @@ -118,18 +123,20 @@ "type": "digital-conn", "request": "launch", "name": "Ask for file name", - "file": "${workspaceFolder}/${command:AskForFileName}" + "file": "${workspaceFolder}/${command:AskForFileName}", + "stopOnEntry": "true" } ], "configurationSnippets": [ { "label": "Asm Debug", - "description": "configuration for running an asm file", + "description": "configuration for debugging an asm file", "body": { "type": "digital-conn", "request": "launch", "name": "Debugging", - "file": "^\"\\${workspaceFolder}/\\${command:AskForProgramName}\"" + "file": "^\"\\${workspaceFolder}/\\${command:AskForProgramName}\"", + "stopOnEntry": "true" } } ], diff --git a/src/asmDebugSession.ts b/src/asmDebugSession.ts index 2e17ee0..9774542 100644 --- a/src/asmDebugSession.ts +++ b/src/asmDebugSession.ts @@ -111,13 +111,7 @@ export class AsmDebugSession extends DebugSession { await this.configurationDone.wait(10000); // launching/starting - let stopOnEntry = true; - if(args.noDebug!==undefined) { - // if the launchrequestarguments contain an information about the debugging we use it - // but we negate noDebug in order to match the semantic of stopOnEntry (noDebug true would mean that we shouldn't stopOnEntry/shoudl just run the program) - stopOnEntry = !args.noDebug; - } - this.debugger.start(stopOnEntry); + this.debugger.start(args.stopOnEntry); this.sendResponse(response); } diff --git a/src/extension.ts b/src/extension.ts index 713aa97..90e256b 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -6,7 +6,7 @@ import * as vscode from 'vscode'; import { RemoteInterface } from './remoteInterface'; import { mnemonicsArray, AsmMnemonic } from './mnemonics'; -// plugin settings +// extension settings let asm3JarPath = vscode.workspace.getConfiguration().get('asm.assembler', "./asm3.jar"); let simulatorHost = vscode.workspace.getConfiguration().get('asm.simulatorHost', "localhost"); let simulatorPort = vscode.workspace.getConfiguration().get('asm.simulatorPort', 41114); @@ -15,7 +15,7 @@ let brkHandling = vscode.workspace.getConfiguration().get('asm.brkHandl // this method is called when your extension is activated // your extension is activated the very first time the command is executed export function activate(context: vscode.ExtensionContext) { - // if the configuration of the workspace changes, we simply override our values referencing the plugin settings + // if the configuration of the workspace changes, we simply override our values referencing the extension settings vscode.workspace.onDidChangeConfiguration(() => { asm3JarPath = vscode.workspace.getConfiguration().get('asm.assembler', "./asm3.jar"); simulatorHost = vscode.workspace.getConfiguration().get('asm.simulatorHost', "localhost"); diff --git a/src/utils.ts b/src/utils.ts index f271b3f..bfd2ed7 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -10,6 +10,7 @@ export interface AsmBreakpoint { // interface containing all information needed for launching our debugger export interface AsmLaunchRequestArguments extends DebugProtocol.LaunchRequestArguments { + stopOnEntry: boolean; pathToAsmFile: string; pathToHexFile: string; pathToAsmHexMapping: string;