Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 1 | //===- SymbolizableModule.h -------------------------------------*- C++ -*-===// |
| 2 | // |
Andrew Walbran | 16937d0 | 2019-10-22 13:54:20 +0100 | [diff] [blame] | 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | // This file declares the SymbolizableModule interface. |
| 10 | // |
| 11 | //===----------------------------------------------------------------------===// |
| 12 | #ifndef LLVM_DEBUGINFO_SYMBOLIZE_SYMBOLIZABLEMODULE_H |
| 13 | #define LLVM_DEBUGINFO_SYMBOLIZE_SYMBOLIZABLEMODULE_H |
| 14 | |
| 15 | #include "llvm/DebugInfo/DIContext.h" |
| 16 | #include <cstdint> |
| 17 | |
| 18 | namespace llvm { |
| 19 | namespace symbolize { |
| 20 | |
| 21 | using FunctionNameKind = DILineInfoSpecifier::FunctionNameKind; |
| 22 | |
| 23 | class SymbolizableModule { |
| 24 | public: |
| 25 | virtual ~SymbolizableModule() = default; |
| 26 | |
Andrew Walbran | 3d2c197 | 2020-04-07 12:24:26 +0100 | [diff] [blame^] | 27 | virtual DILineInfo symbolizeCode(object::SectionedAddress ModuleOffset, |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 28 | FunctionNameKind FNKind, |
| 29 | bool UseSymbolTable) const = 0; |
Andrew Walbran | 3d2c197 | 2020-04-07 12:24:26 +0100 | [diff] [blame^] | 30 | virtual DIInliningInfo |
| 31 | symbolizeInlinedCode(object::SectionedAddress ModuleOffset, |
| 32 | FunctionNameKind FNKind, bool UseSymbolTable) const = 0; |
| 33 | virtual DIGlobal |
| 34 | symbolizeData(object::SectionedAddress ModuleOffset) const = 0; |
| 35 | virtual std::vector<DILocal> |
| 36 | symbolizeFrame(object::SectionedAddress ModuleOffset) const = 0; |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 37 | |
| 38 | // Return true if this is a 32-bit x86 PE COFF module. |
| 39 | virtual bool isWin32Module() const = 0; |
| 40 | |
| 41 | // Returns the preferred base of the module, i.e. where the loader would place |
| 42 | // it in memory assuming there were no conflicts. |
| 43 | virtual uint64_t getModulePreferredBase() const = 0; |
| 44 | }; |
| 45 | |
| 46 | } // end namespace symbolize |
| 47 | } // end namespace llvm |
| 48 | |
| 49 | #endif // LLVM_DEBUGINFO_SYMBOLIZE_SYMBOLIZABLEMODULE_H |