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

Debug file not getting cleared after debugging on Windows #2265

Closed
monkeyWie opened this issue Jan 22, 2019 · 14 comments
Closed

Debug file not getting cleared after debugging on Windows #2265

monkeyWie opened this issue Jan 22, 2019 · 14 comments
Assignees
Labels

Comments

@monkeyWie
Copy link

  1. Start debug
  2. Generate debug file

image

Is this normal?Can I hide it?

@cousinbenson
Copy link

this is normal, you cannot hide it however you can .gitignore it

@segevfiner
Copy link
Contributor

I think that's how delve works.

@ramya-rao-a
Copy link
Contributor

We use delve to provide the debugging feature.
It builds your code, creates a binary (the debug file you are seeing) and uses that to do the debugging.
This file should get deleted at the end of the debug session.
If you are seeing that it is not getting cleaned up, then please provide a small sample code and exact repro steps.

@monkeyWie
Copy link
Author

monkeyWie commented Jan 25, 2019

@ramya-rao-a

I just run a hello word program,then this is my code:

.vscode/launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch",
            "type": "go",
            "request": "launch",
            "mode": "auto",
            "program": "${fileDirname}",
            "env": {},
            "args": []
        }
    ]
}

src/main.go

package main

import (
	"fmt"
)

func main() {
	fmt.Println("Hello word")
}

The version info

VSCode version:1.30.2
Go plugin version:0.8.0
Delve version:1.1.0

Steps

  1. Press F5 to debug
  2. Found the DEBUG file after the program finishes running.

@ramya-rao-a
Copy link
Contributor

When you have finished debugging, the file doesn't get cleaned up?
What OS are you using?

@monkeyWie
Copy link
Author

Yes, the debug file has not been cleared.
OS: win10 Pro 1803

@ramya-rao-a
Copy link
Contributor

Thanks @monkeyWie

I see this in Windows, but not on my Mac.

@ramya-rao-a ramya-rao-a changed the title Why do I generate a DEBUG file when debugging? Debug file not getting cleared after debugging on Windows Feb 3, 2019
@ramya-rao-a
Copy link
Contributor

@jhendrixMSFT This is most likely due to delve.

By the time we send the Halt request to delve, delve has already completed running the whole program. So the Halt request fails with Process <process-number> has exited with status 0

I would expect delve to clean up the debug file it created in such cases, we should look into why this is not happening as well as why it does happen on Mac

@ramya-rao-a
Copy link
Contributor

@vladbarosan Right now we end up at https://github.com/Microsoft/vscode-go/blob/0.9.0/src/debugAdapter/goDebug.ts#L533 failing to halt delve because delve has already halted (sort of)

I am not sure if the Halt request failed here or the Detach request.
If it is the Halt request that is failing, then maybe we should try running Detach request nevertheless? Not sure.

@ramya-rao-a
Copy link
Contributor

@monkeyWie The fix for this is available in the latest beta version of this extension. Please give it a try

@monkeyWie
Copy link
Author

Thank you, I will try it when I have time.

@monkeyWie
Copy link
Author

monkeyWie commented Apr 6, 2019

Bug has been fixed.

@monkeyWie
Copy link
Author

@ramya-rao-a
I found a new bug in 0.9.3-beta.7.
When I set a breakpoint for debugging,debug file is not getting cleared after the program ends.
image

@ramya-rao-a
Copy link
Contributor

@monkeyWie Can you create a new issue for that?

The fix that was put in place for this issue is out in the latest release(0.10.0) of this extension

@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants