LLDB  mainline
ObjectFilePECOFF.h
Go to the documentation of this file.
1 //===-- ObjectFilePECOFF.h --------------------------------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_SOURCE_PLUGINS_OBJECTFILE_PECOFF_OBJECTFILEPECOFF_H
10 #define LLDB_SOURCE_PLUGINS_OBJECTFILE_PECOFF_OBJECTFILEPECOFF_H
11 
12 #include <vector>
13 
14 #include "lldb/Symbol/ObjectFile.h"
15 #include "llvm/Object/COFF.h"
16 
18 public:
19  enum MachineType {
21  MachineAm33 = 0x1d3,
22  MachineAmd64 = 0x8664,
23  MachineArm = 0x1c0,
24  MachineArmNt = 0x1c4,
25  MachineArm64 = 0xaa64,
26  MachineEbc = 0xebc,
27  MachineX86 = 0x14c,
28  MachineIA64 = 0x200,
29  MachineM32R = 0x9041,
30  MachineMips16 = 0x266,
31  MachineMipsFpu = 0x366,
33  MachinePowerPc = 0x1f0,
35  MachineR4000 = 0x166,
36  MachineSh3 = 0x1a2,
37  MachineSh3dsp = 0x1a3,
38  MachineSh4 = 0x1a6,
39  MachineSh5 = 0x1a8,
40  MachineThumb = 0x1c2,
42  };
43 
44  ObjectFilePECOFF(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp,
45  lldb::offset_t data_offset,
46  const lldb_private::FileSpec *file,
47  lldb::offset_t file_offset, lldb::offset_t length);
48 
49  ObjectFilePECOFF(const lldb::ModuleSP &module_sp,
50  lldb::DataBufferSP &header_data_sp,
51  const lldb::ProcessSP &process_sp, lldb::addr_t header_addr);
52 
53  ~ObjectFilePECOFF() override;
54 
55  // Static Functions
56  static void Initialize();
57 
58  static void Terminate();
59 
61 
62  static const char *GetPluginDescriptionStatic();
63 
64  static ObjectFile *
65  CreateInstance(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp,
66  lldb::offset_t data_offset, const lldb_private::FileSpec *file,
67  lldb::offset_t offset, lldb::offset_t length);
68 
70  const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp,
71  const lldb::ProcessSP &process_sp, lldb::addr_t header_addr);
72 
73  static size_t GetModuleSpecifications(const lldb_private::FileSpec &file,
74  lldb::DataBufferSP &data_sp,
75  lldb::offset_t data_offset,
76  lldb::offset_t file_offset,
77  lldb::offset_t length,
79 
80  static bool SaveCore(const lldb::ProcessSP &process_sp,
81  const lldb_private::FileSpec &outfile,
83 
84  static bool MagicBytesMatch(lldb::DataBufferSP &data_sp);
85 
86  static lldb::SymbolType MapSymbolType(uint16_t coff_symbol_type);
87 
88  // LLVM RTTI support
89  static char ID;
90  bool isA(const void *ClassID) const override {
91  return ClassID == &ID || ObjectFile::isA(ClassID);
92  }
93  static bool classof(const ObjectFile *obj) { return obj->isA(&ID); }
94 
95  bool ParseHeader() override;
96 
98  bool value_is_offset) override;
99 
100  lldb::ByteOrder GetByteOrder() const override;
101 
102  bool IsExecutable() const override;
103 
104  uint32_t GetAddressByteSize() const override;
105 
106  // virtual lldb_private::AddressClass
107  // GetAddressClass (lldb::addr_t file_addr);
108 
109  lldb_private::Symtab *GetSymtab() override;
110 
111  bool IsStripped() override;
112 
113  void CreateSections(lldb_private::SectionList &unified_section_list) override;
114 
115  void Dump(lldb_private::Stream *s) override;
116 
118 
119  lldb_private::UUID GetUUID() override;
120 
121  uint32_t GetDependentModules(lldb_private::FileSpecList &files) override;
122 
124 
126 
127  ObjectFile::Type CalculateType() override;
128 
129  ObjectFile::Strata CalculateStrata() override;
130 
131  // PluginInterface protocol
133 
134  uint32_t GetPluginVersion() override;
135 
136  bool IsWindowsSubsystem();
137 
138  uint32_t GetRVA(const lldb_private::Address &addr) const;
141 
144 
145  std::unique_ptr<lldb_private::CallFrameInfo> CreateCallFrameInfo() override;
146 
147 protected:
148  bool NeedsEndianSwap() const;
149 
150  typedef struct dos_header { // DOS .EXE header
151  uint16_t e_magic; // Magic number
152  uint16_t e_cblp; // Bytes on last page of file
153  uint16_t e_cp; // Pages in file
154  uint16_t e_crlc; // Relocations
155  uint16_t e_cparhdr; // Size of header in paragraphs
156  uint16_t e_minalloc; // Minimum extra paragraphs needed
157  uint16_t e_maxalloc; // Maximum extra paragraphs needed
158  uint16_t e_ss; // Initial (relative) SS value
159  uint16_t e_sp; // Initial SP value
160  uint16_t e_csum; // Checksum
161  uint16_t e_ip; // Initial IP value
162  uint16_t e_cs; // Initial (relative) CS value
163  uint16_t e_lfarlc; // File address of relocation table
164  uint16_t e_ovno; // Overlay number
165  uint16_t e_res[4]; // Reserved words
166  uint16_t e_oemid; // OEM identifier (for e_oeminfo)
167  uint16_t e_oeminfo; // OEM information; e_oemid specific
168  uint16_t e_res2[10]; // Reserved words
169  uint32_t e_lfanew; // File address of new exe header
170  } dos_header_t;
171 
172  typedef struct coff_header {
180  } coff_header_t;
181 
182  typedef struct data_directory {
186 
187  typedef struct coff_opt_header {
189  uint8_t major_linker_version = 0;
190  uint8_t minor_linker_version = 0;
197 
198  uint64_t image_base = 0;
213  uint64_t stack_reserve_size = 0;
214  uint64_t stack_commit_size = 0;
215  uint64_t heap_reserve_size = 0;
216  uint64_t heap_commit_size = 0;
218  // uint32_t num_data_dir_entries;
219  std::vector<data_directory>
220  data_dirs; // will contain num_data_dir_entries entries
222 
227  };
228 
229  typedef struct section_header {
230  char name[8];
231  uint32_t vmsize; // Virtual Size
232  uint32_t vmaddr; // Virtual Addr
233  uint32_t size; // File size
234  uint32_t offset; // File offset
235  uint32_t reloff; // Offset to relocations
236  uint32_t lineoff; // Offset to line table entries
237  uint16_t nreloc; // Number of relocation entries
238  uint16_t nline; // Number of line table entries
241 
242  typedef struct coff_symbol {
243  char name[8];
247  uint8_t storage;
248  uint8_t naux;
249  } coff_symbol_t;
250 
251  typedef struct export_directory_entry {
264 
268  lldb::offset_t *offset_ptr,
270  bool ParseCOFFOptionalHeader(lldb::offset_t *offset_ptr);
271  bool ParseSectionHeaders(uint32_t offset);
272 
274 
275  static void DumpDOSHeader(lldb_private::Stream *s,
276  const dos_header_t &header);
277  static void DumpCOFFHeader(lldb_private::Stream *s,
278  const coff_header_t &header);
280  const coff_opt_header_t &header);
284 
285  llvm::StringRef GetSectionName(const section_header_t &sect);
286  static lldb::SectionType GetSectionType(llvm::StringRef sect_name,
287  const section_header_t &sect);
288 
289  typedef std::vector<section_header_t> SectionHeaderColl;
290  typedef SectionHeaderColl::iterator SectionHeaderCollIter;
291  typedef SectionHeaderColl::const_iterator SectionHeaderCollConstIter;
292 
293 private:
294  bool CreateBinary();
295 
302  llvm::Optional<lldb_private::FileSpecList> m_deps_filespec;
303  std::unique_ptr<llvm::object::COFFObjectFile> m_binary;
305 };
306 
307 #endif // LLDB_SOURCE_PLUGINS_OBJECTFILE_PECOFF_OBJECTFILEPECOFF_H
ObjectFilePECOFF::section_header::offset
uint32_t offset
Definition: ObjectFilePECOFF.h:234
ObjectFilePECOFF::coff_symbol::sect
uint16_t sect
Definition: ObjectFilePECOFF.h:245
ObjectFilePECOFF::MagicBytesMatch
static bool MagicBytesMatch(lldb::DataBufferSP &data_sp)
Definition: ObjectFilePECOFF.cpp:196
ObjectFilePECOFF::coff_opt_header::checksum
uint32_t checksum
Definition: ObjectFilePECOFF.h:210
lldb_private::UUID
Definition: UUID.h:23
ObjectFilePECOFF::isA
bool isA(const void *ClassID) const override
Definition: ObjectFilePECOFF.h:90
ObjectFilePECOFF::coff_opt_header::stack_reserve_size
uint64_t stack_reserve_size
Definition: ObjectFilePECOFF.h:213
ObjectFilePECOFF::NeedsEndianSwap
bool NeedsEndianSwap() const
Definition: ObjectFilePECOFF.cpp:340
ObjectFilePECOFF::dos_header::e_magic
uint16_t e_magic
Definition: ObjectFilePECOFF.h:151
ObjectFilePECOFF::dos_header::e_ip
uint16_t e_ip
Definition: ObjectFilePECOFF.h:161
ObjectFilePECOFF::data_directory::vmaddr
uint32_t vmaddr
Definition: ObjectFilePECOFF.h:183
ObjectFilePECOFF::~ObjectFilePECOFF
~ObjectFilePECOFF() override
Definition: ObjectFilePECOFF.cpp:264
lldb_private::ArchSpec
Definition: ArchSpec.h:33
ObjectFilePECOFF::ReadImageData
lldb_private::DataExtractor ReadImageData(uint32_t offset, size_t size)
Definition: ObjectFilePECOFF.cpp:509
ObjectFilePECOFF::dos_header::e_oeminfo
uint16_t e_oeminfo
Definition: ObjectFilePECOFF.h:167
ObjectFilePECOFF::dos_header::e_oemid
uint16_t e_oemid
Definition: ObjectFilePECOFF.h:166
ObjectFilePECOFF::coff_opt_header::minor_os_system_version
uint16_t minor_os_system_version
Definition: ObjectFilePECOFF.h:202
ObjectFilePECOFF::GetDependentModules
uint32_t GetDependentModules(lldb_private::FileSpecList &files) override
Definition: ObjectFilePECOFF.cpp:938
ObjectFilePECOFF::coff_header::modtime
uint32_t modtime
Definition: ObjectFilePECOFF.h:175
ObjectFilePECOFF::m_dos_header
dos_header_t m_dos_header
Definition: ObjectFilePECOFF.h:296
ObjectFilePECOFF::ObjectFilePECOFF
ObjectFilePECOFF(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp, lldb::offset_t data_offset, const lldb_private::FileSpec *file, lldb::offset_t file_offset, lldb::offset_t length)
ObjectFilePECOFF::ParseCOFFOptionalHeader
bool ParseCOFFOptionalHeader(lldb::offset_t *offset_ptr)
Definition: ObjectFilePECOFF.cpp:426
ObjectFilePECOFF::CreateSections
void CreateSections(lldb_private::SectionList &unified_section_list) override
Definition: ObjectFilePECOFF.cpp:821
ObjectFilePECOFF::section_header::size
uint32_t size
Definition: ObjectFilePECOFF.h:233
ObjectFilePECOFF::coff_opt_header::subsystem
uint16_t subsystem
Definition: ObjectFilePECOFF.h:211
ObjectFilePECOFF::MachineWcemIpsv2
@ MachineWcemIpsv2
Definition: ObjectFilePECOFF.h:41
ObjectFilePECOFF::dos_header::e_maxalloc
uint16_t e_maxalloc
Definition: ObjectFilePECOFF.h:157
ObjectFilePECOFF::section_header::lineoff
uint32_t lineoff
Definition: ObjectFilePECOFF.h:236
ObjectFilePECOFF::export_directory_entry::minor_version
uint16_t minor_version
Definition: ObjectFilePECOFF.h:255
lldb_private::ModuleSpecList
Definition: ModuleSpec.h:281
ObjectFilePECOFF::GetUUID
lldb_private::UUID GetUUID() override
Gets the UUID for this object file.
Definition: ObjectFilePECOFF.cpp:879
ObjectFilePECOFF::section_header
Definition: ObjectFilePECOFF.h:229
ObjectFilePECOFF::dos_header::e_res
uint16_t e_res[4]
Definition: ObjectFilePECOFF.h:165
ObjectFilePECOFF::data_directory::vmsize
uint32_t vmsize
Definition: ObjectFilePECOFF.h:184
ObjectFilePECOFF::DumpSectionHeaders
void DumpSectionHeaders(lldb_private::Stream *s)
Definition: ObjectFilePECOFF.cpp:1127
lldb_private::ObjectFile::ObjectFile
ObjectFile(const lldb::ModuleSP &module_sp, const FileSpec *file_spec_ptr, lldb::offset_t file_offset, lldb::offset_t length, const lldb::DataBufferSP &data_sp, lldb::offset_t data_offset)
Construct with a parent module, offset, and header data.
Definition: ObjectFile.cpp:237
ObjectFilePECOFF::MachineType
MachineType
Definition: ObjectFilePECOFF.h:19
ObjectFilePECOFF::MachineArmNt
@ MachineArmNt
Definition: ObjectFilePECOFF.h:24
ObjectFilePECOFF::export_directory_entry::time_date_stamp
uint32_t time_date_stamp
Definition: ObjectFilePECOFF.h:253
ObjectFilePECOFF::MachineAmd64
@ MachineAmd64
Definition: ObjectFilePECOFF.h:22
ObjectFilePECOFF::coff_opt_header::major_linker_version
uint8_t major_linker_version
Definition: ObjectFilePECOFF.h:189
ObjectFilePECOFF::coff_symbol::name
char name[8]
Definition: ObjectFilePECOFF.h:243
ObjectFilePECOFF::GetAddressByteSize
uint32_t GetAddressByteSize() const override
Gets the address size in bytes for the current object file.
Definition: ObjectFilePECOFF.cpp:328
ObjectFilePECOFF::coff_data_dir_type
coff_data_dir_type
Definition: ObjectFilePECOFF.h:223
ObjectFilePECOFF::GetPluginDescriptionStatic
static const char * GetPluginDescriptionStatic()
Definition: ObjectFilePECOFF.cpp:79
lldb_private::SectionList
Definition: Section.h:34
ObjectFilePECOFF::MachineEbc
@ MachineEbc
Definition: ObjectFilePECOFF.h:26
lldb::offset_t
uint64_t offset_t
Definition: lldb-types.h:87
ObjectFilePECOFF::coff_opt_header::sect_alignment
uint32_t sect_alignment
Definition: ObjectFilePECOFF.h:199
ObjectFilePECOFF::coff_opt_header::code_size
uint32_t code_size
Definition: ObjectFilePECOFF.h:191
ObjectFilePECOFF::Terminate
static void Terminate()
Definition: ObjectFilePECOFF.cpp:70
ObjectFilePECOFF::export_directory_entry::address_of_name_ordinals
uint32_t address_of_name_ordinals
Definition: ObjectFilePECOFF.h:262
lldb_private::Stream
Definition: Stream.h:28
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
ObjectFilePECOFF::MachinePowerPcfp
@ MachinePowerPcfp
Definition: ObjectFilePECOFF.h:34
ObjectFilePECOFF::coff_opt_header::heap_reserve_size
uint64_t heap_reserve_size
Definition: ObjectFilePECOFF.h:215
ObjectFilePECOFF::dos_header
Definition: ObjectFilePECOFF.h:150
lldb_private::Target
Definition: Target.h:445
ObjectFilePECOFF::IsExecutable
bool IsExecutable() const override
Tells whether this object file is capable of being the main executable for a process.
Definition: ObjectFilePECOFF.cpp:324
ObjectFilePECOFF::dos_header::e_cparhdr
uint16_t e_cparhdr
Definition: ObjectFilePECOFF.h:155
ObjectFilePECOFF::export_directory_entry::address_of_functions
uint32_t address_of_functions
Definition: ObjectFilePECOFF.h:260
ObjectFilePECOFF::CreateInstance
static ObjectFile * CreateInstance(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp, lldb::offset_t data_offset, const lldb_private::FileSpec *file, lldb::offset_t offset, lldb::offset_t length)
Definition: ObjectFilePECOFF.cpp:84
ObjectFilePECOFF::Dump
void Dump(lldb_private::Stream *s) override
Dump a description of this object to a Stream.
Definition: ObjectFilePECOFF.cpp:974
ObjectFilePECOFF::GetSymtab
lldb_private::Symtab * GetSymtab() override
Gets the symbol table for the currently selected architecture (and object for archives).
Definition: ObjectFilePECOFF.cpp:596
ObjectFilePECOFF::section_header::reloff
uint32_t reloff
Definition: ObjectFilePECOFF.h:235
ObjectFilePECOFF::coff_opt_header::image_size
uint32_t image_size
Definition: ObjectFilePECOFF.h:208
ObjectFilePECOFF::DumpDependentModules
void DumpDependentModules(lldb_private::Stream *s)
Definition: ObjectFilePECOFF.cpp:1147
ObjectFilePECOFF::coff_data_dir_exception_table
@ coff_data_dir_exception_table
Definition: ObjectFilePECOFF.h:226
ObjectFilePECOFF::coff_opt_header::minor_linker_version
uint8_t minor_linker_version
Definition: ObjectFilePECOFF.h:190
ObjectFilePECOFF::coff_opt_header::dll_flags
uint16_t dll_flags
Definition: ObjectFilePECOFF.h:212
ObjectFilePECOFF::coff_symbol::storage
uint8_t storage
Definition: ObjectFilePECOFF.h:247
ObjectFilePECOFF::coff_opt_header::bss_size
uint32_t bss_size
Definition: ObjectFilePECOFF.h:193
lldb_private::FileSpec
Definition: FileSpec.h:56
ObjectFilePECOFF
Definition: ObjectFilePECOFF.h:17
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
ObjectFilePECOFF::m_sect_headers
SectionHeaderColl m_sect_headers
Definition: ObjectFilePECOFF.h:299
ObjectFilePECOFF::IsStripped
bool IsStripped() override
Detect if this object file has been stripped of local symbols.
Definition: ObjectFilePECOFF.cpp:745
ObjectFilePECOFF::coff_opt_header::data_dirs
std::vector< data_directory > data_dirs
Definition: ObjectFilePECOFF.h:220
ObjectFilePECOFF::MachineArm64
@ MachineArm64
Definition: ObjectFilePECOFF.h:25
lldb_private::DataExtractor
Definition: DataExtractor.h:48
ObjectFilePECOFF::dos_header::e_res2
uint16_t e_res2[10]
Definition: ObjectFilePECOFF.h:168
ObjectFilePECOFF::coff_opt_header::minor_image_version
uint16_t minor_image_version
Definition: ObjectFilePECOFF.h:204
ObjectFilePECOFF::export_directory_entry::base
uint32_t base
Definition: ObjectFilePECOFF.h:257
ObjectFilePECOFF::coff_header
Definition: ObjectFilePECOFF.h:172
ObjectFilePECOFF::GetAddress
lldb_private::Address GetAddress(uint32_t rva)
Definition: ObjectFilePECOFF.cpp:497
ObjectFilePECOFF::coff_header::hdrsize
uint16_t hdrsize
Definition: ObjectFilePECOFF.h:178
ObjectFilePECOFF::ParseDOSHeader
static bool ParseDOSHeader(lldb_private::DataExtractor &data, dos_header_t &dos_header)
Definition: ObjectFilePECOFF.cpp:348
ObjectFilePECOFF::MachineThumb
@ MachineThumb
Definition: ObjectFilePECOFF.h:40
ObjectFilePECOFF::coff_opt_header
Definition: ObjectFilePECOFF.h:187
ObjectFilePECOFF::CalculateStrata
ObjectFile::Strata CalculateStrata() override
The object file should be able to calculate the strata of the object file.
Definition: ObjectFilePECOFF.cpp:1205
ObjectFilePECOFF::MachineR4000
@ MachineR4000
Definition: ObjectFilePECOFF.h:35
ObjectFilePECOFF::Initialize
static void Initialize()
Definition: ObjectFilePECOFF.cpp:64
ObjectFilePECOFF::m_coff_header
coff_header_t m_coff_header
Definition: ObjectFilePECOFF.h:297
ObjectFilePECOFF::export_directory_entry::number_of_names
uint32_t number_of_names
Definition: ObjectFilePECOFF.h:259
ObjectFilePECOFF::MachineX86
@ MachineX86
Definition: ObjectFilePECOFF.h:27
ObjectFilePECOFF::export_directory_entry::number_of_functions
uint32_t number_of_functions
Definition: ObjectFilePECOFF.h:258
ObjectFilePECOFF::coff_header::symoff
uint32_t symoff
Definition: ObjectFilePECOFF.h:176
ObjectFilePECOFF::GetFileAddress
lldb::addr_t GetFileAddress(uint32_t rva) const
Definition: ObjectFilePECOFF.cpp:505
ObjectFilePECOFF::SaveCore
static bool SaveCore(const lldb::ProcessSP &process_sp, const lldb_private::FileSpec &outfile, lldb_private::Status &error)
Definition: ObjectFilePECOFF.cpp:190
ObjectFilePECOFF::dos_header::e_minalloc
uint16_t e_minalloc
Definition: ObjectFilePECOFF.h:156
ObjectFilePECOFF::export_directory_entry
Definition: ObjectFilePECOFF.h:251
ObjectFilePECOFF::coff_data_dir_export_table
@ coff_data_dir_export_table
Definition: ObjectFilePECOFF.h:224
ObjectFilePECOFF::coff_opt_header::image_base
uint64_t image_base
Definition: ObjectFilePECOFF.h:198
ObjectFilePECOFF::SectionHeaderColl
std::vector< section_header_t > SectionHeaderColl
Definition: ObjectFilePECOFF.h:289
ObjectFilePECOFF::dos_header::e_crlc
uint16_t e_crlc
Definition: ObjectFilePECOFF.h:154
ObjectFilePECOFF::CreateBinary
bool CreateBinary()
Definition: ObjectFilePECOFF.cpp:214
lldb_private::ConstString
Definition: ConstString.h:40
ObjectFilePECOFF::coff_opt_header::major_subsystem_version
uint16_t major_subsystem_version
Definition: ObjectFilePECOFF.h:205
ObjectFilePECOFF::GetPluginNameStatic
static lldb_private::ConstString GetPluginNameStatic()
Definition: ObjectFilePECOFF.cpp:74
ObjectFilePECOFF::GetArchitecture
lldb_private::ArchSpec GetArchitecture() override
Get the ArchSpec for this object file.
Definition: ObjectFilePECOFF.cpp:1173
ObjectFilePECOFF::coff_opt_header::entry
uint32_t entry
Definition: ObjectFilePECOFF.h:194
ObjectFilePECOFF::dos_header::e_cp
uint16_t e_cp
Definition: ObjectFilePECOFF.h:153
ObjectFilePECOFF::dos_header::e_lfanew
uint32_t e_lfanew
Definition: ObjectFilePECOFF.h:169
ObjectFilePECOFF::ParseDependentModules
uint32_t ParseDependentModules()
Definition: ObjectFilePECOFF.cpp:890
ObjectFilePECOFF::dos_header::e_lfarlc
uint16_t e_lfarlc
Definition: ObjectFilePECOFF.h:163
ObjectFilePECOFF::m_entry_point_address
lldb_private::Address m_entry_point_address
Definition: ObjectFilePECOFF.h:301
ObjectFilePECOFF::coff_opt_header::code_offset
uint32_t code_offset
Definition: ObjectFilePECOFF.h:195
ObjectFilePECOFF::ReadImageDataByRVA
lldb_private::DataExtractor ReadImageDataByRVA(uint32_t rva, size_t size)
Definition: ObjectFilePECOFF.cpp:532
ObjectFilePECOFF::m_coff_header_opt
coff_opt_header_t m_coff_header_opt
Definition: ObjectFilePECOFF.h:298
ObjectFilePECOFF::coff_opt_header::heap_commit_size
uint64_t heap_commit_size
Definition: ObjectFilePECOFF.h:216
ObjectFilePECOFF::coff_symbol
Definition: ObjectFilePECOFF.h:242
ObjectFilePECOFF::coff_symbol_t
struct ObjectFilePECOFF::coff_symbol coff_symbol_t
ObjectFilePECOFF::MachineSh3dsp
@ MachineSh3dsp
Definition: ObjectFilePECOFF.h:37
ObjectFilePECOFF::CreateMemoryInstance
static lldb_private::ObjectFile * CreateMemoryInstance(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp, const lldb::ProcessSP &process_sp, lldb::addr_t header_addr)
Definition: ObjectFilePECOFF.cpp:119
ObjectFilePECOFF::m_uuid
lldb_private::UUID m_uuid
Definition: ObjectFilePECOFF.h:304
ObjectFilePECOFF::dos_header::e_csum
uint16_t e_csum
Definition: ObjectFilePECOFF.h:160
lldb::SymbolType
SymbolType
Symbol types.
Definition: lldb-enumerations.h:611
ObjectFilePECOFF::coff_header::flags
uint16_t flags
Definition: ObjectFilePECOFF.h:179
ObjectFilePECOFF::coff_opt_header::magic
uint16_t magic
Definition: ObjectFilePECOFF.h:188
ObjectFilePECOFF::section_header::nline
uint16_t nline
Definition: ObjectFilePECOFF.h:238
ObjectFilePECOFF::export_directory_entry::major_version
uint16_t major_version
Definition: ObjectFilePECOFF.h:254
ObjectFile.h
ObjectFilePECOFF::MachineUnknown
@ MachineUnknown
Definition: ObjectFilePECOFF.h:20
ObjectFilePECOFF::section_header::flags
uint32_t flags
Definition: ObjectFilePECOFF.h:239
ObjectFilePECOFF::coff_opt_header::loader_flags
uint32_t loader_flags
Definition: ObjectFilePECOFF.h:217
ObjectFilePECOFF::coff_opt_header::reserved1
uint32_t reserved1
Definition: ObjectFilePECOFF.h:207
ObjectFilePECOFF::data_directory_t
struct ObjectFilePECOFF::data_directory data_directory_t
ObjectFilePECOFF::dos_header::e_ss
uint16_t e_ss
Definition: ObjectFilePECOFF.h:158
ObjectFilePECOFF::ParseCOFFHeader
static bool ParseCOFFHeader(lldb_private::DataExtractor &data, lldb::offset_t *offset_ptr, coff_header_t &coff_header)
Definition: ObjectFilePECOFF.cpp:407
ObjectFilePECOFF::MachineSh4
@ MachineSh4
Definition: ObjectFilePECOFF.h:38
ObjectFilePECOFF::DumpCOFFHeader
static void DumpCOFFHeader(lldb_private::Stream *s, const coff_header_t &header)
Definition: ObjectFilePECOFF.cpp:1046
ObjectFilePECOFF::coff_symbol::naux
uint8_t naux
Definition: ObjectFilePECOFF.h:248
ObjectFilePECOFF::dos_header::e_sp
uint16_t e_sp
Definition: ObjectFilePECOFF.h:159
ObjectFilePECOFF::DumpOptCOFFHeader
static void DumpOptCOFFHeader(lldb_private::Stream *s, const coff_opt_header_t &header)
Definition: ObjectFilePECOFF.cpp:1059
ObjectFilePECOFF::section_header_t
struct ObjectFilePECOFF::section_header section_header_t
lldb_private::Status
Definition: Status.h:44
ObjectFilePECOFF::export_directory_entry::address_of_names
uint32_t address_of_names
Definition: ObjectFilePECOFF.h:261
ObjectFilePECOFF::coff_header::nsyms
uint32_t nsyms
Definition: ObjectFilePECOFF.h:177
lldb_private::Symtab
Definition: Symtab.h:21
ObjectFilePECOFF::export_directory_entry::characteristics
uint32_t characteristics
Definition: ObjectFilePECOFF.h:252
uint32_t
ObjectFilePECOFF::ID
static char ID
Definition: ObjectFilePECOFF.h:89
lldb::SectionType
SectionType
Definition: lldb-enumerations.h:645
ObjectFilePECOFF::classof
static bool classof(const ObjectFile *obj)
Definition: ObjectFilePECOFF.h:93
lldb_private::Address
Definition: Address.h:59
ObjectFilePECOFF::ParseSectionHeaders
bool ParseSectionHeaders(uint32_t offset)
Definition: ObjectFilePECOFF.cpp:543
ObjectFilePECOFF::GetPluginVersion
uint32_t GetPluginVersion() override
Definition: ObjectFilePECOFF.cpp:1210
ObjectFilePECOFF::SetLoadAddress
bool SetLoadAddress(lldb_private::Target &target, lldb::addr_t value, bool value_is_offset) override
Sets the load address for an entire module, assuming a rigid slide of sections, if possible in the im...
Definition: ObjectFilePECOFF.cpp:291
ObjectFilePECOFF::m_image_base
lldb::addr_t m_image_base
Definition: ObjectFilePECOFF.h:300
ObjectFilePECOFF::coff_data_dir_import_table
@ coff_data_dir_import_table
Definition: ObjectFilePECOFF.h:225
ObjectFilePECOFF::coff_opt_header::data_size
uint32_t data_size
Definition: ObjectFilePECOFF.h:192
ObjectFilePECOFF::GetModuleSpecifications
static size_t GetModuleSpecifications(const lldb_private::FileSpec &file, lldb::DataBufferSP &data_sp, lldb::offset_t data_offset, lldb::offset_t file_offset, lldb::offset_t length, lldb_private::ModuleSpecList &specs)
Definition: ObjectFilePECOFF.cpp:132
ObjectFilePECOFF::MachineMips16
@ MachineMips16
Definition: ObjectFilePECOFF.h:30
ObjectFilePECOFF::SectionHeaderCollIter
SectionHeaderColl::iterator SectionHeaderCollIter
Definition: ObjectFilePECOFF.h:290
ObjectFilePECOFF::dos_header_t
struct ObjectFilePECOFF::dos_header dos_header_t
ObjectFilePECOFF::coff_opt_header::header_size
uint32_t header_size
Definition: ObjectFilePECOFF.h:209
ObjectFilePECOFF::DumpSectionHeader
void DumpSectionHeader(lldb_private::Stream *s, const section_header_t &sh)
Definition: ObjectFilePECOFF.cpp:1115
ObjectFilePECOFF::CreateCallFrameInfo
std::unique_ptr< lldb_private::CallFrameInfo > CreateCallFrameInfo() override
Creates a plugin-specific call frame info.
Definition: ObjectFilePECOFF.cpp:729
ObjectFilePECOFF::coff_opt_header_t
struct ObjectFilePECOFF::coff_opt_header coff_opt_header_t
ObjectFilePECOFF::MachinePowerPc
@ MachinePowerPc
Definition: ObjectFilePECOFF.h:33
ObjectFilePECOFF::MachineAm33
@ MachineAm33
Definition: ObjectFilePECOFF.h:21
uint16_t
ObjectFilePECOFF::MachineArm
@ MachineArm
Definition: ObjectFilePECOFF.h:23
ObjectFilePECOFF::MapSymbolType
static lldb::SymbolType MapSymbolType(uint16_t coff_symbol_type)
Definition: ObjectFilePECOFF.cpp:203
ObjectFilePECOFF::DumpDOSHeader
static void DumpDOSHeader(lldb_private::Stream *s, const dos_header_t &header)
Definition: ObjectFilePECOFF.cpp:1014
ObjectFilePECOFF::MachineSh3
@ MachineSh3
Definition: ObjectFilePECOFF.h:36
ObjectFilePECOFF::coff_opt_header::major_os_system_version
uint16_t major_os_system_version
Definition: ObjectFilePECOFF.h:201
ObjectFilePECOFF::section_header::vmsize
uint32_t vmsize
Definition: ObjectFilePECOFF.h:231
ObjectFilePECOFF::export_directory_entry::name
uint32_t name
Definition: ObjectFilePECOFF.h:256
ObjectFilePECOFF::MachineSh5
@ MachineSh5
Definition: ObjectFilePECOFF.h:39
ObjectFilePECOFF::coff_symbol::value
uint32_t value
Definition: ObjectFilePECOFF.h:244
ObjectFilePECOFF::SectionHeaderCollConstIter
SectionHeaderColl::const_iterator SectionHeaderCollConstIter
Definition: ObjectFilePECOFF.h:291
ObjectFilePECOFF::dos_header::e_cs
uint16_t e_cs
Definition: ObjectFilePECOFF.h:162
ObjectFilePECOFF::coff_opt_header::stack_commit_size
uint64_t stack_commit_size
Definition: ObjectFilePECOFF.h:214
ObjectFilePECOFF::GetBaseAddress
lldb_private::Address GetBaseAddress() override
Returns base address of this object file.
Definition: ObjectFilePECOFF.cpp:966
ObjectFilePECOFF::dos_header::e_ovno
uint16_t e_ovno
Definition: ObjectFilePECOFF.h:164
ObjectFilePECOFF::coff_header_t
struct ObjectFilePECOFF::coff_header coff_header_t
ObjectFilePECOFF::GetPluginName
lldb_private::ConstString GetPluginName() override
Definition: ObjectFilePECOFF.cpp:1208
ObjectFilePECOFF::CalculateType
ObjectFile::Type CalculateType() override
The object file should be able to calculate its type by looking at its file header and possibly the s...
Definition: ObjectFilePECOFF.cpp:1195
ObjectFilePECOFF::coff_header::nsects
uint16_t nsects
Definition: ObjectFilePECOFF.h:174
ObjectFilePECOFF::coff_opt_header::file_alignment
uint32_t file_alignment
Definition: ObjectFilePECOFF.h:200
ObjectFilePECOFF::GetSectionName
llvm::StringRef GetSectionName(const section_header_t &sect)
Definition: ObjectFilePECOFF.cpp:579
ObjectFilePECOFF::GetEntryPointAddress
lldb_private::Address GetEntryPointAddress() override
Returns the address of the Entry Point in this object file - if the object file doesn't have an entry...
Definition: ObjectFilePECOFF.cpp:948
ObjectFilePECOFF::m_binary
std::unique_ptr< llvm::object::COFFObjectFile > m_binary
Definition: ObjectFilePECOFF.h:303
ObjectFilePECOFF::MachineIA64
@ MachineIA64
Definition: ObjectFilePECOFF.h:28
ObjectFilePECOFF::MachineM32R
@ MachineM32R
Definition: ObjectFilePECOFF.h:29
ObjectFilePECOFF::coff_opt_header::minor_subsystem_version
uint16_t minor_subsystem_version
Definition: ObjectFilePECOFF.h:206
ObjectFilePECOFF::coff_opt_header::major_image_version
uint16_t major_image_version
Definition: ObjectFilePECOFF.h:203
ObjectFilePECOFF::coff_header::machine
uint16_t machine
Definition: ObjectFilePECOFF.h:173
ObjectFilePECOFF::data_directory
Definition: ObjectFilePECOFF.h:182
ObjectFilePECOFF::dos_header::e_cblp
uint16_t e_cblp
Definition: ObjectFilePECOFF.h:152
ObjectFilePECOFF::export_directory_entry
struct ObjectFilePECOFF::export_directory_entry export_directory_entry
ObjectFilePECOFF::coff_opt_header::data_offset
uint32_t data_offset
Definition: ObjectFilePECOFF.h:196
ObjectFilePECOFF::m_deps_filespec
llvm::Optional< lldb_private::FileSpecList > m_deps_filespec
Definition: ObjectFilePECOFF.h:302
lldb_private::ObjectFile
Definition: ObjectFile.h:58
ObjectFilePECOFF::MachineMipsFpu
@ MachineMipsFpu
Definition: ObjectFilePECOFF.h:31
ObjectFilePECOFF::GetRVA
uint32_t GetRVA(const lldb_private::Address &addr) const
Definition: ObjectFilePECOFF.cpp:493
ObjectFilePECOFF::ParseHeader
bool ParseHeader() override
Attempts to parse the object header.
Definition: ObjectFilePECOFF.cpp:266
ObjectFilePECOFF::coff_symbol::type
uint16_t type
Definition: ObjectFilePECOFF.h:246
ObjectFilePECOFF::IsWindowsSubsystem
bool IsWindowsSubsystem()
Definition: ObjectFilePECOFF.cpp:1158
ObjectFilePECOFF::section_header::name
char name[8]
Definition: ObjectFilePECOFF.h:230
lldb::ByteOrder
ByteOrder
Byte ordering definitions.
Definition: lldb-enumerations.h:138
ObjectFilePECOFF::section_header::nreloc
uint16_t nreloc
Definition: ObjectFilePECOFF.h:237
ObjectFilePECOFF::section_header::vmaddr
uint32_t vmaddr
Definition: ObjectFilePECOFF.h:232
ObjectFilePECOFF::GetSectionType
static lldb::SectionType GetSectionType(llvm::StringRef sect_name, const section_header_t &sect)
Definition: ObjectFilePECOFF.cpp:750
ObjectFilePECOFF::MachineMipsFpu16
@ MachineMipsFpu16
Definition: ObjectFilePECOFF.h:32
ObjectFilePECOFF::GetByteOrder
lldb::ByteOrder GetByteOrder() const override
Gets whether endian swapping should occur when extracting data from this object file.
Definition: ObjectFilePECOFF.cpp:322