Skip to content

Commit

Permalink
stopOnEntry handling now via launch.json settings + updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Herbert-Karl committed Apr 8, 2020
1 parent 859954d commit 0907989
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 18 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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

Expand Down
15 changes: 11 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
Expand All @@ -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"
}
}
],
Expand Down
8 changes: 1 addition & 7 deletions src/asmDebugSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>('asm.assembler', "./asm3.jar");
let simulatorHost = vscode.workspace.getConfiguration().get<string>('asm.simulatorHost', "localhost");
let simulatorPort = vscode.workspace.getConfiguration().get<number>('asm.simulatorPort', 41114);
Expand All @@ -15,7 +15,7 @@ let brkHandling = vscode.workspace.getConfiguration().get<boolean>('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<string>('asm.assembler', "./asm3.jar");
simulatorHost = vscode.workspace.getConfiguration().get<string>('asm.simulatorHost', "localhost");
Expand Down
1 change: 1 addition & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0907989

Please sign in to comment.