diff options
Diffstat (limited to 'lib/DebugInfo/Symbolize/DIPrinter.cpp')
-rw-r--r-- | lib/DebugInfo/Symbolize/DIPrinter.cpp | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/lib/DebugInfo/Symbolize/DIPrinter.cpp b/lib/DebugInfo/Symbolize/DIPrinter.cpp index c1e2536d6e20..b2bfef251485 100644 --- a/lib/DebugInfo/Symbolize/DIPrinter.cpp +++ b/lib/DebugInfo/Symbolize/DIPrinter.cpp @@ -1,9 +1,8 @@ //===- lib/DebugInfo/Symbolize/DIPrinter.cpp ------------------------------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // @@ -19,6 +18,7 @@ #include "llvm/Support/Format.h" #include "llvm/Support/LineIterator.h" #include "llvm/Support/MemoryBuffer.h" +#include "llvm/Support/Path.h" #include "llvm/Support/raw_ostream.h" #include <algorithm> #include <cmath> @@ -78,8 +78,13 @@ void DIPrinter::print(const DILineInfo &Info, bool Inlined) { std::string Filename = Info.FileName; if (Filename == kDILineInfoBadString) Filename = kBadString; + else if (Basenames) + Filename = llvm::sys::path::filename(Filename); if (!Verbose) { - OS << Filename << ":" << Info.Line << ":" << Info.Column << "\n"; + OS << Filename << ":" << Info.Line; + if (Style == OutputStyle::LLVM) + OS << ":" << Info.Column; + OS << "\n"; printContext(Filename, Info.Line); return; } @@ -117,5 +122,28 @@ DIPrinter &DIPrinter::operator<<(const DIGlobal &Global) { return *this; } +DIPrinter &DIPrinter::operator<<(const DILocal &Local) { + OS << Local.FunctionName << '\n'; + OS << Local.Name << '\n'; + if (Local.DeclFile.empty()) + OS << "??"; + else + OS << Local.DeclFile; + OS << ':' << Local.DeclLine << '\n'; + if (Local.FrameOffset) + OS << *Local.FrameOffset << ' '; + else + OS << "?? "; + if (Local.Size) + OS << *Local.Size << ' '; + else + OS << "?? "; + if (Local.TagOffset) + OS << *Local.TagOffset << '\n'; + else + OS << "??\n"; + return *this; +} + } // end namespace symbolize } // end namespace llvm |