src/debugAdapter: log all the env vars passed to dlv
Updates golang/vscode-go#468
Change-Id: I55d31286ab2de0e9360aa642e0ccf2d6e15eaadb
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/251478
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Trust: Suzy Mueller <suzmue@golang.org>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
diff --git a/src/debugAdapter/goDebug.ts b/src/debugAdapter/goDebug.ts
index 8dee3d8..226f87f 100644
--- a/src/debugAdapter/goDebug.ts
+++ b/src/debugAdapter/goDebug.ts
@@ -38,7 +38,7 @@
getCurrentGoWorkspaceFromGOPATH,
getInferredGopath,
} from '../utils/pathUtils';
-import {killProcessTree} from '../utils/processUtils';
+import { killProcessTree } from '../utils/processUtils';
const fsAccess = util.promisify(fs.access);
const fsUnlink = util.promisify(fs.unlink);
@@ -473,7 +473,11 @@
log(`Using GOPATH: ${env['GOPATH']}`);
log(`Using GOROOT: ${this.goroot}`);
log(`Using PATH: ${env['PATH']}`);
-
+ if (launchArgs.trace === 'verbose') {
+ Object.keys(env).forEach((key) => {
+ log(' export ' + key + '="' + env[key] + '"');
+ });
+ }
if (!!launchArgs.noDebug) {
if (mode === 'debug') {
this.noDebug = true;
@@ -529,8 +533,7 @@
if (!existsSync(launchArgs.dlvToolPath)) {
log(
- `Couldn't find dlv at the Go tools path, ${process.env['GOPATH']}${
- env['GOPATH'] ? ', ' + env['GOPATH'] : ''
+ `Couldn't find dlv at the Go tools path, ${process.env['GOPATH']}${env['GOPATH'] ? ', ' + env['GOPATH'] : ''
} or ${envPath}`
);
return reject(