LLDB  mainline
ObjectFileMachO.h
Go to the documentation of this file.
1 //===-- ObjectFileMachO.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_MACH_O_OBJECTFILEMACHO_H
10 #define LLDB_SOURCE_PLUGINS_OBJECTFILE_MACH_O_OBJECTFILEMACHO_H
11 
12 #include "lldb/Core/Address.h"
13 #include "lldb/Core/FileSpecList.h"
14 #include "lldb/Host/SafeMachO.h"
15 #include "lldb/Symbol/ObjectFile.h"
16 #include "lldb/Utility/FileSpec.h"
17 #include "lldb/Utility/RangeMap.h"
19 #include "lldb/Utility/UUID.h"
20 
21 // This class needs to be hidden as eventually belongs in a plugin that
22 // will export the ObjectFile protocol
24 public:
25  ObjectFileMachO(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp,
26  lldb::offset_t data_offset,
27  const lldb_private::FileSpec *file, lldb::offset_t offset,
28  lldb::offset_t length);
29 
30  ObjectFileMachO(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp,
31  const lldb::ProcessSP &process_sp, lldb::addr_t header_addr);
32 
33  ~ObjectFileMachO() override = default;
34 
35  // Static Functions
36  static void Initialize();
37 
38  static void Terminate();
39 
41 
42  static const char *GetPluginDescriptionStatic();
43 
45  CreateInstance(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp,
46  lldb::offset_t data_offset, const lldb_private::FileSpec *file,
47  lldb::offset_t file_offset, lldb::offset_t length);
48 
50  const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp,
51  const lldb::ProcessSP &process_sp, lldb::addr_t header_addr);
52 
53  static size_t GetModuleSpecifications(const lldb_private::FileSpec &file,
54  lldb::DataBufferSP &data_sp,
55  lldb::offset_t data_offset,
56  lldb::offset_t file_offset,
57  lldb::offset_t length,
59 
60  static bool SaveCore(const lldb::ProcessSP &process_sp,
61  const lldb_private::FileSpec &outfile,
62  lldb::SaveCoreStyle &core_style,
64 
65  static bool MagicBytesMatch(lldb::DataBufferSP &data_sp, lldb::addr_t offset,
66  lldb::addr_t length);
67 
68  // LLVM RTTI support
69  static char ID;
70  bool isA(const void *ClassID) const override {
71  return ClassID == &ID || ObjectFile::isA(ClassID);
72  }
73  static bool classof(const ObjectFile *obj) { return obj->isA(&ID); }
74 
75  // Member Functions
76  bool ParseHeader() override;
77 
79  bool value_is_offset) override;
80 
81  lldb::ByteOrder GetByteOrder() const override;
82 
83  bool IsExecutable() const override;
84 
85  bool IsDynamicLoader() const;
86 
87  bool IsSharedCacheBinary() const;
88 
89  uint32_t GetAddressByteSize() const override;
90 
92 
93  lldb_private::Symtab *GetSymtab() override;
94 
95  bool IsStripped() override;
96 
97  void CreateSections(lldb_private::SectionList &unified_section_list) override;
98 
99  void Dump(lldb_private::Stream *s) override;
100 
102 
103  lldb_private::UUID GetUUID() override;
104 
105  uint32_t GetDependentModules(lldb_private::FileSpecList &files) override;
106 
107  lldb_private::FileSpecList GetReExportedLibraries() override {
108  return m_reexported_dylibs;
109  }
110 
112 
114 
115  uint32_t GetNumThreadContexts() override;
116 
117  std::string GetIdentifierString() override;
118 
119  lldb::addr_t GetAddressMask() override;
120 
122  lldb_private::UUID &uuid,
123  ObjectFile::BinaryType &type) override;
124 
125  bool LoadCoreFileImages(lldb_private::Process &process) override;
126 
127  lldb::RegisterContextSP
129 
130  ObjectFile::Type CalculateType() override;
131 
132  ObjectFile::Strata CalculateStrata() override;
133 
134  llvm::VersionTuple GetVersion() override;
135 
136  llvm::VersionTuple GetMinimumOSVersion() override;
137 
138  llvm::VersionTuple GetSDKVersion() override;
139 
140  bool GetIsDynamicLinkEditor() override;
141 
142  static bool ParseHeader(lldb_private::DataExtractor &data,
143  lldb::offset_t *data_offset_ptr,
144  llvm::MachO::mach_header &header);
145 
146  bool AllowAssemblyEmulationUnwindPlans() override;
147 
148  // PluginInterface protocol
149  llvm::StringRef GetPluginName() override {
151  }
152 
153 protected:
154  static lldb_private::UUID
155  GetUUID(const llvm::MachO::mach_header &header,
156  const lldb_private::DataExtractor &data,
157  lldb::offset_t lc_offset); // Offset to the first load command
158 
160  lldb::ModuleSP module_sp, const llvm::MachO::mach_header &header,
161  const lldb_private::DataExtractor &data, lldb::offset_t lc_offset);
162 
163  /// Enumerate all ArchSpecs supported by this Mach-O file.
164  ///
165  /// On macOS one Mach-O slice can contain multiple load commands:
166  /// One load command for being loaded into a macOS process and one
167  /// load command for being loaded into a macCatalyst process. In
168  /// contrast to ObjectContainerUniversalMachO, this is the same
169  /// binary that can be loaded into different contexts.
170  static void GetAllArchSpecs(const llvm::MachO::mach_header &header,
171  const lldb_private::DataExtractor &data,
172  lldb::offset_t lc_offset,
173  lldb_private::ModuleSpec &base_spec,
174  lldb_private::ModuleSpecList &all_specs);
175 
176  /// Intended for same-host arm device debugging where lldb needs to
177  /// detect libraries in the shared cache and augment the nlist entries
178  /// with an on-disk dyld_shared_cache file. The process will record
179  /// the shared cache UUID so the on-disk cache can be matched or rejected
180  /// correctly.
182  lldb::addr_t &base_addr,
183  lldb_private::UUID &uuid);
184 
185  /// Intended for same-host arm device debugging where lldb will read
186  /// shared cache libraries out of its own memory instead of the remote
187  /// process' memory as an optimization. If lldb's shared cache UUID
188  /// does not match the process' shared cache UUID, this optimization
189  /// should not be used.
190  void GetLLDBSharedCacheUUID(lldb::addr_t &base_addir, lldb_private::UUID &uuid);
191 
193 
195  lldb::addr_t mach_header_load_address,
196  const lldb_private::Section *mach_header_section,
197  const lldb_private::Section *section);
198 
200  GetSharedCacheUUID(lldb_private::FileSpec dyld_shared_cache,
201  const lldb::ByteOrder byte_order,
202  const uint32_t addr_byte_size);
203 
204  size_t ParseSymtab();
205 
208 
209  struct SegmentParsingContext;
210  void ProcessDysymtabCommand(const llvm::MachO::load_command &load_cmd,
211  lldb::offset_t offset);
212  void ProcessSegmentCommand(const llvm::MachO::load_command &load_cmd,
213  lldb::offset_t offset, uint32_t cmd_idx,
214  SegmentParsingContext &context);
215  void SanitizeSegmentCommand(llvm::MachO::segment_command_64 &seg_cmd,
216  uint32_t cmd_idx);
217 
218  bool SectionIsLoadable(const lldb_private::Section *section);
219 
220  /// A corefile may include metadata about all of the binaries that were
221  /// present in the process when the corefile was taken. This is only
222  /// implemented for Mach-O files for now; we'll generalize it when we
223  /// have other systems that can include the same.
229  std::vector<std::tuple<lldb_private::ConstString, lldb::addr_t>>
231  };
232 
233  struct LCNoteEntry {
234  LCNoteEntry(uint32_t addr_byte_size, lldb::ByteOrder byte_order)
235  : payload(lldb_private::Stream::eBinary, addr_byte_size, byte_order) {}
236 
240  };
241 
243  std::vector<MachOCorefileImageEntry> all_image_infos;
244  bool IsValid() { return all_image_infos.size() > 0; }
245  };
246 
247  /// Get the list of binary images that were present in the process
248  /// when the corefile was produced.
249  /// \return
250  /// The MachOCorefileAllImageInfos object returned will have
251  /// IsValid() == false if the information is unavailable.
252  MachOCorefileAllImageInfos GetCorefileAllImageInfos();
253 
254  llvm::MachO::mach_header m_header;
263 
264  llvm::MachO::dysymtab_command m_dysymtab;
265  std::vector<llvm::MachO::segment_command_64> m_mach_segments;
266  std::vector<llvm::MachO::section_64> m_mach_sections;
267  llvm::Optional<llvm::VersionTuple> m_min_os_version;
268  llvm::Optional<llvm::VersionTuple> m_sdk_versions;
275  lldb_private::FileSpecList m_reexported_dylibs;
277 };
278 
279 #endif // LLDB_SOURCE_PLUGINS_OBJECTFILE_MACH_O_OBJECTFILEMACHO_H
ObjectFileMachO::ParseSymtab
size_t ParseSymtab()
Definition: ObjectFileMachO.cpp:2244
ObjectFileMachO::GetNumThreadContexts
uint32_t GetNumThreadContexts() override
Definition: ObjectFileMachO.cpp:5534
lldb_private::UUID
Definition: UUID.h:23
ObjectFileMachO::MachOCorefileAllImageInfos::IsValid
bool IsValid()
Definition: ObjectFileMachO.h:244
ObjectFileMachO::GetMinimumOSVersion
llvm::VersionTuple GetMinimumOSVersion() override
Get the minimum OS version this object file can run on.
Definition: ObjectFileMachO.cpp:6051
lldb_private::ArchSpec
Definition: ArchSpec.h:33
ObjectFileMachO::MachOCorefileImageEntry::currently_executing
bool currently_executing
Definition: ObjectFileMachO.h:228
ObjectFileMachO::GetSymtab
lldb_private::Symtab * GetSymtab() override
Gets the symbol table for the currently selected architecture (and object for archives).
Definition: ObjectFileMachO.cpp:1323
ObjectFileMachO::CreateInstance
static lldb_private::ObjectFile * CreateInstance(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)
Definition: ObjectFileMachO.cpp:845
lldb_private::AddressClass
AddressClass
Definition: lldb-private-enumerations.h:48
ObjectFileMachO::GetAddressByteSize
uint32_t GetAddressByteSize() const override
Gets the address size in bytes for the current object file.
Definition: ObjectFileMachO.cpp:1153
UUID.h
ObjectFileMachO::GetSegmentNameDATA_CONST
static lldb_private::ConstString GetSegmentNameDATA_CONST()
Definition: ObjectFileMachO.cpp:933
ObjectFileMachO::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: ObjectFileMachO.cpp:6250
ObjectFileMachO::GetDependentModules
uint32_t GetDependentModules(lldb_private::FileSpecList &files) override
Definition: ObjectFileMachO.cpp:5244
ObjectFileMachO::GetSegmentNameDATA_DIRTY
static lldb_private::ConstString GetSegmentNameDATA_DIRTY()
Definition: ObjectFileMachO.cpp:928
lldb_private::ModuleSpecList
Definition: ModuleSpec.h:280
lldb_private::Process
Definition: Process.h:340
ObjectFileMachO::SegmentParsingContext
Definition: ObjectFileMachO.cpp:1612
ObjectFileMachO::classof
static bool classof(const ObjectFile *obj)
Definition: ObjectFileMachO.h:73
ObjectFileMachO::MachOCorefileImageEntry::segment_load_addresses
std::vector< std::tuple< lldb_private::ConstString, lldb::addr_t > > segment_load_addresses
Definition: ObjectFileMachO.h:230
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
ObjectFileMachO::m_min_os_version
llvm::Optional< llvm::VersionTuple > m_min_os_version
Definition: ObjectFileMachO.h:267
ObjectFileMachO::m_sdk_versions
llvm::Optional< llvm::VersionTuple > m_sdk_versions
Definition: ObjectFileMachO.h:268
lldb_private::SectionList
Definition: Section.h:34
lldb::offset_t
uint64_t offset_t
Definition: lldb-types.h:87
lldb_private::Stream
Definition: Stream.h:28
ObjectFileMachO::LCNoteEntry::payload_file_offset
lldb::addr_t payload_file_offset
Definition: ObjectFileMachO.h:238
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
RangeMap.h
ObjectFileMachO::ID
static char ID
Definition: ObjectFileMachO.h:69
lldb_private::Target
Definition: Target.h:450
ObjectFileMachO::GetSharedCacheUUID
lldb_private::UUID GetSharedCacheUUID(lldb_private::FileSpec dyld_shared_cache, const lldb::ByteOrder byte_order, const uint32_t addr_byte_size)
Definition: ObjectFileMachO.cpp:2200
ObjectFileMachO::SanitizeSegmentCommand
void SanitizeSegmentCommand(llvm::MachO::segment_command_64 &seg_cmd, uint32_t cmd_idx)
Definition: ObjectFileMachO.cpp:1398
ObjectFileMachO::~ObjectFileMachO
~ObjectFileMachO() override=default
ObjectFileMachO::GetIsDynamicLinkEditor
bool GetIsDynamicLinkEditor() override
Return true if this file is a dynamic link editor (dyld)
Definition: ObjectFileMachO.cpp:6186
ObjectFileMachO::GetAddressMask
lldb::addr_t GetAddressMask() override
Some object files may have the number of bits used for addressing embedded in them,...
Definition: ObjectFileMachO.cpp:5630
ObjectFileMachO::m_allow_assembly_emulation_unwind_plans
bool m_allow_assembly_emulation_unwind_plans
Definition: ObjectFileMachO.h:276
ObjectFileMachO::EncryptedFileRanges
lldb_private::RangeVector< uint32_t, uint32_t, 8 > EncryptedFileRanges
Definition: ObjectFileMachO.h:206
SafeMachO.h
ObjectFileMachO::m_reexported_dylibs
lldb_private::FileSpecList m_reexported_dylibs
Definition: ObjectFileMachO.h:275
ObjectFileMachO::MagicBytesMatch
static bool MagicBytesMatch(lldb::DataBufferSP &data_sp, lldb::addr_t offset, lldb::addr_t length)
Definition: ObjectFileMachO.cpp:958
lldb_private::FileSpec
Definition: FileSpec.h:56
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
ObjectFileMachO::GetIdentifierString
std::string GetIdentifierString() override
Some object files may have an identifier string embedded in them, e.g.
Definition: ObjectFileMachO.cpp:5560
ObjectFileMachO::GetCorefileMainBinaryInfo
bool GetCorefileMainBinaryInfo(lldb::addr_t &address, lldb_private::UUID &uuid, ObjectFile::BinaryType &type) override
Definition: ObjectFileMachO.cpp:5670
ObjectFileMachO::SectionIsLoadable
bool SectionIsLoadable(const lldb_private::Section *section)
Definition: ObjectFileMachO.cpp:6214
ObjectFileMachO::Initialize
static void Initialize()
Definition: ObjectFileMachO.cpp:826
ObjectFileMachO::GetUUID
lldb_private::UUID GetUUID() override
Gets the UUID for this object file.
Definition: ObjectFileMachO.cpp:5234
lldb_private::DataExtractor
Definition: DataExtractor.h:48
lldb_private::ConstString::GetStringRef
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
Definition: ConstString.h:202
ObjectFileMachO::GetBaseAddress
lldb_private::Address GetBaseAddress() override
Returns base address of this object file.
Definition: ObjectFileMachO.cpp:5520
ObjectFileMachO::GetLLDBSharedCacheUUID
void GetLLDBSharedCacheUUID(lldb::addr_t &base_addir, lldb_private::UUID &uuid)
Intended for same-host arm device debugging where lldb will read shared cache libraries out of its ow...
Definition: ObjectFileMachO.cpp:5969
lldb_private::Thread
Definition: Thread.h:60
ObjectFileMachO::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: ObjectFileMachO.cpp:5348
ObjectFileMachO::CreateSections
void CreateSections(lldb_private::SectionList &unified_section_list) override
Definition: ObjectFileMachO.cpp:1917
ObjectFileMachO::LCNoteEntry::LCNoteEntry
LCNoteEntry(uint32_t addr_byte_size, lldb::ByteOrder byte_order)
Definition: ObjectFileMachO.h:234
StreamString.h
ObjectFileMachO::GetSegmentNameDWARF
static lldb_private::ConstString GetSegmentNameDWARF()
Definition: ObjectFileMachO.cpp:948
ObjectFileMachO::MachOCorefileImageEntry::filename
std::string filename
Definition: ObjectFileMachO.h:225
FileSpecList.h
lldb_private::ConstString
Definition: ConstString.h:40
ObjectFileMachO::MachOCorefileImageEntry::load_address
lldb::addr_t load_address
Definition: ObjectFileMachO.h:227
lldb_private::StreamString
Definition: StreamString.h:23
ObjectFileMachO::SaveCore
static bool SaveCore(const lldb::ProcessSP &process_sp, const lldb_private::FileSpec &outfile, lldb::SaveCoreStyle &core_style, lldb_private::Status &error)
Definition: ObjectFileMachO.cpp:6540
ObjectFileMachO::m_mach_sections
std::vector< llvm::MachO::section_64 > m_mach_sections
Definition: ObjectFileMachO.h:266
ObjectFileMachO::ProcessSegmentCommand
void ProcessSegmentCommand(const llvm::MachO::load_command &load_cmd, lldb::offset_t offset, uint32_t cmd_idx, SegmentParsingContext &context)
Definition: ObjectFileMachO.cpp:1624
ObjectFileMachO::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: ObjectFileMachO.cpp:876
ObjectFileMachO::m_mach_segments
std::vector< llvm::MachO::segment_command_64 > m_mach_segments
Definition: ObjectFileMachO.h:265
ObjectFileMachO::GetProcessSharedCacheUUID
void GetProcessSharedCacheUUID(lldb_private::Process *, lldb::addr_t &base_addr, lldb_private::UUID &uuid)
Intended for same-host arm device debugging where lldb needs to detect libraries in the shared cache ...
Definition: ObjectFileMachO.cpp:5935
ObjectFileMachO::GetEncryptedFileRanges
EncryptedFileRanges GetEncryptedFileRanges()
Definition: ObjectFileMachO.cpp:1369
ObjectFileMachO::GetAllArchSpecs
static void GetAllArchSpecs(const llvm::MachO::mach_header &header, const lldb_private::DataExtractor &data, lldb::offset_t lc_offset, lldb_private::ModuleSpec &base_spec, lldb_private::ModuleSpecList &all_specs)
Enumerate all ArchSpecs supported by this Mach-O file.
Definition: ObjectFileMachO.cpp:5062
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
ObjectFileMachO::m_thread_context_offsets_valid
bool m_thread_context_offsets_valid
Definition: ObjectFileMachO.h:274
ObjectFileMachO::GetSegmentNameTEXT
static lldb_private::ConstString GetSegmentNameTEXT()
Definition: ObjectFileMachO.cpp:918
ObjectFileMachO::GetVersion
llvm::VersionTuple GetVersion() override
Get the object file version numbers.
Definition: ObjectFileMachO.cpp:5886
ObjectFileMachO::m_text_address
lldb::addr_t m_text_address
Definition: ObjectFileMachO.h:273
lldb_private::RangeVector
Definition: RangeMap.h:125
Address.h
ObjectFileMachO::isA
bool isA(const void *ClassID) const override
Definition: ObjectFileMachO.h:70
ObjectFileMachO::GetPluginDescriptionStatic
static const char * GetPluginDescriptionStatic()
Definition: ObjectFileMachO.cpp:841
ObjectFile.h
lldb_private::Section
Definition: Section.h:96
ObjectFileMachO::IsSharedCacheBinary
bool IsSharedCacheBinary() const
Definition: ObjectFileMachO.cpp:1149
ObjectFileMachO::GetSegmentNameLINKEDIT
static lldb_private::ConstString GetSegmentNameLINKEDIT()
Definition: ObjectFileMachO.cpp:943
ObjectFileMachO::LoadCoreFileImages
bool LoadCoreFileImages(lldb_private::Process &process) override
Load binaries listed in a corefile.
Definition: ObjectFileMachO.cpp:7031
lldb_private::ModuleSpec
Definition: ModuleSpec.h:26
ObjectFileMachO::GetPluginNameStatic
static lldb_private::ConstString GetPluginNameStatic()
Definition: ObjectFileMachO.cpp:836
ObjectFileMachO::GetByteOrder
lldb::ByteOrder GetByteOrder() const override
Gets whether endian swapping should occur when extracting data from this object file.
Definition: ObjectFileMachO.cpp:1137
ObjectFileMachO::IsExecutable
bool IsExecutable() const override
Tells whether this object file is capable of being the main executable for a process.
Definition: ObjectFileMachO.cpp:1141
ObjectFileMachO::GetAddressClass
lldb_private::AddressClass GetAddressClass(lldb::addr_t file_addr) override
Get the address type given a file address in an object file.
Definition: ObjectFileMachO.cpp:1157
lldb_private::Status
Definition: Status.h:44
ObjectFileMachO::GetSegmentNameDATA
static lldb_private::ConstString GetSegmentNameDATA()
Definition: ObjectFileMachO.cpp:923
ObjectFileMachO::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: ObjectFileMachO.cpp:888
lldb_private::Symtab
Definition: Symtab.h:22
uint32_t
ObjectFileMachO::FileRangeArray
lldb_private::RangeVector< uint32_t, uint32_t > FileRangeArray
Definition: ObjectFileMachO.h:269
lldb_private::Address
Definition: Address.h:59
ObjectFileMachO::GetArchitecture
lldb_private::ArchSpec GetArchitecture() override
Get the ArchSpec for this object file.
Definition: ObjectFileMachO.cpp:5923
ObjectFileMachO::ProcessDysymtabCommand
void ProcessDysymtabCommand(const llvm::MachO::load_command &load_cmd, lldb::offset_t offset)
Definition: ObjectFileMachO.cpp:1909
ObjectFileMachO::LCNoteEntry
Definition: ObjectFileMachO.h:233
lldb::SaveCoreStyle
SaveCoreStyle
Definition: lldb-enumerations.h:1136
ObjectFileMachO::m_header
llvm::MachO::mach_header m_header
Definition: ObjectFileMachO.h:254
ObjectFileMachO::m_linkedit_original_offset
lldb::offset_t m_linkedit_original_offset
Definition: ObjectFileMachO.h:272
ObjectFileMachO::CalculateSectionLoadAddressForMemoryImage
lldb::addr_t CalculateSectionLoadAddressForMemoryImage(lldb::addr_t mach_header_load_address, const lldb_private::Section *mach_header_section, const lldb_private::Section *section)
Definition: ObjectFileMachO.cpp:6237
LLDB_INVALID_ADDRESS
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:86
ObjectFileMachO::IsStripped
bool IsStripped() override
Detect if this object file has been stripped of local symbols.
Definition: ObjectFileMachO.cpp:1338
ObjectFileMachO::GetSDKVersion
llvm::VersionTuple GetSDKVersion() override
Get the SDK OS version this object file was built with.
Definition: ObjectFileMachO.cpp:6112
ObjectFileMachO::Dump
void Dump(lldb_private::Stream *s) override
Dump a description of this object to a Stream.
Definition: ObjectFileMachO.cpp:4913
ObjectFileMachO::GetSectionNameEHFrame
static lldb_private::ConstString GetSectionNameEHFrame()
Definition: ObjectFileMachO.cpp:953
ObjectFileMachO::MachOCorefileImageEntry::uuid
lldb_private::UUID uuid
Definition: ObjectFileMachO.h:226
ObjectFileMachO::ParseHeader
bool ParseHeader() override
Attempts to parse the object header.
Definition: ObjectFileMachO.cpp:1048
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
ObjectFileMachO
Definition: ObjectFileMachO.h:23
ObjectFileMachO::GetThreadContextAtIndex
lldb::RegisterContextSP GetThreadContextAtIndex(uint32_t idx, lldb_private::Thread &thread) override
Definition: ObjectFileMachO.cpp:5743
ObjectFileMachO::MachOCorefileAllImageInfos::all_image_infos
std::vector< MachOCorefileImageEntry > all_image_infos
Definition: ObjectFileMachO.h:243
ObjectFileMachO::MachOCorefileAllImageInfos
Definition: ObjectFileMachO.h:242
ObjectFileMachO::CalculateStrata
ObjectFile::Strata CalculateStrata() override
The object file should be able to calculate the strata of the object file.
Definition: ObjectFileMachO.cpp:5830
ObjectFileMachO::IsDynamicLoader
bool IsDynamicLoader() const
Definition: ObjectFileMachO.cpp:1145
FileSpec.h
ObjectFileMachO::GetMachHeaderSection
lldb_private::Section * GetMachHeaderSection()
Definition: ObjectFileMachO.cpp:6194
ObjectFileMachO::MachOCorefileImageEntry
A corefile may include metadata about all of the binaries that were present in the process when the c...
Definition: ObjectFileMachO.h:224
ObjectFileMachO::Terminate
static void Terminate()
Definition: ObjectFileMachO.cpp:832
ObjectFileMachO::GetReExportedLibraries
lldb_private::FileSpecList GetReExportedLibraries() override
Gets the file spec list of libraries re-exported by this object file.
Definition: ObjectFileMachO.h:107
ObjectFileMachO::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: ObjectFileMachO.cpp:5787
ObjectFileMachO::GetSegmentNameOBJC
static lldb_private::ConstString GetSegmentNameOBJC()
Definition: ObjectFileMachO.cpp:938
ObjectFileMachO::LCNoteEntry::name
std::string name
Definition: ObjectFileMachO.h:237
ObjectFileMachO::LCNoteEntry::payload
lldb_private::StreamString payload
Definition: ObjectFileMachO.h:239
lldb_private::ObjectFile
Definition: ObjectFile.h:58
ObjectFileMachO::ObjectFileMachO
ObjectFileMachO(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)
ObjectFileMachO::m_thread_context_offsets
FileRangeArray m_thread_context_offsets
Definition: ObjectFileMachO.h:271
ObjectFileMachO::m_entry_point_address
lldb_private::Address m_entry_point_address
Definition: ObjectFileMachO.h:270
ObjectFileMachO::GetCorefileAllImageInfos
MachOCorefileAllImageInfos GetCorefileAllImageInfos()
Get the list of binary images that were present in the process when the corefile was produced.
Definition: ObjectFileMachO.cpp:6960
lldb::ByteOrder
ByteOrder
Byte ordering definitions.
Definition: lldb-enumerations.h:138
ObjectFileMachO::GetPluginName
llvm::StringRef GetPluginName() override
Definition: ObjectFileMachO.h:149
ObjectFileMachO::AllowAssemblyEmulationUnwindPlans
bool AllowAssemblyEmulationUnwindPlans() override
Returns if the function bounds for symbols in this symbol file are likely accurate.
Definition: ObjectFileMachO.cpp:6190
ObjectFileMachO::m_dysymtab
llvm::MachO::dysymtab_command m_dysymtab
Definition: ObjectFileMachO.h:264