proc/native: make sure debugged executable can be deleted on windows (#890)
* proc/native: make sure debugged executable can be deleted on windows Delve opens debugged executable to read binary info it contains, but it never closes the file. Windows will not let you delete file that is opened. So close Process.bi in Process.postExit, and actually call Process.postExit from windows Process.Kill. Also Windows sends some debugging events (EXIT_PROCESS_DEBUG_EVENT event in particular) after Delve calls TerminateProcess. The events need to be consumed by debugger before debugged process will be released by Windows. So call Process.waitForDebugEvent after TerminateProcess in Process.Kill. Fixes #398 * cmd/dlv: make TestIssue398 pass on darwin * cmd/dlv: add comment for TestIssue398 * proc/native: wait for debuggee to exit before returning from windows Process.Kill * proc/native: close process handle before returning from windows killProcess * proc/native: remove not used Process.Process
Showing
想要评论请 注册 或 登录