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

Fix debug file not getting deleted #2332

Merged
merged 15 commits into from
Mar 14, 2019

Conversation

vladbarosan
Copy link
Contributor

@vladbarosan
Copy link
Contributor Author

Sorry for getting so late to this one guys, please have a look when you have time

src/debugAdapter/goDebug.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@ramya-rao-a ramya-rao-a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summarizing all previous discussions here.

  • Detach/Restart should only be called if Halt succeeds or fails with the has exited with status 0 error
  • Consider Detach (without kill) instead of Restart for remote debugging
  • Clear the timer to kill debug process once Halt completes (regardless of success or failure). The main reason this was put in place was for cases when Halt failed.

@vladbarosan vladbarosan force-pushed the fixDebugFileNotDeleted branch 2 times, most recently from 37e4203 to f3ff11f Compare March 5, 2019 21:45
@vladbarosan
Copy link
Contributor Author

@ramya-rao-a so there are a couple of scenarios for which I think there are tracking issues:

  1. User starts delve with an executable that runs and finishes or some code that runs only once
    a. in this case normally we can just halt and detach which would close the target and delve remotely ( so users would need to restart delve with the program )
    b. if delve is started with --accept-multiclient, we could actually restart without halting or detaching so then on new attaches the code is rerun.

  2. Program starts and executes and we just "attach" and "detach".

Right now we do for 1 the a option regardless of "accept-multiclient" and we don't support 2. but 1 would be easy to add if we want and 2 is doable also.

@ramya-rao-a @jhendrixMSFT I know for 2 there is an open issue, not sure if there is an ask for 1.b ?

Thoughts ? Otherwise let me know if this is good to go.

@vladbarosan vladbarosan self-assigned this Mar 6, 2019
@vladbarosan
Copy link
Contributor Author

@ramya-rao-a @jhendrixMSFT as a final thing to close this I added an extra delete if for some reason the file is still around. For htis I moved the fs-extra as a dependency ( instead of a dev dependency). Any issue with that? and in general, ill take the occasion to ask what is our policies on adding dependencies ( I saw they are fairly minimal right now ).

@ramya-rao-a
Copy link
Contributor

@vladbarosan Why not use the built in fs module instead?

@vladbarosan
Copy link
Contributor Author

@ramya-rao-a , I was thinking of force removing directories but in this case is always a file so I can. Still the question regarding dependencies stands.

@ramya-rao-a
Copy link
Contributor

what is our policies on adding dependencies

We dont have any official policy on this yet. The basic idea is that we won't add dependencies that we can avoid, as it will increase the size of the extension payload.

Did you have any other specific concerns?

@vladbarosan
Copy link
Contributor Author

@jhendrixMSFT @ramya-rao-a sorry i got back late to this. I think I addressed the remaining comments.

@ramya-rao-a
Copy link
Contributor

@vladbarosan I pushed 2 commits with tiny changes, please take a look and let me know if you have any concerns

@ramya-rao-a
Copy link
Contributor

Also, did you get a chance to try the remote debugging scenario?

@vladbarosan
Copy link
Contributor Author

@ramya-rao-a but again reattaching in this scenario wont work unless delve is started with multiclient. @jhendrixMSFT is working on the attach feature. I think it might even make sense to remove the remote debugging part from launch and just leave it for attach ( since we aren't really launching)

@vladbarosan vladbarosan merged commit 86c35dd into microsoft:master Mar 14, 2019
@vladbarosan vladbarosan deleted the fixDebugFileNotDeleted branch March 14, 2019 17:52
@ramya-rao-a
Copy link
Contributor

@vladbarosan For future PRs, please use the Squash option while merging.

@vladbarosan
Copy link
Contributor Author

vladbarosan commented Mar 14, 2019

ah yea, my bad :| , im being used to have only that option enabled, @ramya-rao-a can we enable only squash merge on the repo ?

@ramya-rao-a
Copy link
Contributor

Good point. Done.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants