Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #900
Description
From investigating #900 with @andyw8, I found that the current implementation has 2 potential problems:
evaluate
request (e.g.,b 5
) is actually executed AFTER the next session command (e.g. enqueued request hashes). This is because:wait_command
would usually be waiting for@ui.readline
when the request arrives. Therefore, the@preset_command
added throughdebugger do:
won't be picked up right away.stackTrace
) comes in, it'll be picked up by@ui.readline
and be executed right away.wait_command
call finishes and we enter the next one, theb 5
command would be picked up.debugger do:
's behaviour is not deterministic, at least in theevaluate
request's case. Sometimes thedo
command would be added throughSESSION.add_preset_commands
and sometimes throughDEBUGGER__.add_line_breakpoint
. We believe this is one of the causes of First breakpoint is skipped on a remote development environment #900.Implementation
To address these 2 problems I think we can directly enqueue the sent command to
@q_msg
:@ui.readline
too so the execution order would be correct. The test added in the PR covers this case.Questions and Concerns
debugger do:
in the first place, but we couldn't figure it out ourselves. @ko1 would you mind elaborating it?wait_command
to take the command from both synchronous state change (@preset_command
) and asynchronously through@ui.readline
?wait_command
. But I don't know the design decisions behind the current implementation + I think the impact radius is too big. So I didn't pursue it.