Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
fix stopOnEntry (#2762)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhendrixMSFT authored and ramya-rao-a committed Sep 27, 2019
1 parent 321dbc9 commit 9874b40
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -593,11 +593,6 @@
"description": "Indicates local or remote debugging. Local maps to the dlv 'attach' command, remote maps to 'connect'.",
"default": "local"
},
"stopOnEntry": {
"type": "boolean",
"description": "Automatically stop program after launch.",
"default": false
},
"showLog": {
"type": "boolean",
"description": "Show log output from the delve debugger.",
Expand Down
6 changes: 4 additions & 2 deletions src/debugAdapter/goDebug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -828,9 +828,8 @@ class GoDebugSession extends LoggingDebugSession {

protected async configurationDoneRequest(response: DebugProtocol.ConfigurationDoneResponse, args: DebugProtocol.ConfigurationDoneArguments): Promise<void> {
log('ConfigurationDoneRequest');

if (this.stopOnEntry) {
this.sendEvent(new StoppedEvent('breakpoint', 0));
this.sendEvent(new StoppedEvent('breakpoint', 1));
log('StoppedEvent("breakpoint")');
this.sendResponse(response);
} else {
Expand Down Expand Up @@ -1029,6 +1028,9 @@ class GoDebugSession extends LoggingDebugSession {
goroutine.userCurrentLoc.function ? goroutine.userCurrentLoc.function.name : (goroutine.userCurrentLoc.file + '@' + goroutine.userCurrentLoc.line)
)
);
if (threads.length === 0) {
threads.push(new Thread(1, 'Dummy'));
}
response.body = { threads };
this.sendResponse(response);
log('ThreadsResponse', threads);
Expand Down

0 comments on commit 9874b40

Please sign in to comment.