diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2020-07-31 21:22:58 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2020-07-31 21:22:58 +0000 |
| commit | 5ffd83dbcc34f10e07f6d3e968ae6365869615f4 (patch) | |
| tree | 0e9f5cf729dde39f949698fddef45a34e2bc7f44 /contrib/llvm-project/llvm/lib/DebugInfo/GSYM/LookupResult.cpp | |
| parent | 1799696096df87b52968b8996d00c91e0a5de8d9 (diff) | |
| parent | cfca06d7963fa0909f90483b42a6d7d194d01e08 (diff) | |
Notes
Diffstat (limited to 'contrib/llvm-project/llvm/lib/DebugInfo/GSYM/LookupResult.cpp')
| -rw-r--r-- | contrib/llvm-project/llvm/lib/DebugInfo/GSYM/LookupResult.cpp | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/contrib/llvm-project/llvm/lib/DebugInfo/GSYM/LookupResult.cpp b/contrib/llvm-project/llvm/lib/DebugInfo/GSYM/LookupResult.cpp index c54b166b2887..8a624226b1d3 100644 --- a/contrib/llvm-project/llvm/lib/DebugInfo/GSYM/LookupResult.cpp +++ b/contrib/llvm-project/llvm/lib/DebugInfo/GSYM/LookupResult.cpp @@ -21,7 +21,7 @@ std::string LookupResult::getSourceFile(uint32_t Index) const { if (Index < Locations.size()) { if (!Locations[Index].Dir.empty()) { if (Locations[Index].Base.empty()) { - Fullpath = Locations[Index].Dir; + Fullpath = std::string(Locations[Index].Dir); } else { llvm::SmallString<64> Storage; llvm::sys::path::append(Storage, Locations[Index].Dir, @@ -29,25 +29,30 @@ std::string LookupResult::getSourceFile(uint32_t Index) const { Fullpath.assign(Storage.begin(), Storage.end()); } } else if (!Locations[Index].Base.empty()) - Fullpath = Locations[Index].Base; + Fullpath = std::string(Locations[Index].Base); } return Fullpath; } raw_ostream &llvm::gsym::operator<<(raw_ostream &OS, const SourceLocation &SL) { - OS << SL.Name << " @ "; - if (!SL.Dir.empty()) { - OS << SL.Dir; - if (SL.Dir.contains('\\') and not SL.Dir.contains('/')) - OS << '\\'; + OS << SL.Name; + if (SL.Offset > 0) + OS << " + " << SL.Offset; + if (SL.Dir.size() || SL.Base.size()) { + OS << " @ "; + if (!SL.Dir.empty()) { + OS << SL.Dir; + if (SL.Dir.contains('\\') and not SL.Dir.contains('/')) + OS << '\\'; + else + OS << '/'; + } + if (SL.Base.empty()) + OS << "<invalid-file>"; else - OS << '/'; + OS << SL.Base; + OS << ':' << SL.Line; } - if (SL.Base.empty()) - OS << "<invalid-file>"; - else - OS << SL.Base; - OS << ':' << SL.Line; return OS; } |
