[PATCH] D44562: [ELF] Rework debug line parsing to use llvm::Error and callbacks (LLD-side)

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 20 03:44:51 PDT 2018


jhenderson added a comment.

@rafael on the mailing list:

> Now that I think of it, the fact that lld could not parse the debug info to provide a better error message should always be a note, not an error, regardless of how broken the section happens to be.

To be clear, are you saying you're happy with the warnings for now, or would you prefer to drop the severity to just use "message()"? Also, what do you think about the generic error type which currently emits an error? I'd be happy to change the severity of that one too. It's currently an error because we don't expect an Error of that type ever to be reported.



================
Comment at: ELF/InputFiles.cpp:130
+  // built via -r links or LTO. See PR36793.
+  if (LineData.isValidOffset(0)) {
+    Expected<const DWARFDebugLine::LineTable *> ErrOrLineTable =
----------------
espindola wrote:
> When do we expect to have LineData that doesn't include the current CU?
LineData contains the contents of the .debug_line section. It is possible to have an empty section, or a missing section, in which case there will be no valid contents in LineData. Previously, when LLD requested parsing of this section, the parser would return false immediately, because the offset was invalid. With the changes in D44560, an Error is now returned saying the offset is invalid.

In addition, since an object file can contain multiple CUs (e.g. via LTO or -r links), some of which might be missing debug data and others not, we can't know for certain using this method that offset 0 is the offset of the CU for the corresponding symbol (see the reproducible in PR36793).


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D44562





More information about the llvm-commits mailing list