From b2c4b8bded3ff2efaaebe0d8b33c65116f9ef8de Mon Sep 17 00:00:00 2001 From: Alexey Lapshin Date: Sat, 23 Mar 2019 08:08:40 +0000 Subject: [DebugInfo] follow up for "add SectionedAddress to DebugInfo interfaces" [Symbolizer] Add getModuleSectionIndexForAddress() helper routine The https://reviews.llvm.org/D58194 patch changed symbolizer interface. Particularily it requires not only Address but SectionIndex also. Note object::SectionedAddress parameter: Expected symbolizeCode(const std::string &ModuleName, object::SectionedAddress ModuleOffset, StringRef DWPName = ""); There are callers of symbolizer which do not know particular section index. That patch creates getModuleSectionIndexForAddress() routine which will detect section index for the specified address. Thus if caller set ModuleOffset.SectionIndex into object::SectionedAddress::UndefSection state then symbolizer would detect section index using getModuleSectionIndexForAddress routine. Differential Revision: https://reviews.llvm.org/D58848 llvm-svn: 356829 --- llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.h') diff --git a/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.h b/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.h index a49ab000131..d5ad8d0d3c4 100644 --- a/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.h +++ b/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.h @@ -63,6 +63,9 @@ private: uint64_t OpdAddress = 0); std::error_code addCoffExportSymbols(const object::COFFObjectFile *CoffObj); + /// Search for the first occurence of specified Address in ObjectFile. + uint64_t getModuleSectionIndexForAddress(uint64_t Address) const; + object::ObjectFile *Module; std::unique_ptr DebugInfoContext; -- cgit v1.2.3