[llvm] [DebugInfo] Separate error generation from reporting in DWARFHeaderUnit::extract (PR #68242)

Alex Langford via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 13 14:35:19 PDT 2023


================
@@ -89,9 +89,12 @@ void fixupIndexV4(DWARFContext &C, DWARFUnitIndex &Index) {
     DWARFDataExtractor Data(DObj, S, C.isLittleEndian(), 0);
     while (Data.isValidOffset(Offset)) {
       DWARFUnitHeader Header;
-      if (!Header.extract(C, Data, &Offset, DWARFSectionKind::DW_SECT_INFO)) {
+      if (Error ExtractionErr = Header.extract(
+              C, Data, &Offset, DWARFSectionKind::DW_SECT_INFO)) {
         logAllUnhandledErrors(
-            createError("Failed to parse CU header in DWP file"), errs());
+            joinErrors(createError("Failed to parse CU header in DWP file"),
+                       std::move(ExtractionErr)),
+            errs());
----------------
bulbazord wrote:

@dwblaikie I hacked up `DWARFContext::fixupIndex` by adding an early return before any work is done and ran the llvm test suite. It doesn't look like any tests failed after that though. I'm not sure how this codepath is triggered. Do you have any suggestions here? I'd like to continue making progress improving the error handling in the LLVM DWARF Parser and refactoring LLDB to use it.

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


More information about the llvm-commits mailing list