From 4c71bb29c685806141f30a68591585174e946a5b Mon Sep 17 00:00:00 2001 From: Joel Hendrix Date: Thu, 19 Sep 2019 12:57:29 -0700 Subject: [PATCH 1/2] Fix stopOnEntry Send a dummy thread to vscode when stopped on entry as there are no threads in the process yet. Send the stop event with the same dummy thread ID. --- src/debugAdapter/goDebug.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/debugAdapter/goDebug.ts b/src/debugAdapter/goDebug.ts index d46d36621..cf3a65b57 100644 --- a/src/debugAdapter/goDebug.ts +++ b/src/debugAdapter/goDebug.ts @@ -823,9 +823,8 @@ class GoDebugSession extends LoggingDebugSession { protected async configurationDoneRequest(response: DebugProtocol.ConfigurationDoneResponse, args: DebugProtocol.ConfigurationDoneArguments): Promise { log('ConfigurationDoneRequest'); - if (this.stopOnEntry) { - this.sendEvent(new StoppedEvent('breakpoint', 0)); + this.sendEvent(new StoppedEvent('breakpoint', 1)); log('StoppedEvent("breakpoint")'); this.sendResponse(response); } else { @@ -1003,6 +1002,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); From d2a15374177c39c6f5427bc6c479b429cb5a47cf Mon Sep 17 00:00:00 2001 From: Ramya Achutha Rao Date: Tue, 24 Sep 2019 20:17:10 -0700 Subject: [PATCH 2/2] Remove stopOnEntry for attach --- package.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/package.json b/package.json index c495fff88..23c817650 100644 --- a/package.json +++ b/package.json @@ -592,11 +592,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.",