[PATCH] D56453: Modify InputSectionBase::getLocation to add section and offset to every location string.
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 8 13:34:24 PST 2019
ruiu added inline comments.
================
Comment at: ELF/InputSection.cpp:291
std::string InputSectionBase::getLocation(uint64_t Offset) {
+ std::string SecAndOffset = (Name + "+0x" + utohexstr(Offset)).str();
+
----------------
Remove an extraneous space after `=`.
================
Comment at: ELF/InputSection.cpp:310
if (Defined *D = getEnclosingFunction<ELFT>(Offset))
- return SrcFile + ":(function " + toString(*D) + ")";
+ return SrcFile + ":(function " + toString(*D) + ": " + SecAndOffset + ")";
----------------
I think that the idea here is that a function name and an object file name uniquely identifies an error location. A section name and an offset is the last resort if there's no other information we can display.
Did you find it useful to print out a section name and an offset in addition to function name? If so, in what situation?
Repository:
rLLD LLVM Linker
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56453/new/
https://reviews.llvm.org/D56453
More information about the llvm-commits
mailing list