[PATCH] D78558: [Support] Make DataExtractor error messages more clear

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 21 06:27:05 PDT 2020


jhenderson added inline comments.


================
Comment at: llvm/lib/Support/DataExtractor.cpp:27
+        ", 0x%" PRIx64 ")",
+        Data.size(), Offset, Offset + Size);
+  return false;
----------------
My instinct says that this needs to be Data.size() + Offset. I'm reading some of the changed messages in the tests and getting confused by how they line up with the range Example: "offset 0x48 while reading [0xbadbeef, 0xbadbef7)" - what is the offset 0x48 referring to? I think "offset 0xbadbef6 while reading..." (or whatever the value actually should be) might be clearer.


================
Comment at: llvm/test/DebugInfo/X86/dwarfdump-debug-loc-error-cases2.s:16
 # CHECK-NEXT: DW_AT_location    (0x00000036: )
 # ERR:    error: unexpected end of data at offset 0x48
 
----------------
Does this error message need updating?


================
Comment at: llvm/test/DebugInfo/X86/dwarfdump-debug-loclists-error-cases2.s:16
 # CHECK-NEXT: DW_AT_location    (0x00000025
 # ERR:    error: unexpected end of data at offset 0x34
 
----------------
Same as above.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78558





More information about the llvm-commits mailing list