savi-lang / savi

A fast language for programmers who are passionate about their craft.
BSD 3-Clause "New" or "Revised" License
156 stars 12 forks source link

Fix Crystal backtrace printing using `-gdwarf-4`. #389

Closed jemc closed 2 years ago

jemc commented 2 years ago

Even though Crystal claims to support DWARF 5 (https://github.com/crystal-lang/crystal/pull/11399), it actually chokes if encountering a DWARF 5 attribute, giving broken exception backtraces with a message like this:

Unable to load dwarf information: Unknown DW_FORM_strx1 (Exception)

Starting with clang-14, Clang will prefer DWARF 5 by default, which will make Savi un-debuggable when hitting an exception.

Thus, when generating the LLVM ext, we need to ask Clang to use DWARF 4 instead, for Crystal's sake.