Replies: 2 comments 2 replies
-
I think it should be behind a compile-time feature flag, for people that want a minimal build (ex. quickjs-libc.c)
Only if it doesn't regress the common case, which I suspect it will. If it does, what could work is breaking out JS_CallInternal to a separate source file and include it twice in quickjs.c, one with the regular dispatch table, and one with the debug table.
I'd rather not add new public modules without careful consideration. It's no problem to add a C module for use in your JS tests though.
Per context, right? That's the unit of execution. |
Beta Was this translation helpful? Give feedback.
-
Was curious if anyone had messed with porting over koush changes to ng directly. I was able to port over the changes made for debugger support fairly easily, but I believe I'm running into issues with line number calculation preventing breakpoints from working, and some odd behavior in stepping. |
Beta Was this translation helpful? Give feedback.
-
I'm willing to take a stab at implementing debugger support as tracked in #119.
Are the maintainers interested in accepting a PR implementing a debugger? If so, I'd appreciate early feedback on the approach I plan to take, as my C is a bit rusty (pun intended, write most systems code in rust).
Overall plan
Existing implementation by koush
I have taken a look at the implementation at https://github.com/koush/quickjs, which seems reasonable; it generates two dispatch tables, and if the debugger is active, switches to the dispatch table that. The transport code (e.g. that allows an external debugger to open a TCP connection and control the quickjs debugger) seems to not be 100% compatible with the Debug Adapter Protocol. It also seems that no automated tests are included.
Upfront question
tests/assert.js
). Given that these tests would want to manipulate the runtime, this would entail adding a C module to expose those functions to quickjs itself. Would that be an acceptable route for writing debugger tests? If so, I would propose to create a new C module,qjs:qjs
.Questions to answer later
I'll do some prototyping and more investigation. Later I would like to get consensus on:
5. The API between QuickJS and a debugger stub
6. The debugging semantic model (options); per runtime, per context; should we do the same as koush w.r.t showing multiple threads for each context?
Beta Was this translation helpful? Give feedback.
All reactions