LLDB mainline
ObjectFilePlaceholder.h
Go to the documentation of this file.
1//===-- ObjectFilePlaceholder.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_PLACEHOLDER_OBJECTFILEPLACEHOLDER_H
10#define LLDB_SOURCE_PLUGINS_OBJECTFILE_PLACEHOLDER_OBJECTFILEPLACEHOLDER_H
11
13
14#include "lldb/Target/Target.h"
17#include "lldb/Utility/UUID.h"
18#include "lldb/lldb-private.h"
19
20/// A minimal ObjectFile implementation providing a dummy object file for the
21/// cases when the real module binary is not available. This allows the module
22/// to show up in "image list" and symbols to be added to it.
24public:
25 // Static Functions
26 static void Initialize() {}
27
28 static void Terminate() {}
29
30 static llvm::StringRef GetPluginNameStatic() { return "placeholder"; }
31
33 const lldb_private::ModuleSpec &module_spec,
34 lldb::addr_t base, lldb::addr_t size);
35
36 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
37 bool ParseHeader() override { return true; }
38 Type CalculateType() override { return eTypeUnknown; }
39 Strata CalculateStrata() override { return eStrataUnknown; }
40 uint32_t GetDependentModules(lldb_private::FileSpecList &file_list) override {
41 return 0;
42 }
43 bool IsExecutable() const override { return false; }
45 lldb_private::UUID GetUUID() override { return m_uuid; }
46 void ParseSymtab(lldb_private::Symtab &symtab) override {}
47 bool IsStripped() override { return true; }
48 lldb::ByteOrder GetByteOrder() const override {
49 return m_arch.GetByteOrder();
50 }
51
52 uint32_t GetAddressByteSize() const override {
54 }
55
57
58 void CreateSections(lldb_private::SectionList &unified_section_list) override;
59
61 bool value_is_offset) override;
62
63 void Dump(lldb_private::Stream *s) override;
64
66
67private:
72};
73
74#endif // LLDB_SOURCE_PLUGINS_OBJECTFILE_PLACEHOLDER_OBJECTFILEPLACEHOLDER_H
A minimal ObjectFile implementation providing a dummy object file for the cases when the real module ...
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...
Type CalculateType() override
The object file should be able to calculate its type by looking at its file header and possibly the s...
Strata CalculateStrata() override
The object file should be able to calculate the strata of the object file.
lldb_private::UUID GetUUID() override
Gets the UUID for this object file.
lldb_private::Address GetBaseAddress() override
Returns base address of this object file.
uint32_t GetAddressByteSize() const override
Gets the address size in bytes for the current object file.
lldb::addr_t GetBaseImageAddress() const
lldb_private::UUID m_uuid
lldb::ByteOrder GetByteOrder() const override
Gets whether endian swapping should occur when extracting data from this object file.
bool IsExecutable() const override
Tells whether this object file is capable of being the main executable for a process.
void CreateSections(lldb_private::SectionList &unified_section_list) override
lldb_private::ArchSpec GetArchitecture() override
Get the ArchSpec for this object file.
lldb_private::ArchSpec m_arch
bool IsStripped() override
Detect if this object file has been stripped of local symbols.
static llvm::StringRef GetPluginNameStatic()
llvm::StringRef GetPluginName() override
bool ParseHeader() override
Attempts to parse the object header.
void ParseSymtab(lldb_private::Symtab &symtab) override
Parse the symbol table into the provides symbol table object.
void Dump(lldb_private::Stream *s) override
Dump a description of this object to a Stream.
uint32_t GetDependentModules(lldb_private::FileSpecList &file_list) override
Extract the dependent modules from an object file.
A section + offset based address class.
Definition: Address.h:62
An architecture specification class.
Definition: ArchSpec.h:31
uint32_t GetAddressByteSize() const
Returns the size in bytes of an address of the current architecture.
Definition: ArchSpec.cpp:691
lldb::ByteOrder GetByteOrder() const
Returns the byte order for the architecture specification.
Definition: ArchSpec.cpp:738
A file collection class.
Definition: FileSpecList.h:85
A plug-in interface definition class for object file parsers.
Definition: ObjectFile.h:44
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
ByteOrder
Byte ordering definitions.
uint64_t addr_t
Definition: lldb-types.h:80
std::shared_ptr< lldb_private::Module > ModuleSP
Definition: lldb-forward.h:368