r/seed7 • u/chikega • Jan 04 '26
Debugging Seed7 in VS Code
Got Seed7 debugging working in VSCode with lldb. Had to set function breakpoints on the generated C code, but then it allows you to step through the actual .sd7 source. Setup was a bit tricky but appears to be worth it. 🚀🚀🚀
8
Upvotes
View all comments
Show parent comment
2
u/chikega Jan 04 '26
Thank you! 🤓 Yes, I used the -g flag to generate debug information (and -e to signal uncaught exceptions).
To clarify about the function breakpoints: I didn't modify the generated C code at all. The workflow was:
Why function breakpoints? Because VS Code doesn't recognize .sd7 files as debuggable - clicking the gutter to set line breakpoints in .sd7 files doesn't work (no red dot appears). However, the debugger (lldb/CodeLLDB) does understand function breakpoints by C function name. Once stopped at a function breakpoint, the debug info from -g correctly maps back to the .sd7 source, and I can step through the Seed7 code line by line.
The only "manual" step is looking up the C function name in tmp_myprogram.c to create the function breakpoint. If there were a way for the compiler to output a mapping file (like function_name -> o_XXXX_function_name), it could make setting breakpoints even easier, though the current workflow is pretty manageable. 🚀🚀🚀