#include "Plugins/ObjectFile/JSON/ObjectFileJSON.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/Section.h"
#include "lldb/Symbol/Symbol.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "llvm/ADT/DenseSet.h"
#include <optional>
usingnamespacellvm;
usingnamespacelldb;
usingnamespacelldb_private;
LLDB_PLUGIN_DEFINE(…)
char ObjectFileJSON::ID;
void ObjectFileJSON::Initialize() { … }
void ObjectFileJSON::Terminate() { … }
ObjectFile *
ObjectFileJSON::CreateInstance(const ModuleSP &module_sp, DataBufferSP data_sp,
offset_t data_offset, const FileSpec *file,
offset_t file_offset, offset_t length) { … }
ObjectFile *ObjectFileJSON::CreateMemoryInstance(const ModuleSP &module_sp,
WritableDataBufferSP data_sp,
const ProcessSP &process_sp,
addr_t header_addr) { … }
size_t ObjectFileJSON::GetModuleSpecifications(
const FileSpec &file, DataBufferSP &data_sp, offset_t data_offset,
offset_t file_offset, offset_t length, ModuleSpecList &specs) { … }
ObjectFileJSON::ObjectFileJSON(const ModuleSP &module_sp, DataBufferSP &data_sp,
offset_t data_offset, const FileSpec *file,
offset_t offset, offset_t length, ArchSpec arch,
UUID uuid, Type type,
std::vector<JSONSymbol> symbols,
std::vector<JSONSection> sections)
: … { … }
bool ObjectFileJSON::ParseHeader() { … }
void ObjectFileJSON::ParseSymtab(Symtab &symtab) { … }
void ObjectFileJSON::CreateSections(SectionList &unified_section_list) { … }
bool ObjectFileJSON::MagicBytesMatch(DataBufferSP data_sp,
lldb::addr_t data_offset,
lldb::addr_t data_length) { … }
namespace lldb_private {
bool fromJSON(const json::Value &value, ObjectFileJSON::Header &header,
json::Path path) { … }
bool fromJSON(const json::Value &value, ObjectFileJSON::Body &body,
json::Path path) { … }
}