Fix bug: Bad call to watch_expression() in SocketHandler.execute()#134
Open
michaelhogg wants to merge 1 commit intomartomo:masterfrom
Open
Fix bug: Bad call to watch_expression() in SocketHandler.execute()#134michaelhogg wants to merge 1 commit intomartomo:masterfrom
michaelhogg wants to merge 1 commit intomartomo:masterfrom
Conversation
A command (such as "run") is sent to the debugger engine on line 197:
S.SESSION.send(command)
The engine could respond with status="stopping". From the DBGP docs:
> This 'stopping' state is entered after all execution is complete.
> For most debugger engine implementations, only a 'stop' command
> can be accepted at this point
watch_expression() sends an "eval" command to the engine
for each watch expression. If the engine's state is "stopping",
then it'll probably respond to the "eval" commands with:
error code 5: command is not available
So it's wrong to call watch_expression() here without checking
the engine's state.
watch_expression() should only be called if the engine's state
is "break", and in fact the code does this on line 249.
|
Hi. Is your fix in any way related to this issue? #155 |
Author
|
@Mike-NetCode: It looks like it could be related. Looking at @hollusion's Xdebug log in that issue: <- step_out -i 14
-> <response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug"
command="step_out"
transaction_id="14"
status="stopping"
reason="ok">
</response>
<- eval -i 15 -- JHJ1bGVz
-> <response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug"
command="eval"
transaction_id="15">
<error code="5">
<message>
<![CDATA[
command is not available
]]>
</message>
</error>
</response>The engine responded to transaction 14 with An |
|
I've merged your fixes into my fork: Which I am attempting to get into Package Control: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A command (such as
run) is sent to the debugger engine on line 197:The engine could respond with
status="stopping". From the DBGP docs:watch_expression()sends anevalcommand to the engine for each watch expression. If the engine's state isstopping, then it'll probably respond to theevalcommands with:So it's wrong to call
watch_expression()here without checking the engine's state.watch_expression()should only be called if the engine's state isbreak, and in fact the code does this on line 249.