▲ | jesse__ 5 days ago | |||||||||||||
Oh my god, same. This literally catches bugs with a smoking gun in their hand in a way that's completely impossible with printf. I'd upvote this 100 times if I could. | ||||||||||||||
▲ | sherincall 5 days ago | parent [-] | |||||||||||||
> completely impossible with printf Not printf exactly, but I've found bugs with a combination of mprotect, userfaultfd and backtrace_symbols when I couldn't use HW breakpoints. Basically, mark a set of pages as non-writable so that any writes trigger a pagefault, then register yourself as a pagefault handler for those and see who is doing the write, apply the write and move on. You can do this with LD_PRELOAD without even recompiling the debugee. | ||||||||||||||
|