展示HN:我使用GDB跟踪文件调试JONESFORTH
视频演示了我如何使用由gdb生成的跟踪文件和自定义Python扩展来探索和调试JONESFORTH:
<p><a href="https://youtu.be/giLsd-bik6A?si=R48V_1HR2SgnOFzV" rel="nofollow">https://youtu.be/giLsd-bik6A?si=R48V_1HR2SgnOFzV</a></p>
你对FORTH调试工作流程有什么建议吗?
<p>这是我对JONESFORTH的分支,包含视频中看到的所有基础设施:
<p><a href="https://github.com/dharmatech/jonesforth-steps/tree/main/step-9000" rel="nofollow">https://github.com/dharmatech/jonesforth-steps/tree/main/step-9000</a></p>
阅读JONESFORTH的源代码是理解它的一部分,但使用调试器是另一个非常有帮助的部分。不过,GDB可能会有些麻烦。上述方法有助于使使用GDB进行自省更加简单明了。
<p>这是视频中的跟踪文件:
<p><a href="https://github.com/dharmatech/jonesforth-steps/blob/main/step-9000/trace.norm.md" rel="nofollow">https://github.com/dharmatech/jonesforth-steps/blob/main/step-9000/trace.norm.md</a></p>
查看原文
Video demonstration of how I explore and debug JONESFORTH using a trace file generated by gdb and custom Python extensions:<p><a href="https://youtu.be/giLsd-bik6A?si=R48V_1HR2SgnOFzV" rel="nofollow">https://youtu.be/giLsd-bik6A?si=R48V_1HR2SgnOFzV</a><p>Do you have any suggestions for FORTH debugging workflow?<p>My fork of JONESFORTH with all the infrastructure you see in the video:<p><a href="https://github.com/dharmatech/jonesforth-steps/tree/main/step-9000" rel="nofollow">https://github.com/dharmatech/jonesforth-steps/tree/main/ste...</a><p>Reading the JONESFORTH source code is one part of understanding it.
But using the debugger is another very helpful part.
GDB can be quite fiddly though.
The above approach helps to make introspection with GDB more straightforward.<p>Here's the trace file from the video:<p><a href="https://github.com/dharmatech/jonesforth-steps/blob/main/step-9000/trace.norm.md" rel="nofollow">https://github.com/dharmatech/jonesforth-steps/blob/main/ste...</a>