Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Debugger] Async Break broken due to incorrect Thread Event behavior. #1105

Closed
chuckries opened this issue Jan 5, 2017 · 2 comments
Closed
Assignees
Milestone

Comments

@chuckries
Copy link
Contributor

chuckries commented Jan 5, 2017

We thought this was a VS Code issue but they are marking it by design.

Steps to reproduce

  1. Launch or Attach to a .NET Core app.
  2. Press the "Pause" (Async Break) button in the editor.

Expected behavior

Debugger stops

Actual behavior

Nothing Happens

Here is a comment explaining VS Code's behavior. We respond to the initial 'threads' request after configurationDone with no threads, which I believe is correct in our case. Later, we fire a Thread Event when our main thread is created. The issue appears to be that after the Thread Event, the 'threads' request is sent again and we respond with null.

Sample Log:

E initialized: {"type":"initialized"}
E output: {"category":"telemetry","output":"VS/Diagnostics/Debugger/Launch","data":{"VS.Diagnostics.Debugger.ImplementationName":"Microsoft.MIDebugEngine","VS.Diagnostics.Debugger.EngineVersion":"14.0.31028.1","VS.Diagnostics.Debugger.HostVersion":"1.0.21028.2","VS.Diagnostics.Debugger.AdapterId":"coreclr","VS.Diagnostics.Debugger.Launch.Duration":362,"VS.Diagnostics.Debugger.Launch.IsCoreDump":false},"type":"output"}
 R: {"success":true,"message":null,"request_seq":2,"command":"launch","body":null,"running":false,"refs":null,"seq":0,"type":"response"}
C setExceptionBreakpoints: {"filters":["user-unhandled"]}
 R: {"success":true,"message":null,"request_seq":3,"command":"setExceptionBreakpoints","body":{},"running":false,"refs":null,"seq":0,"type":"response"}
C configurationDone: null
 R: {"success":true,"message":null,"request_seq":4,"command":"configurationDone","body":null,"running":false,"refs":null,"seq":0,"type":"response"}
C threads: null
 R: {"success":true,"message":null,"request_seq":5,"command":"threads","body":{"threads":[]},"running":false,"refs":null,"seq":0,"type":"response"}
E output: {"category":"telemetry","output":"VS/Diagnostics/Debugger/clrdbg/ProcessCreate","data":{"VS.Diagnostics.Debugger.clrdbg.Version":"15.0.26013.0 built by: PREVIEW.DBG2","VS.Diagnostics.Debugger.clrdbg.OSFamily":"Windows","VS.Diagnostics.Debugger.clrdbg.WindowsVersion":"10.0.14393"},"type":"output"}
E output: {"category":"telemetry","output":"VS/Diagnostics/Debugger/clrdbg/TargetRuntimeLoaded","data":{"VS.Diagnostics.Debugger.clrdbg.TargetRuntimeVersion.MS":262150,"VS.Diagnostics.Debugger.clrdbg.TargetRuntimeVersion.LS":1599733761,"VS.Diagnostics.Debugger.clrdbg.Version":"15.0.26013.0 built by: PREVIEW.DBG2","VS.Diagnostics.Debugger.clrdbg.OSFamily":"Windows","VS.Diagnostics.Debugger.clrdbg.WindowsVersion":"10.0.14393"},"type":"output"}
E output: {"category":"console","output":"Loaded 'C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\1.0.1\\System.Private.CoreLib.ni.dll'. Cannot find or open the symbol file.\r\n","data":null,"type":"output"}
Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.1\System.Private.CoreLib.ni.dll'. Cannot find or open the symbol file.
E output: {"category":"console","output":"Loaded 'c:\\Users\\chuckr\\Source\\scratch\\bin\\Debug\\netcoreapp1.0\\scratch.dll'. Symbols loaded.\r\n","data":null,"type":"output"}
Loaded 'c:\Users\chuckr\Source\scratch\bin\Debug\netcoreapp1.0\scratch.dll'. Symbols loaded.
E output: {"category":"console","output":"Loaded 'C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\1.0.1\\System.Runtime.dll'. Cannot find or open the symbol file.\r\n","data":null,"type":"output"}
Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.1\System.Runtime.dll'. Cannot find or open the symbol file.
E output: {"category":"console","output":"Loaded 'C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\1.0.1\\mscorlib.dll'. Cannot find or open the symbol file.\r\n","data":null,"type":"output"}
Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.1\mscorlib.dll'. Cannot find or open the symbol file.
E output: {"category":"console","output":"Loaded 'C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\1.0.1\\System.Threading.Thread.dll'. Cannot find or open the symbol file.\r\n","data":null,"type":"output"}
Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.1\System.Threading.Thread.dll'. Cannot find or open the symbol file.
E output: {"category":"console","output":"Loaded 'C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\1.0.1\\System.Console.dll'. Cannot find or open the symbol file.\r\n","data":null,"type":"output"}
Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.1\System.Console.dll'. Cannot find or open the symbol file.
E thread: {"reason":"started","threadId":30804,"type":"thread"}
C threads: null
 R: {"success":true,"message":null,"request_seq":6,"command":"threads","body":{"threads":[]},"running":false,"refs":null,"seq":0,"type":"response"}
@chuckries chuckries changed the title [Debugger] Need to send respond to threads request or send Thread Event after attaching [Debugger] Async Break broken due to incorrect Thread Event behavior. Jan 5, 2017
@chuckries
Copy link
Contributor Author

It looks like if we are not stopped, OpenDebugAD7 always returns empty threads.

@chuckries
Copy link
Contributor Author

Additionally, in the case of attach it looks like we don't ever send a Thread Event:

E output: {"category":"telemetry","output":"VS/Diagnostics/Debugger/clrdbg/ProcessCreate","data":{"VS.Diagnostics.Debugger.clrdbg.Version":"15.0.26013.0 built by: PREVIEW.DBG2","VS.Diagnostics.Debugger.clrdbg.OSFamily":"Windows","VS.Diagnostics.Debugger.clrdbg.WindowsVersion":"10.0.14393"},"type":"output"}
E initialized: {"type":"initialized"}
E output: {"category":"telemetry","output":"VS/Diagnostics/Debugger/Attach","data":{"VS.Diagnostics.Debugger.ImplementationName":"Microsoft.MIDebugEngine","VS.Diagnostics.Debugger.EngineVersion":"14.0.31028.1","VS.Diagnostics.Debugger.HostVersion":"1.0.21028.2","VS.Diagnostics.Debugger.AdapterId":"coreclr","VS.Diagnostics.Debugger.Attach.Duration":294},"type":"output"}
 R: {"success":true,"message":null,"request_seq":2,"command":"attach","body":null,"running":false,"refs":null,"seq":0,"type":"response"}
C setExceptionBreakpoints: {"filters":["user-unhandled"]}
 R: {"success":true,"message":null,"request_seq":3,"command":"setExceptionBreakpoints","body":{},"running":false,"refs":null,"seq":0,"type":"response"}
C configurationDone: null
 R: {"success":true,"message":null,"request_seq":4,"command":"configurationDone","body":null,"running":false,"refs":null,"seq":0,"type":"response"}
C threads: null
 R: {"success":true,"message":null,"request_seq":5,"command":"threads","body":{"threads":[]},"running":false,"refs":null,"seq":0,"type":"response"}
E output: {"category":"telemetry","output":"VS/Diagnostics/Debugger/clrdbg/TargetRuntimeLoaded","data":{"VS.Diagnostics.Debugger.clrdbg.TargetRuntimeVersion.MS":262150,"VS.Diagnostics.Debugger.clrdbg.TargetRuntimeVersion.LS":1599733761,"VS.Diagnostics.Debugger.clrdbg.Version":"15.0.26013.0 built by: PREVIEW.DBG2","VS.Diagnostics.Debugger.clrdbg.OSFamily":"Windows","VS.Diagnostics.Debugger.clrdbg.WindowsVersion":"10.0.14393"},"type":"output"}
E output: {"category":"console","output":"Loaded 'C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\1.0.1\\System.Private.CoreLib.ni.dll'. Cannot find or open the symbol file.\r\n","data":null,"type":"output"}
Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.1\System.Private.CoreLib.ni.dll'. Cannot find or open the symbol file.
E output: {"category":"console","output":"Loaded 'C:\\Users\\chuckr\\Source\\scratch\\bin\\Debug\\netcoreapp1.0\\scratch.dll'. Symbols loaded.\r\n","data":null,"type":"output"}
Loaded 'C:\Users\chuckr\Source\scratch\bin\Debug\netcoreapp1.0\scratch.dll'. Symbols loaded.
E output: {"category":"console","output":"Loaded 'C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\1.0.1\\System.Runtime.dll'. Cannot find or open the symbol file.\r\n","data":null,"type":"output"}
Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.1\System.Runtime.dll'. Cannot find or open the symbol file.
E output: {"category":"console","output":"Loaded 'C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\1.0.1\\mscorlib.dll'. Cannot find or open the symbol file.\r\n","data":null,"type":"output"}
Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.1\mscorlib.dll'. Cannot find or open the symbol file.
E output: {"category":"console","output":"Loaded 'C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\1.0.1\\System.Threading.Thread.dll'. Cannot find or open the symbol file.\r\n","data":null,"type":"output"}
Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.1\System.Threading.Thread.dll'. Cannot find or open the symbol file.
E output: {"category":"console","output":"Loaded 'C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\1.0.1\\System.Console.dll'. Cannot find or open the symbol file.\r\n","data":null,"type":"output"}
Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.1\System.Console.dll'. Cannot find or open the symbol file.
E output: {"category":"console","output":"Loaded 'C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\1.0.1\\System.Threading.dll'. Cannot find or open the symbol file.\r\n","data":null,"type":"output"}
Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.1\System.Threading.dll'. Cannot find or open the symbol file.
E output: {"category":"console","output":"Loaded 'C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\1.0.1\\System.IO.dll'. Cannot find or open the symbol file.\r\n","data":null,"type":"output"}
Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.1\System.IO.dll'. Cannot find or open the symbol file.
E output: {"category":"console","output":"Loaded 'C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\1.0.1\\System.IO.FileSystem.Primitives.dll'. Cannot find or open the symbol file.\r\n","data":null,"type":"output"}
Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.1\System.IO.FileSystem.Primitives.dll'. Cannot find or open the symbol file.
E output: {"category":"console","output":"Loaded 'C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\1.0.1\\System.Text.Encoding.dll'. Cannot find or open the symbol file.\r\n","data":null,"type":"output"}
Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.1\System.Text.Encoding.dll'. Cannot find or open the symbol file.
E output: {"category":"console","output":"Loaded 'C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\1.0.1\\System.Text.Encoding.Extensions.dll'. Cannot find or open the symbol file.\r\n","data":null,"type":"output"}
Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.1\System.Text.Encoding.Extensions.dll'. Cannot find or open the symbol file.
E output: {"category":"console","output":"Loaded 'C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\1.0.1\\System.Threading.Tasks.dll'. Cannot find or open the symbol file.\r\n","data":null,"type":"output"}
Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.1\System.Threading.Tasks.dll'. Cannot find or open the symbol file.
C disconnect: {"restart":false}
E output: {"category":"console","output":"Debugger has disconnected from the program ''.\r\n","data":null,"type":"output"}
Debugger has disconnected from the program ''.
E exited: {"exitCode":0,"type":"exited"}
E terminated: {"type":"terminated"}
E output: {"category":"telemetry","output":"VS/Diagnostics/Debugger/DebugCompleted","data":{"VS.Diagnostics.Debugger.ImplementationName":"Microsoft.MIDebugEngine","VS.Diagnostics.Debugger.EngineVersion":"14.0.31028.1","VS.Diagnostics.Debugger.HostVersion":"1.0.21028.2","VS.Diagnostics.Debugger.AdapterId":"coreclr","VS.Diagnostics.Debugger.DebugCompleted.BreakCounter":0},"type":"output"}
 R: {"success":true,"message":null,"request_seq":6,"command":"disconnect","body":null,"running":false,"refs":null,"seq":0,"type":"response"}

@gregg-miskelly gregg-miskelly self-assigned this Jan 20, 2017
@gregg-miskelly gregg-miskelly added this to the 1.7 milestone Jan 20, 2017
gregg-miskelly added a commit to gregg-miskelly/vscode-csharp that referenced this issue Jan 20, 2017
This updates the debugger to 1-7-0. This version of the debugger contains a fix for dotnet#1107 and dotnet#1105.
gregg-miskelly added a commit that referenced this issue Jan 21, 2017
This updates the debugger to 1-7-0. This version of the debugger contains a fix for #1107 and #1105.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants