laike9m / Cyberbrain

Python debugging, redefined.
http://bit.ly/cyberbrain-features
MIT License
2.51k stars 159 forks source link

Refactor `JumpDetector` #148

Open laike9m opened 2 years ago

laike9m commented 2 years ago

Jump instructions and other instructions are very different. Right now we have to pass a jumped indicator to the value stack, which is very weird. An instruction should either be handled by JumpDetector, or ValueStack.

Potentially, move jump detector to its own file, and let it hold the same value stack. Move jump instruction handlers to jump detector. let it call value stack's pop when needed.