-
Notifications
You must be signed in to change notification settings - Fork 167
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
Fix debug mode API #1605
Comments
Additional concern when debugging a test: adding a A potential fix for this is to compile |
Personally, I use the debugger I built for debugging programs emitted by the compiler. Once The compiler also defaults to enabling debug mode in the assembler during codegen - it must be explicitly disabled, because not having debug information makes the resulting program impossible to debug. It also links in debug-compiled versions of the standard library, etc. The debugger implements its own executor in order to capture additional information about the program, handle specific trace events, and to allow stepping back/forward, etc., and I think that's pretty much a requirement for any half-decent debugging experience. All the tools needed are basically there, they just have to be assembled together into something cohesive, and I think |
A few thoughts on how we can potentially simplify this:
|
Making a
debug.stack
instruction to work is currently much harder than it needs to be. I can never remember all the places I need to go modify to get it to actually work. My workflow while debugging a test is typically:debug.stack
instruction, notice that it doesn't workTest
struct from e.g.to
Notice that this doesn't work either, and remember that the VM probably is built with debug mode off.
Test::expect_stack()
call stack to where I find theprocessor::execute()
call, and change the line fromto
Notice that this doesn't work either.
4. I look for the line that actually calls
Host::on_debug()
, which is inProcess::execute_decorator()
, and comment out theself.decoder.in_debug_mode()
. But that still doesn't work.Conclusion
Clearly I'm missing something maybe "obvious", but every time I spend way too much time fiddling with the assembler and VM to have a
debug.stack
instruction go through. And I work on the VM everyday - I imagine anyone who doesn't simply gives up after a while.I haven't thought about how to fix it, but enabling debug mode should be very easy to do. As I understand, the constraints are that
I'm sure however that there's a way to have a single "debug on" switch that enables everything properly. Some extra nice-to-have's would be:
The text was updated successfully, but these errors were encountered: