summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorMichael Pozulp <pozulp.llvm@gmail.com>2019-07-30 07:05:27 +0000
committerMichael Pozulp <pozulp.llvm@gmail.com>2019-07-30 07:05:27 +0000
commit074db9b8e97aefbd7cd95f856dd1b06d3ec19fd1 (patch)
tree02d5f638ae230356c11cb082ec4a9ee06b5542a4 /llvm/lib
parentf9108f76fa877926b9989d10aa08cd12c3bfdc5f (diff)
downloadbcm5719-llvm-074db9b8e97aefbd7cd95f856dd1b06d3ec19fd1.tar.gz
bcm5719-llvm-074db9b8e97aefbd7cd95f856dd1b06d3ec19fd1.zip
Revert "[llvm-objdump] Add warning messages if disassembly + source for problematic inputs"
This reverts r367284 (git commit b1cbe51bdf44098c74f5c74b7bcd8c041a7c6772). My changes to LLVMSymbolizer caused a test to fail: http://lab.llvm.org:8011/builders/clang-ppc64be-linux-lnt/builds/29488 llvm-svn: 367286
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFContext.cpp2
-rw-r--r--llvm/lib/DebugInfo/Symbolize/DIPrinter.cpp17
2 files changed, 12 insertions, 7 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
index ce376827e7f..b7bb9c2347a 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
@@ -1118,8 +1118,8 @@ DILineInfoTable DWARFContext::getLineInfoForAddressRange(
if (!CU)
return Lines;
+ std::string FunctionName = "<invalid>";
uint32_t StartLine = 0;
- std::string FunctionName(DILineInfo::BadString);
getFunctionNameAndStartLineForAddress(CU, Address.Address, Spec.FNKind,
FunctionName, StartLine);
diff --git a/llvm/lib/DebugInfo/Symbolize/DIPrinter.cpp b/llvm/lib/DebugInfo/Symbolize/DIPrinter.cpp
index b1a80cbc458..b2bfef25148 100644
--- a/llvm/lib/DebugInfo/Symbolize/DIPrinter.cpp
+++ b/llvm/lib/DebugInfo/Symbolize/DIPrinter.cpp
@@ -30,6 +30,11 @@
namespace llvm {
namespace symbolize {
+// By default, DILineInfo contains "<invalid>" for function/filename it
+// cannot fetch. We replace it to "??" to make our output closer to addr2line.
+static const char kDILineInfoBadString[] = "<invalid>";
+static const char kBadString[] = "??";
+
// Prints source code around in the FileName the Line.
void DIPrinter::printContext(const std::string &FileName, int64_t Line) {
if (PrintSourceContext <= 0)
@@ -63,16 +68,16 @@ void DIPrinter::printContext(const std::string &FileName, int64_t Line) {
void DIPrinter::print(const DILineInfo &Info, bool Inlined) {
if (PrintFunctionNames) {
std::string FunctionName = Info.FunctionName;
- if (FunctionName == DILineInfo::BadString)
- FunctionName = DILineInfo::Addr2LineBadString;
+ if (FunctionName == kDILineInfoBadString)
+ FunctionName = kBadString;
StringRef Delimiter = PrintPretty ? " at " : "\n";
StringRef Prefix = (PrintPretty && Inlined) ? " (inlined by) " : "";
OS << Prefix << FunctionName << Delimiter;
}
std::string Filename = Info.FileName;
- if (Filename == DILineInfo::BadString)
- Filename = DILineInfo::Addr2LineBadString;
+ if (Filename == kDILineInfoBadString)
+ Filename = kBadString;
else if (Basenames)
Filename = llvm::sys::path::filename(Filename);
if (!Verbose) {
@@ -110,8 +115,8 @@ DIPrinter &DIPrinter::operator<<(const DIInliningInfo &Info) {
DIPrinter &DIPrinter::operator<<(const DIGlobal &Global) {
std::string Name = Global.Name;
- if (Name == DILineInfo::BadString)
- Name = DILineInfo::Addr2LineBadString;
+ if (Name == kDILineInfoBadString)
+ Name = kBadString;
OS << Name << "\n";
OS << Global.Start << " " << Global.Size << "\n";
return *this;
OpenPOWER on IntegriCloud