2015-07-30 14:18:19 +02:00
|
|
|
# Debugger
|
|
|
|
|
|
|
|
After some tryouts it ended up being an Opal application. That is ruby as javascript in the browser.
|
|
|
|
|
|
|
|
![Debugger](https://raw.githubusercontent.com/salama/salama-debugger/master/static/debugger.png)
|
|
|
|
|
|
|
|
- On the left are the classes of the system. Next idea is to have hover info about them.
|
|
|
|
- Next a source code view (not implemented)
|
2015-10-27 11:44:02 +01:00
|
|
|
- next a view of the Register Instructions
|
2015-07-30 14:18:19 +02:00
|
|
|
- last section, current block with current Register Instruction highlighted
|
|
|
|
- step (next) button for single stepping
|
2015-10-07 11:24:02 +02:00
|
|
|
- state: starting , running , exited
|
|
|
|
- bottom row are the registers. If the register holds an object the variables are shown.
|
2015-07-30 14:18:19 +02:00
|
|
|
|
2015-10-07 11:24:02 +02:00
|
|
|
## Register View
|
2015-07-06 13:20:21 +02:00
|
|
|
|
2015-10-07 11:24:02 +02:00
|
|
|
The Register view is now greatly improved, especially in it's dynamic features:
|
2015-07-06 13:28:24 +02:00
|
|
|
|
2015-10-07 11:24:02 +02:00
|
|
|
- when the contents update the register obviously updates
|
|
|
|
- when the object that the register holds updates, the new value is shown immediately
|
|
|
|
- hovering over a variable will **expand that variable** .
|
|
|
|
- the hovering works recursively, so it is possible to drill pdown into objects for sevaral levels
|
2015-07-06 13:28:24 +02:00
|
|
|
|
|
|
|
|
2015-10-07 11:24:02 +02:00
|
|
|
### Debugging the debugger
|
2015-07-06 13:28:24 +02:00
|
|
|
|
2015-10-07 11:24:02 +02:00
|
|
|
Opal is pre 1.0 and is a wip. While current source map support is quite good, one only gets
|
|
|
|
real lines when switching debug on. Debug make it load every single file seperately, slooows it
|
|
|
|
down in other words. Set DEBUG environement to swithc it on.
|
2015-07-06 13:28:24 +02:00
|
|
|
|
2015-10-07 11:24:02 +02:00
|
|
|
I set the sprockets cache to mem-cache and that increase load time from 12s to 1 , so it's quite
|
|
|
|
usable and restarting a debug is fine.
|
2015-07-06 13:28:24 +02:00
|
|
|
|
2015-10-07 11:24:02 +02:00
|
|
|
## Todos
|
|
|
|
|
|
|
|
Currently only one source is supported. I change the code.rb file to debug a new problem.
|
|
|
|
|
|
|
|
Parsing (parslet) does not work in opal. So s-expressions are used. I use the parser or interpreter
|
|
|
|
to spew those out. Having a dropdown would be nice, and not even so difficult, but it happens rarely.
|
|
|
|
|
|
|
|
Breakpoints would be nice at some point. Both in step count and variable value.
|
|
|
|
|
|
|
|
Seeing the source code should be possible, just have to keep it around.
|