-
Notifications
You must be signed in to change notification settings - Fork 354
#246, #362 - Debugger listening but program not starting, flakey debugger behavior #448
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -243,8 +243,16 @@ public async Task BreakAllAsync() { | |
| if (asyncBreakComplete != null) { | ||
| asyncBreakComplete(this, new ThreadEventArgs(MainThread)); | ||
| } | ||
| } | ||
|
|
||
| } | ||
|
|
||
| internal bool IsRunning() { | ||
| var backtraceCommand = new BacktraceCommand(CommandId, _resultFactory, 0, 1); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What are 0 & 1? Can we use named args to make the code clearer? |
||
| if (TrySendRequestAsync(backtraceCommand).GetAwaiter().GetResult()) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see some of the below commands have a timeout set. Is there potential this will block? For how long? Is there a chance this will be on the UI thread?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is actually the same code as before, and I wasn't sure why it didn't have the timeout set before, so I just left it as is. I can add a timeout, though. |
||
| return backtraceCommand.Running; | ||
| } | ||
| return false; | ||
| } | ||
|
|
||
| private void DebugWriteCommand(string commandName) { | ||
| LiveLogger.WriteLine("NodeDebugger Called " + commandName); | ||
| } | ||
|
|
@@ -492,18 +500,17 @@ public void StartListening() { | |
| if (!backTraceTask.Wait((int)_timeout.TotalMilliseconds)) { | ||
| throw new TimeoutException("Timed out while performing initial backtrace."); | ||
| } | ||
| bool running = backTraceTask.GetAwaiter().GetResult(); | ||
|
|
||
| // At this point we can fire events | ||
| EventHandler<ThreadEventArgs> newThread = ThreadCreated; | ||
| if (newThread != null) { | ||
| newThread(this, new ThreadEventArgs(mainThread)); | ||
| } | ||
|
|
||
| EventHandler<ProcessLoadedEventArgs> procLoaded = ProcessLoaded; | ||
| } | ||
| EventHandler<ThreadEventArgs> procLoaded = ProcessLoaded; | ||
| if (procLoaded != null) { | ||
| procLoaded(this, new ProcessLoadedEventArgs(mainThread, running)); | ||
| } | ||
| procLoaded(this, new ThreadEventArgs(MainThread)); | ||
| } | ||
|
|
||
| } | ||
|
|
||
| private void OnConnectionClosed(object sender, EventArgs args) { | ||
|
|
@@ -1170,7 +1177,7 @@ internal async Task<NodeEvaluationResult> SetVariableValueAsync( | |
| /// <summary> | ||
| /// Fired when the process has started and is broken into the debugger, but before any user code is run. | ||
| /// </summary> | ||
| public event EventHandler<ProcessLoadedEventArgs> ProcessLoaded; | ||
| public event EventHandler<ThreadEventArgs> ProcessLoaded; | ||
|
|
||
| public event EventHandler<ThreadEventArgs> ThreadCreated; | ||
| public event EventHandler<ThreadEventArgs> ThreadExited; | ||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this line for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes it easier to read between the lines. I'll remove it 😃