[PATCH] D79165: [DebugInfo] - DWARFDebugFrame: do not call abort() on errors.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 1 02:03:24 PDT 2020


jhenderson added inline comments.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFContext.cpp:816
                                     isLittleEndian(), DObj->getAddressSize());
-  DebugFrame.reset(new DWARFDebugFrame(getArch(), false /* IsEH */));
-  DebugFrame->parse(debugFrameData);
+  std::unique_ptr<DWARFDebugFrame> debugFrame =
+      std::make_unique<DWARFDebugFrame>(getArch(), /*IsEH=*/false);
----------------
What do you think about fixing the naming of this variable to use UpperCamelCase here? (I see there might be some concerns, hence the question).


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp:412-415
+            return make_error<StringError>(
+                "Unknown augmentation character in entry at 0x" +
+                    Twine::utohexstr(StartOffset),
+                inconvertibleErrorCode());
----------------
`createStringError` I think would be better?

`createStringError` would also allow this to change back to PRIx64, if I'm not mistaken.

Also, `inconvertibleErrorCode()` should probably be replaced with something else, probably `invalid_argument`.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp:421-424
+              return make_error<StringError>(
+                  "Duplicate personality in entry at 0x" +
+                      Twine::utohexstr(StartOffset),
+                  inconvertibleErrorCode());
----------------
Ditto to above.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp:439-442
+              return make_error<StringError>(
+                  "'z' must be the first character at 0x" +
+                      Twine::utohexstr(StartOffset),
+                  inconvertibleErrorCode());
----------------
Ditto to above.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp:458-460
+            return make_error<StringError>("Parsing augmentation data at 0x" +
+                                               Twine::utohexstr(StartOffset),
+                                           inconvertibleErrorCode());
----------------
Ditto to above.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp:485-488
+          return make_error<StringError>("Parsing FDE data at 0x" +
+                                             Twine::utohexstr(StartOffset) +
+                                             " failed due to missing CIE",
+                                         inconvertibleErrorCode());
----------------
Ditto to above.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp:515-518
+            return make_error<StringError>("Parsing augmentation data at 0x" +
+                                               Twine::utohexstr(StartOffset) +
+                                               " failed",
+                                           inconvertibleErrorCode());
----------------
Ditto to above.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp:535-538
+      return make_error<StringError>("Parsing entry instructions at 0x" +
+                                         Twine::utohexstr(StartOffset) +
+                                         " failed",
+                                     inconvertibleErrorCode());
----------------
Ditto to above.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79165/new/

https://reviews.llvm.org/D79165





More information about the llvm-commits mailing list