-
Notifications
You must be signed in to change notification settings - Fork 14
skip now ignores jumps #54
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
skip now ignores jumps #54
Conversation
|
Failing test does not seem related. |
Sindarin/SindarinDebugger.class.st
Outdated
| self node isMessage ifTrue: [ ^ self skipMessageNode ]. | ||
| self node isMethod ifTrue: [ ^ self step ]. | ||
| self node isBlock ifTrue: [ ^ self skipBlockNode ]. |
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.
Replace by db dispatch
Sindarin/SindarinDebugger.class.st
Outdated
| (instructionStream willJumpTo or: [ | ||
| instructionStream willJumpIfFalse or: [ | ||
| instructionStream willJumpIfTrue ] ]) ifTrue: [ ^ self skipJump ]. |
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.
refactor in InstructionStream>>willJump
Sindarin/SindarinDebugger.class.st
Outdated
| each offset = self pc ]. | ||
|
|
||
| (self node isReturn or: [ | ||
| nextBytecode bytes first between: 88 and: 94 ]) ifTrue: [ |
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.
= instructionSteram willReturn
…le + using InstructionStream>>#willReturn in SindarinDebugger>>#skip instead of hardcoding the list of return bytecodes
…t-encounters-a-jumpFalse-or-a-jumpTrue-bytecode
|
It fails because of a fuel test and other tests ... so not related |
Fixes #51.
skip used to step over jump bytecodes. Notably, if a comparison before a
ifTrue:ifFalse:message was skipped, it used to skip the comparison and then step the jumpIfFalse bytecode. As this bytecode expected a boolean on the stack (the result of the comparison that has been skipped) and as the result on the stack is (probably) not a boolean, an exceptionMustBeBooleanwas raised and was not handled. As a result,skipUpToentered an infinite loop because we would never reach the aimed node.Now, skips stops on jump bytecodes (notably on
ifTrue:ifFalsemessages) and manages these bytecodes separately: it pops the argument if it has one (this is the case for jumpTrue: and jumpFalse: bytecodes) and it simply does not execute the jump bytecode. Then, it steps to the first next interesting bytecode (I reimplemented this function inDebugSessionto stop on jump bytecodes