3 ms·
Compiling to C with #line directive actually gives a good enough debugging experience, similar to compiling to JavaScript with source map. This is much easier t
by sanxiyn 11y ago
Compiling to C with #line directive actually gives a good enough debugging experience, similar to compiling to JavaScript with source map. This is much easier than generating debug info, even with LLVM.
- pcwalton 11y agoI don't think it's good enough. You can't inspect variables, types will be wrong, any namespacing you're doing will leak into the debugger, single step won't give you the right semantics unless your language is extremely close to C, gdb pretty printing won't know how to print your language's values, etc. Backtraces will sort of work (although the name mangling will leak through), but little else will. You really need to generate DWARF directly in your frontend in order to have an acceptable debugging experience.