blob: 51e92b83eadbac02fe263daabb1ff40ffa51f0de [file] [log] [blame]
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01001//===- SymbolizableModule.h -------------------------------------*- C++ -*-===//
2//
Andrew Walbran16937d02019-10-22 13:54:20 +01003// 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 Scull5e1ddfa2018-08-14 10:06:54 +01006//
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
18namespace llvm {
19namespace symbolize {
20
21using FunctionNameKind = DILineInfoSpecifier::FunctionNameKind;
22
23class SymbolizableModule {
24public:
25 virtual ~SymbolizableModule() = default;
26
Andrew Walbran3d2c1972020-04-07 12:24:26 +010027 virtual DILineInfo symbolizeCode(object::SectionedAddress ModuleOffset,
Olivier Deprezf4ef2d02021-04-20 13:36:24 +020028 DILineInfoSpecifier LineInfoSpecifier,
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010029 bool UseSymbolTable) const = 0;
Andrew Walbran3d2c1972020-04-07 12:24:26 +010030 virtual DIInliningInfo
31 symbolizeInlinedCode(object::SectionedAddress ModuleOffset,
Olivier Deprezf4ef2d02021-04-20 13:36:24 +020032 DILineInfoSpecifier LineInfoSpecifier,
33 bool UseSymbolTable) const = 0;
Andrew Walbran3d2c1972020-04-07 12:24:26 +010034 virtual DIGlobal
35 symbolizeData(object::SectionedAddress ModuleOffset) const = 0;
36 virtual std::vector<DILocal>
37 symbolizeFrame(object::SectionedAddress ModuleOffset) const = 0;
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010038
39 // Return true if this is a 32-bit x86 PE COFF module.
40 virtual bool isWin32Module() const = 0;
41
42 // Returns the preferred base of the module, i.e. where the loader would place
43 // it in memory assuming there were no conflicts.
44 virtual uint64_t getModulePreferredBase() const = 0;
45};
46
47} // end namespace symbolize
48} // end namespace llvm
49
50#endif // LLVM_DEBUGINFO_SYMBOLIZE_SYMBOLIZABLEMODULE_H