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 
60  static llvm::StringRef GetPluginNameStatic() { return "pe-coff"; }
61 
62  static llvm::StringRef 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,
82  lldb::SaveCoreStyle &core_style,
84 
85  static bool MagicBytesMatch(lldb::DataBufferSP &data_sp);
86 
87  static lldb::SymbolType MapSymbolType(uint16_t coff_symbol_type);
88 
89  // LLVM RTTI support
90  static char ID;
91  bool isA(const void *ClassID) const override {
92  return ClassID == &ID || ObjectFile::isA(ClassID);
93  }
94  static bool classof(const ObjectFile *obj) { return obj->isA(&ID); }
95 
96  bool ParseHeader() override;
97 
99  bool value_is_offset) override;
100 
101  lldb::ByteOrder GetByteOrder() const override;
102 
103  bool IsExecutable() const override;
104 
105  uint32_t GetAddressByteSize() const override;
106 
107  // virtual lldb_private::AddressClass
108  // GetAddressClass (lldb::addr_t file_addr);
109 
110  lldb_private::Symtab *GetSymtab() override;
111 
112  bool IsStripped() override;
113 
114  void CreateSections(lldb_private::SectionList &unified_section_list) override;
115 
116  void Dump(lldb_private::Stream *s) override;
117 
119 
120  lldb_private::UUID GetUUID() override;
121 
122  uint32_t GetDependentModules(lldb_private::FileSpecList &files) override;
123 
125 
127 
128  ObjectFile::Type CalculateType() override;
129 
130  ObjectFile::Strata CalculateStrata() override;
131 
132  // PluginInterface protocol
133  llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
134 
135  bool IsWindowsSubsystem();
136 
137  uint32_t GetRVA(const lldb_private::Address &addr) const;
140 
143 
144  std::unique_ptr<lldb_private::CallFrameInfo> CreateCallFrameInfo() override;
145 
146 protected:
147  bool NeedsEndianSwap() const;
148 
149  typedef struct dos_header { // DOS .EXE header
150  uint16_t e_magic; // Magic number
151  uint16_t e_cblp; // Bytes on last page of file
152  uint16_t e_cp; // Pages in file
153  uint16_t e_crlc; // Relocations
154  uint16_t e_cparhdr; // Size of header in paragraphs
155  uint16_t e_minalloc; // Minimum extra paragraphs needed
156  uint16_t e_maxalloc; // Maximum extra paragraphs needed
157  uint16_t e_ss; // Initial (relative) SS value
158  uint16_t e_sp; // Initial SP value
159  uint16_t e_csum; // Checksum
160  uint16_t e_ip; // Initial IP value
161  uint16_t e_cs; // Initial (relative) CS value
162  uint16_t e_lfarlc; // File address of relocation table
163  uint16_t e_ovno; // Overlay number
164  uint16_t e_res[4]; // Reserved words
165  uint16_t e_oemid; // OEM identifier (for e_oeminfo)
166  uint16_t e_oeminfo; // OEM information; e_oemid specific
167  uint16_t e_res2[10]; // Reserved words
168  uint32_t e_lfanew; // File address of new exe header
169  } dos_header_t;
170 
171  typedef struct coff_header {
179  } coff_header_t;
180 
181  typedef struct data_directory {
185 
186  typedef struct coff_opt_header {
188  uint8_t major_linker_version = 0;
189  uint8_t minor_linker_version = 0;
196 
197  uint64_t image_base = 0;
212  uint64_t stack_reserve_size = 0;
213  uint64_t stack_commit_size = 0;
214  uint64_t heap_reserve_size = 0;
215  uint64_t heap_commit_size = 0;
217  // uint32_t num_data_dir_entries;
218  std::vector<data_directory>
219  data_dirs; // will contain num_data_dir_entries entries
221 
226  };
227 
228  typedef struct section_header {
229  char name[8];
230  uint32_t vmsize; // Virtual Size
231  uint32_t vmaddr; // Virtual Addr
232  uint32_t size; // File size
233  uint32_t offset; // File offset
234  uint32_t reloff; // Offset to relocations
235  uint32_t lineoff; // Offset to line table entries
236  uint16_t nreloc; // Number of relocation entries
237  uint16_t nline; // Number of line table entries
240 
241  typedef struct coff_symbol {
242  char name[8];
246  uint8_t storage;
247  uint8_t naux;
248  } coff_symbol_t;
249 
250  typedef struct export_directory_entry {
263 
267  lldb::offset_t *offset_ptr,
269  bool ParseCOFFOptionalHeader(lldb::offset_t *offset_ptr);
270  bool ParseSectionHeaders(uint32_t offset);
271 
273 
274  static void DumpDOSHeader(lldb_private::Stream *s,
275  const dos_header_t &header);
276  static void DumpCOFFHeader(lldb_private::Stream *s,
277  const coff_header_t &header);
279  const coff_opt_header_t &header);
283 
284  llvm::StringRef GetSectionName(const section_header_t &sect);
285  static lldb::SectionType GetSectionType(llvm::StringRef sect_name,
286  const section_header_t &sect);
287 
288  typedef std::vector<section_header_t> SectionHeaderColl;
289  typedef SectionHeaderColl::iterator SectionHeaderCollIter;
290  typedef SectionHeaderColl::const_iterator SectionHeaderCollConstIter;
291 
292 private:
293  bool CreateBinary();
294 
301  llvm::Optional<lldb_private::FileSpecList> m_deps_filespec;
302  std::unique_ptr<llvm::object::COFFObjectFile> m_binary;
304 };
305 
306 #endif // LLDB_SOURCE_PLUGINS_OBJECTFILE_PECOFF_OBJECTFILEPECOFF_H
ObjectFilePECOFF::section_header::offset
uint32_t offset
Definition: ObjectFilePECOFF.h:233
ObjectFilePECOFF::coff_symbol::sect
uint16_t sect
Definition: ObjectFilePECOFF.h:244
ObjectFilePECOFF::MagicBytesMatch
static bool MagicBytesMatch(lldb::DataBufferSP &data_sp)
Definition: ObjectFilePECOFF.cpp:193
ObjectFilePECOFF::coff_opt_header::checksum
uint32_t checksum
Definition: ObjectFilePECOFF.h:209
lldb_private::UUID
Definition: UUID.h:23
ObjectFilePECOFF::isA
bool isA(const void *ClassID) const override
Definition: ObjectFilePECOFF.h:91
ObjectFilePECOFF::coff_opt_header::stack_reserve_size
uint64_t stack_reserve_size
Definition: ObjectFilePECOFF.h:212
ObjectFilePECOFF::NeedsEndianSwap
bool NeedsEndianSwap() const
Definition: ObjectFilePECOFF.cpp:337
ObjectFilePECOFF::dos_header::e_magic
uint16_t e_magic
Definition: ObjectFilePECOFF.h:150
ObjectFilePECOFF::dos_header::e_ip
uint16_t e_ip
Definition: ObjectFilePECOFF.h:160
ObjectFilePECOFF::data_directory::vmaddr
uint32_t vmaddr
Definition: ObjectFilePECOFF.h:182
ObjectFilePECOFF::~ObjectFilePECOFF
~ObjectFilePECOFF() override
lldb_private::ArchSpec
Definition: ArchSpec.h:33
ObjectFilePECOFF::ReadImageData
lldb_private::DataExtractor ReadImageData(uint32_t offset, size_t size)
Definition: ObjectFilePECOFF.cpp:506
ObjectFilePECOFF::dos_header::e_oeminfo
uint16_t e_oeminfo
Definition: ObjectFilePECOFF.h:166
ObjectFilePECOFF::dos_header::e_oemid
uint16_t e_oemid
Definition: ObjectFilePECOFF.h:165
ObjectFilePECOFF::coff_opt_header::minor_os_system_version
uint16_t minor_os_system_version
Definition: ObjectFilePECOFF.h:201
ObjectFilePECOFF::GetDependentModules
uint32_t GetDependentModules(lldb_private::FileSpecList &files) override
Definition: ObjectFilePECOFF.cpp:936
ObjectFilePECOFF::coff_header::modtime
uint32_t modtime
Definition: ObjectFilePECOFF.h:174
ObjectFilePECOFF::m_dos_header
dos_header_t m_dos_header
Definition: ObjectFilePECOFF.h:295
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:423
ObjectFilePECOFF::CreateSections
void CreateSections(lldb_private::SectionList &unified_section_list) override
Definition: ObjectFilePECOFF.cpp:819
ObjectFilePECOFF::section_header::size
uint32_t size
Definition: ObjectFilePECOFF.h:232
ObjectFilePECOFF::coff_opt_header::subsystem
uint16_t subsystem
Definition: ObjectFilePECOFF.h:210
ObjectFilePECOFF::MachineWcemIpsv2
@ MachineWcemIpsv2
Definition: ObjectFilePECOFF.h:41
ObjectFilePECOFF::dos_header::e_maxalloc
uint16_t e_maxalloc
Definition: ObjectFilePECOFF.h:156
ObjectFilePECOFF::GetPluginDescriptionStatic
static llvm::StringRef GetPluginDescriptionStatic()
Definition: ObjectFilePECOFF.cpp:74
ObjectFilePECOFF::section_header::lineoff
uint32_t lineoff
Definition: ObjectFilePECOFF.h:235
ObjectFilePECOFF::export_directory_entry::minor_version
uint16_t minor_version
Definition: ObjectFilePECOFF.h:254
lldb_private::ModuleSpecList
Definition: ModuleSpec.h:280
ObjectFilePECOFF::GetUUID
lldb_private::UUID GetUUID() override
Gets the UUID for this object file.
Definition: ObjectFilePECOFF.cpp:877
ObjectFilePECOFF::section_header
Definition: ObjectFilePECOFF.h:228
ObjectFilePECOFF::dos_header::e_res
uint16_t e_res[4]
Definition: ObjectFilePECOFF.h:164
ObjectFilePECOFF::data_directory::vmsize
uint32_t vmsize
Definition: ObjectFilePECOFF.h:183
ObjectFilePECOFF::DumpSectionHeaders
void DumpSectionHeaders(lldb_private::Stream *s)
Definition: ObjectFilePECOFF.cpp:1125
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:252
ObjectFilePECOFF::MachineAmd64
@ MachineAmd64
Definition: ObjectFilePECOFF.h:22
ObjectFilePECOFF::coff_opt_header::major_linker_version
uint8_t major_linker_version
Definition: ObjectFilePECOFF.h:188
ObjectFilePECOFF::coff_symbol::name
char name[8]
Definition: ObjectFilePECOFF.h:242
ObjectFilePECOFF::GetAddressByteSize
uint32_t GetAddressByteSize() const override
Gets the address size in bytes for the current object file.
Definition: ObjectFilePECOFF.cpp:325
ObjectFilePECOFF::coff_data_dir_type
coff_data_dir_type
Definition: ObjectFilePECOFF.h:222
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:198
ObjectFilePECOFF::coff_opt_header::code_size
uint32_t code_size
Definition: ObjectFilePECOFF.h:190
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:261
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:214
ObjectFilePECOFF::dos_header
Definition: ObjectFilePECOFF.h:149
lldb_private::Target
Definition: Target.h:451
ObjectFilePECOFF::IsExecutable
bool IsExecutable() const override
Tells whether this object file is capable of being the main executable for a process.
Definition: ObjectFilePECOFF.cpp:321
ObjectFilePECOFF::dos_header::e_cparhdr
uint16_t e_cparhdr
Definition: ObjectFilePECOFF.h:154
ObjectFilePECOFF::export_directory_entry::address_of_functions
uint32_t address_of_functions
Definition: ObjectFilePECOFF.h:259
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:79
ObjectFilePECOFF::Dump
void Dump(lldb_private::Stream *s) override
Dump a description of this object to a Stream.
Definition: ObjectFilePECOFF.cpp:972
ObjectFilePECOFF::GetSymtab
lldb_private::Symtab * GetSymtab() override
Gets the symbol table for the currently selected architecture (and object for archives).
Definition: ObjectFilePECOFF.cpp:593
ObjectFilePECOFF::section_header::reloff
uint32_t reloff
Definition: ObjectFilePECOFF.h:234
ObjectFilePECOFF::coff_opt_header::image_size
uint32_t image_size
Definition: ObjectFilePECOFF.h:207
ObjectFilePECOFF::DumpDependentModules
void DumpDependentModules(lldb_private::Stream *s)
Definition: ObjectFilePECOFF.cpp:1145
ObjectFilePECOFF::coff_data_dir_exception_table
@ coff_data_dir_exception_table
Definition: ObjectFilePECOFF.h:225
ObjectFilePECOFF::coff_opt_header::minor_linker_version
uint8_t minor_linker_version
Definition: ObjectFilePECOFF.h:189
ObjectFilePECOFF::coff_opt_header::dll_flags
uint16_t dll_flags
Definition: ObjectFilePECOFF.h:211
ObjectFilePECOFF::coff_symbol::storage
uint8_t storage
Definition: ObjectFilePECOFF.h:246
ObjectFilePECOFF::coff_opt_header::bss_size
uint32_t bss_size
Definition: ObjectFilePECOFF.h:192
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:298
ObjectFilePECOFF::IsStripped
bool IsStripped() override
Detect if this object file has been stripped of local symbols.
Definition: ObjectFilePECOFF.cpp:743
ObjectFilePECOFF::coff_opt_header::data_dirs
std::vector< data_directory > data_dirs
Definition: ObjectFilePECOFF.h:219
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:167
ObjectFilePECOFF::coff_opt_header::minor_image_version
uint16_t minor_image_version
Definition: ObjectFilePECOFF.h:203
ObjectFilePECOFF::export_directory_entry::base
uint32_t base
Definition: ObjectFilePECOFF.h:256
ObjectFilePECOFF::coff_header
Definition: ObjectFilePECOFF.h:171
ObjectFilePECOFF::GetAddress
lldb_private::Address GetAddress(uint32_t rva)
Definition: ObjectFilePECOFF.cpp:494
ObjectFilePECOFF::coff_header::hdrsize
uint16_t hdrsize
Definition: ObjectFilePECOFF.h:177
ObjectFilePECOFF::ParseDOSHeader
static bool ParseDOSHeader(lldb_private::DataExtractor &data, dos_header_t &dos_header)
Definition: ObjectFilePECOFF.cpp:345
ObjectFilePECOFF::MachineThumb
@ MachineThumb
Definition: ObjectFilePECOFF.h:40
ObjectFilePECOFF::coff_opt_header
Definition: ObjectFilePECOFF.h:186
ObjectFilePECOFF::CalculateStrata
ObjectFile::Strata CalculateStrata() override
The object file should be able to calculate the strata of the object file.
Definition: ObjectFilePECOFF.cpp:1203
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:296
ObjectFilePECOFF::export_directory_entry::number_of_names
uint32_t number_of_names
Definition: ObjectFilePECOFF.h:258
ObjectFilePECOFF::MachineX86
@ MachineX86
Definition: ObjectFilePECOFF.h:27
ObjectFilePECOFF::export_directory_entry::number_of_functions
uint32_t number_of_functions
Definition: ObjectFilePECOFF.h:257
ObjectFilePECOFF::coff_header::symoff
uint32_t symoff
Definition: ObjectFilePECOFF.h:175
ObjectFilePECOFF::GetFileAddress
lldb::addr_t GetFileAddress(uint32_t rva) const
Definition: ObjectFilePECOFF.cpp:502
ObjectFilePECOFF::dos_header::e_minalloc
uint16_t e_minalloc
Definition: ObjectFilePECOFF.h:155
ObjectFilePECOFF::export_directory_entry
Definition: ObjectFilePECOFF.h:250
ObjectFilePECOFF::coff_data_dir_export_table
@ coff_data_dir_export_table
Definition: ObjectFilePECOFF.h:223
ObjectFilePECOFF::coff_opt_header::image_base
uint64_t image_base
Definition: ObjectFilePECOFF.h:197
ObjectFilePECOFF::SectionHeaderColl
std::vector< section_header_t > SectionHeaderColl
Definition: ObjectFilePECOFF.h:288
ObjectFilePECOFF::dos_header::e_crlc
uint16_t e_crlc
Definition: ObjectFilePECOFF.h:153
ObjectFilePECOFF::CreateBinary
bool CreateBinary()
Definition: ObjectFilePECOFF.cpp:211
ObjectFilePECOFF::coff_opt_header::major_subsystem_version
uint16_t major_subsystem_version
Definition: ObjectFilePECOFF.h:204
ObjectFilePECOFF::GetArchitecture
lldb_private::ArchSpec GetArchitecture() override
Get the ArchSpec for this object file.
Definition: ObjectFilePECOFF.cpp:1171
ObjectFilePECOFF::coff_opt_header::entry
uint32_t entry
Definition: ObjectFilePECOFF.h:193
ObjectFilePECOFF::dos_header::e_cp
uint16_t e_cp
Definition: ObjectFilePECOFF.h:152
ObjectFilePECOFF::dos_header::e_lfanew
uint32_t e_lfanew
Definition: ObjectFilePECOFF.h:168
ObjectFilePECOFF::GetPluginName
llvm::StringRef GetPluginName() override
Definition: ObjectFilePECOFF.h:133
ObjectFilePECOFF::GetPluginNameStatic
static llvm::StringRef GetPluginNameStatic()
Definition: ObjectFilePECOFF.h:60
ObjectFilePECOFF::ParseDependentModules
uint32_t ParseDependentModules()
Definition: ObjectFilePECOFF.cpp:888
ObjectFilePECOFF::dos_header::e_lfarlc
uint16_t e_lfarlc
Definition: ObjectFilePECOFF.h:162
ObjectFilePECOFF::m_entry_point_address
lldb_private::Address m_entry_point_address
Definition: ObjectFilePECOFF.h:300
ObjectFilePECOFF::coff_opt_header::code_offset
uint32_t code_offset
Definition: ObjectFilePECOFF.h:194
ObjectFilePECOFF::ReadImageDataByRVA
lldb_private::DataExtractor ReadImageDataByRVA(uint32_t rva, size_t size)
Definition: ObjectFilePECOFF.cpp:529
ObjectFilePECOFF::m_coff_header_opt
coff_opt_header_t m_coff_header_opt
Definition: ObjectFilePECOFF.h:297
ObjectFilePECOFF::coff_opt_header::heap_commit_size
uint64_t heap_commit_size
Definition: ObjectFilePECOFF.h:215
ObjectFilePECOFF::coff_symbol
Definition: ObjectFilePECOFF.h:241
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:114
ObjectFilePECOFF::m_uuid
lldb_private::UUID m_uuid
Definition: ObjectFilePECOFF.h:303
ObjectFilePECOFF::dos_header::e_csum
uint16_t e_csum
Definition: ObjectFilePECOFF.h:159
lldb::SymbolType
SymbolType
Symbol types.
Definition: lldb-enumerations.h:612
ObjectFilePECOFF::coff_header::flags
uint16_t flags
Definition: ObjectFilePECOFF.h:178
ObjectFilePECOFF::coff_opt_header::magic
uint16_t magic
Definition: ObjectFilePECOFF.h:187
ObjectFilePECOFF::section_header::nline
uint16_t nline
Definition: ObjectFilePECOFF.h:237
ObjectFilePECOFF::export_directory_entry::major_version
uint16_t major_version
Definition: ObjectFilePECOFF.h:253
ObjectFile.h
ObjectFilePECOFF::MachineUnknown
@ MachineUnknown
Definition: ObjectFilePECOFF.h:20
ObjectFilePECOFF::section_header::flags
uint32_t flags
Definition: ObjectFilePECOFF.h:238
ObjectFilePECOFF::coff_opt_header::loader_flags
uint32_t loader_flags
Definition: ObjectFilePECOFF.h:216
ObjectFilePECOFF::coff_opt_header::reserved1
uint32_t reserved1
Definition: ObjectFilePECOFF.h:206
ObjectFilePECOFF::data_directory_t
struct ObjectFilePECOFF::data_directory data_directory_t
ObjectFilePECOFF::dos_header::e_ss
uint16_t e_ss
Definition: ObjectFilePECOFF.h:157
ObjectFilePECOFF::ParseCOFFHeader
static bool ParseCOFFHeader(lldb_private::DataExtractor &data, lldb::offset_t *offset_ptr, coff_header_t &coff_header)
Definition: ObjectFilePECOFF.cpp:404
ObjectFilePECOFF::MachineSh4
@ MachineSh4
Definition: ObjectFilePECOFF.h:38
ObjectFilePECOFF::DumpCOFFHeader
static void DumpCOFFHeader(lldb_private::Stream *s, const coff_header_t &header)
Definition: ObjectFilePECOFF.cpp:1044
ObjectFilePECOFF::coff_symbol::naux
uint8_t naux
Definition: ObjectFilePECOFF.h:247
ObjectFilePECOFF::dos_header::e_sp
uint16_t e_sp
Definition: ObjectFilePECOFF.h:158
ObjectFilePECOFF::DumpOptCOFFHeader
static void DumpOptCOFFHeader(lldb_private::Stream *s, const coff_opt_header_t &header)
Definition: ObjectFilePECOFF.cpp:1057
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:260
ObjectFilePECOFF::coff_header::nsyms
uint32_t nsyms
Definition: ObjectFilePECOFF.h:176
lldb_private::Symtab
Definition: Symtab.h:22
ObjectFilePECOFF::export_directory_entry::characteristics
uint32_t characteristics
Definition: ObjectFilePECOFF.h:251
uint32_t
ObjectFilePECOFF::ID
static char ID
Definition: ObjectFilePECOFF.h:90
ObjectFilePECOFF::SaveCore
static bool SaveCore(const lldb::ProcessSP &process_sp, const lldb_private::FileSpec &outfile, lldb::SaveCoreStyle &core_style, lldb_private::Status &error)
Definition: ObjectFilePECOFF.cpp:185
lldb::SectionType
SectionType
Definition: lldb-enumerations.h:646
ObjectFilePECOFF::classof
static bool classof(const ObjectFile *obj)
Definition: ObjectFilePECOFF.h:94
lldb_private::Address
Definition: Address.h:59
ObjectFilePECOFF::ParseSectionHeaders
bool ParseSectionHeaders(uint32_t offset)
Definition: ObjectFilePECOFF.cpp:540
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:288
ObjectFilePECOFF::m_image_base
lldb::addr_t m_image_base
Definition: ObjectFilePECOFF.h:299
lldb::SaveCoreStyle
SaveCoreStyle
Definition: lldb-enumerations.h:1136
ObjectFilePECOFF::coff_data_dir_import_table
@ coff_data_dir_import_table
Definition: ObjectFilePECOFF.h:224
ObjectFilePECOFF::coff_opt_header::data_size
uint32_t data_size
Definition: ObjectFilePECOFF.h:191
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:127
ObjectFilePECOFF::MachineMips16
@ MachineMips16
Definition: ObjectFilePECOFF.h:30
ObjectFilePECOFF::SectionHeaderCollIter
SectionHeaderColl::iterator SectionHeaderCollIter
Definition: ObjectFilePECOFF.h:289
ObjectFilePECOFF::dos_header_t
struct ObjectFilePECOFF::dos_header dos_header_t
ObjectFilePECOFF::coff_opt_header::header_size
uint32_t header_size
Definition: ObjectFilePECOFF.h:208
ObjectFilePECOFF::DumpSectionHeader
void DumpSectionHeader(lldb_private::Stream *s, const section_header_t &sh)
Definition: ObjectFilePECOFF.cpp:1113
ObjectFilePECOFF::CreateCallFrameInfo
std::unique_ptr< lldb_private::CallFrameInfo > CreateCallFrameInfo() override
Creates a plugin-specific call frame info.
Definition: ObjectFilePECOFF.cpp:727
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:200
ObjectFilePECOFF::DumpDOSHeader
static void DumpDOSHeader(lldb_private::Stream *s, const dos_header_t &header)
Definition: ObjectFilePECOFF.cpp:1012
ObjectFilePECOFF::MachineSh3
@ MachineSh3
Definition: ObjectFilePECOFF.h:36
ObjectFilePECOFF::coff_opt_header::major_os_system_version
uint16_t major_os_system_version
Definition: ObjectFilePECOFF.h:200
ObjectFilePECOFF::section_header::vmsize
uint32_t vmsize
Definition: ObjectFilePECOFF.h:230
ObjectFilePECOFF::export_directory_entry::name
uint32_t name
Definition: ObjectFilePECOFF.h:255
ObjectFilePECOFF::MachineSh5
@ MachineSh5
Definition: ObjectFilePECOFF.h:39
ObjectFilePECOFF::coff_symbol::value
uint32_t value
Definition: ObjectFilePECOFF.h:243
ObjectFilePECOFF::SectionHeaderCollConstIter
SectionHeaderColl::const_iterator SectionHeaderCollConstIter
Definition: ObjectFilePECOFF.h:290
ObjectFilePECOFF::dos_header::e_cs
uint16_t e_cs
Definition: ObjectFilePECOFF.h:161
ObjectFilePECOFF::coff_opt_header::stack_commit_size
uint64_t stack_commit_size
Definition: ObjectFilePECOFF.h:213
ObjectFilePECOFF::GetBaseAddress
lldb_private::Address GetBaseAddress() override
Returns base address of this object file.
Definition: ObjectFilePECOFF.cpp:964
ObjectFilePECOFF::dos_header::e_ovno
uint16_t e_ovno
Definition: ObjectFilePECOFF.h:163
ObjectFilePECOFF::coff_header_t
struct ObjectFilePECOFF::coff_header coff_header_t
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:1193
ObjectFilePECOFF::coff_header::nsects
uint16_t nsects
Definition: ObjectFilePECOFF.h:173
ObjectFilePECOFF::coff_opt_header::file_alignment
uint32_t file_alignment
Definition: ObjectFilePECOFF.h:199
ObjectFilePECOFF::GetSectionName
llvm::StringRef GetSectionName(const section_header_t &sect)
Definition: ObjectFilePECOFF.cpp:576
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:946
ObjectFilePECOFF::m_binary
std::unique_ptr< llvm::object::COFFObjectFile > m_binary
Definition: ObjectFilePECOFF.h:302
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:205
ObjectFilePECOFF::coff_opt_header::major_image_version
uint16_t major_image_version
Definition: ObjectFilePECOFF.h:202
ObjectFilePECOFF::coff_header::machine
uint16_t machine
Definition: ObjectFilePECOFF.h:172
ObjectFilePECOFF::data_directory
Definition: ObjectFilePECOFF.h:181
ObjectFilePECOFF::dos_header::e_cblp
uint16_t e_cblp
Definition: ObjectFilePECOFF.h:151
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:195
ObjectFilePECOFF::m_deps_filespec
llvm::Optional< lldb_private::FileSpecList > m_deps_filespec
Definition: ObjectFilePECOFF.h:301
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:490
ObjectFilePECOFF::ParseHeader
bool ParseHeader() override
Attempts to parse the object header.
Definition: ObjectFilePECOFF.cpp:263
ObjectFilePECOFF::coff_symbol::type
uint16_t type
Definition: ObjectFilePECOFF.h:245
ObjectFilePECOFF::IsWindowsSubsystem
bool IsWindowsSubsystem()
Definition: ObjectFilePECOFF.cpp:1156
ObjectFilePECOFF::section_header::name
char name[8]
Definition: ObjectFilePECOFF.h:229
lldb::ByteOrder
ByteOrder
Byte ordering definitions.
Definition: lldb-enumerations.h:138
ObjectFilePECOFF::section_header::nreloc
uint16_t nreloc
Definition: ObjectFilePECOFF.h:236
ObjectFilePECOFF::section_header::vmaddr
uint32_t vmaddr
Definition: ObjectFilePECOFF.h:231
ObjectFilePECOFF::GetSectionType
static lldb::SectionType GetSectionType(llvm::StringRef sect_name, const section_header_t &sect)
Definition: ObjectFilePECOFF.cpp:748
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:319