logoalt Hacker News

luikoreyesterday at 11:12 PM2 repliesview on HN

Nearly ideal. The only stopper for me is missing a way to add source level debugging info.


Replies

s3grahamtoday at 12:10 AM

I'm guessing you mean dwarf, but I started on a pdb library that I'd planned to use along-side qbe eventually. (The code currently lives in a jitting-C compiler https://scot.tg/2023/05/02/debugging-with-pdbs/ that uses dynasm directly though.)

torginusyesterday at 11:20 PM

Hare did the legwork of adding proper DWARF support afaik. Btw that spec is huge, and the debug info generator ended up being larger than the rest of the compiler at that point.

Btw adding some non-standard debugging support to QBE is not impossibly hard even without that. You can inject bogus no-ops per line, force the compiler to keep them, and it will dutifully track all state values throughout the pipeline, and likewise you can track values from variables to SSA assignments, to temp registers to actual registers, its mostly bookkeeping.