diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 20:50:12 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 20:50:12 +0000 |
commit | e6d1592492a3a379186bfb02bd0f4eda0669c0d5 (patch) | |
tree | 599ab169a01f1c86eda9adc774edaedde2f2db5b /lib/DebugInfo/Symbolize/SymbolizableObjectFile.h | |
parent | 1a56a5ead7a2e84bee8240f5f6b033b5f1707154 (diff) |
Diffstat (limited to 'lib/DebugInfo/Symbolize/SymbolizableObjectFile.h')
-rw-r--r-- | lib/DebugInfo/Symbolize/SymbolizableObjectFile.h | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/lib/DebugInfo/Symbolize/SymbolizableObjectFile.h b/lib/DebugInfo/Symbolize/SymbolizableObjectFile.h index 216cca8de4f5..9cab94178c1b 100644 --- a/lib/DebugInfo/Symbolize/SymbolizableObjectFile.h +++ b/lib/DebugInfo/Symbolize/SymbolizableObjectFile.h @@ -1,9 +1,8 @@ //===- SymbolizableObjectFile.h ---------------------------------*- C++ -*-===// // -// 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 // //===----------------------------------------------------------------------===// // @@ -32,14 +31,17 @@ namespace symbolize { class SymbolizableObjectFile : public SymbolizableModule { public: static ErrorOr<std::unique_ptr<SymbolizableObjectFile>> - create(object::ObjectFile *Obj, std::unique_ptr<DIContext> DICtx); + create(const object::ObjectFile *Obj, std::unique_ptr<DIContext> DICtx); - DILineInfo symbolizeCode(uint64_t ModuleOffset, FunctionNameKind FNKind, + DILineInfo symbolizeCode(object::SectionedAddress ModuleOffset, + FunctionNameKind FNKind, bool UseSymbolTable) const override; - DIInliningInfo symbolizeInlinedCode(uint64_t ModuleOffset, + DIInliningInfo symbolizeInlinedCode(object::SectionedAddress ModuleOffset, FunctionNameKind FNKind, bool UseSymbolTable) const override; - DIGlobal symbolizeData(uint64_t ModuleOffset) const override; + DIGlobal symbolizeData(object::SectionedAddress ModuleOffset) const override; + std::vector<DILocal> + symbolizeFrame(object::SectionedAddress ModuleOffset) const override; // Return true if this is a 32-bit x86 PE COFF module. bool isWin32Module() const override; @@ -63,7 +65,10 @@ private: uint64_t OpdAddress = 0); std::error_code addCoffExportSymbols(const object::COFFObjectFile *CoffObj); - object::ObjectFile *Module; + /// Search for the first occurence of specified Address in ObjectFile. + uint64_t getModuleSectionIndexForAddress(uint64_t Address) const; + + const object::ObjectFile *Module; std::unique_ptr<DIContext> DebugInfoContext; struct SymbolDesc { @@ -72,14 +77,14 @@ private: // the following symbol. uint64_t Size; - friend bool operator<(const SymbolDesc &s1, const SymbolDesc &s2) { - return s1.Addr < s2.Addr; + bool operator<(const SymbolDesc &RHS) const { + return Addr != RHS.Addr ? Addr < RHS.Addr : Size < RHS.Size; } }; - std::map<SymbolDesc, StringRef> Functions; - std::map<SymbolDesc, StringRef> Objects; + std::vector<std::pair<SymbolDesc, StringRef>> Functions; + std::vector<std::pair<SymbolDesc, StringRef>> Objects; - SymbolizableObjectFile(object::ObjectFile *Obj, + SymbolizableObjectFile(const object::ObjectFile *Obj, std::unique_ptr<DIContext> DICtx); }; |