improve the debugging experience (#101779)
improve debugging experience
This commit is contained in:
Vendored
+5
@@ -11,6 +11,11 @@
|
||||
"cwd": "${workspaceFolder}",
|
||||
"args": ["server", "--homepath", "${workspaceFolder}", "--packaging", "dev", "cfg:app_mode=development"]
|
||||
},
|
||||
{
|
||||
"name": "Attach to Go Process",
|
||||
"type": "go",
|
||||
"request": "attach"
|
||||
},
|
||||
{
|
||||
"name": "Attach to Test Process",
|
||||
"type": "go",
|
||||
|
||||
@@ -185,6 +185,11 @@ func doBuild(binaryName, pkg string, opts BuildOpts) error {
|
||||
|
||||
args := []string{"build", "-ldflags", lf}
|
||||
|
||||
if opts.isDev {
|
||||
// disable optimizations, so debugger will work
|
||||
args = append(args, "-gcflags", "all=-N -l")
|
||||
}
|
||||
|
||||
if opts.goos == GoOSWindows {
|
||||
// Work around a linking error on Windows: "export ordinal too large"
|
||||
args = append(args, "-buildmode=exe")
|
||||
|
||||
Reference in New Issue
Block a user