3 ms·
Writing a Debugger from Scratch: Stacks
- darkclouds 3y ago[dead]
- asicsp 3y agoPart-1 (Attaching to a Process): https://www.timdbg.com/posts/writing-a-debugger-from-scratch-part-1/ https://www.timdbg.com/posts/writing-a-debugger-from-scratch... Discussion for part-5 (Breakpoints): https://news.ycombinator.com/item?id=37670938 https://news.ycombinator.com/item?id=37670938 (320 points | 57 days ago | 51 comments)
- leowwwa 3y agoAh. nice It is about the process of writing a debugger from scratch. Part 6 specifically focuses on walking call stacks, which is a crucial feature for understanding the state of a program during debugging. The author explains the complexities of stack walking in the context of an x64 Windows debugger, providing detailed insights and code examples. Thanks
- Ygg2 3y agoLove the series. Not to mention debugging Rust felt somewhat neglected. I hope this works on Windows as well as Linux.
- schemescape 3y agoInteresting to read that frame pointer omission may not be worth it: > You'd think that saving a whole register would mean a performance improvement, right? Especially on 32-bit x86 code where registers are at a premium. But it turns out that the cost savings are really pretty neglible. A Microsoft research paper from 2009 talks about measurements that were made in the performance of Windows with and without frame pointers. They found that there was no statistically provable benefit of FPO, and it was decided to disable FPO in Windows XP SP2! A similar investigation was done by Fedora and it was found that performance was typically only 2% different. When Meta enabled frame pointers sometime around 2017, they compared performance between a comparable set of hosts with and without FPO and found no difference. > So why do we continue using FPO? Probably to make life more difficult for people who write debuggers.
- brancz 3y agoSame with profilers. We had to go through a lot of trouble to get unwinding without frame pointers to work on the eBPF-based profiler we work on [1], and even crazier for interpreted languages [2]. [1] https://www.polarsignals.com/blog/posts/2022/11/29/dwarf-based-stack-walking-using-ebpf https://www.polarsignals.com/blog/posts/2022/11/29/dwarf-bas... [2] https://www.polarsignals.com/blog/posts/2023/10/04/profiling-python-and-ruby-with-ebpf https://www.polarsignals.com/blog/posts/2023/10/04/profiling...
- matheusmoreira 3y agoThat's really interesting. I'm gonna make -fno-omit-frame-pointer standard in my projects.