[llvm] [DebugInfo] Allow .eh_frame CFI programs to be parsed lazily (PR #214895)

Rafael Auler via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 14 12:56:20 PDT 2026


rafaelauler wrote:

Thanks, I like the idea of parsing less when dumping only part of debug info. This was a bit more involved of a change but still reasonable, and I pushed one implementation of that.

Now we put two new member functions to the public interfaces of DWARFDebugFrame: parseCFIProgram and parseAllCFIPrograms. Note that previously BOLT was directly calling cfis().parse, so this became a bit more polished for the llvm-dwarfdump use case. The dumper can now call parseCFIProgram on demand, which means that if only a specific entry (in a given offset) is being dumped, no other entry will be parsed. And now DWARFContext::dump() gets the debug frame object with the new interface getDebugFrame(/*ParseCFIProgram=*/false), explicitly asking for delayed parsing of CFI. In that way, we can implement the scenario you mentioned.

The scenario was also encoded in a new test case with 1 CIE and 3 FDEs, one of which is invalid. We then run llvm-dwarfdump and show that it does not stop the dump in two cases: if only the healthy entry needs to be dumped, it does not error at all, and if all entries are to be dumped, it does error but with a recoverable error, and keeps dumping the rest. This is a change in behavior, though, as previously we would not recover from the error and stop the dump -- but I think this is a better behavior, but let me know what you think.

https://github.com/llvm/llvm-project/pull/214895


More information about the llvm-commits mailing list