Path: blob/main/contrib/llvm-project/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.h
39644 views
//===-- ObjectFileMinidump.h ---------------------------------- -*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8/// \file9/// Placeholder plugin for the save core functionality.10///11/// ObjectFileMinidump is created only to be able to save minidump core files12/// from existing processes with the ObjectFileMinidump::SaveCore function.13/// Minidump files are not ObjectFile objects, but they are core files and14/// currently LLDB's ObjectFile plug-ins handle emitting core files. If the15/// core file saving ever moves into a new plug-in type within LLDB, this code16/// should move as well, but for now this is the best place architecturally.17//===----------------------------------------------------------------------===//1819#ifndef LLDB_SOURCE_PLUGINS_OBJECTFILE_MINIDUMP_OBJECTFILEMINIDUMP_H20#define LLDB_SOURCE_PLUGINS_OBJECTFILE_MINIDUMP_OBJECTFILEMINIDUMP_H2122#include "lldb/Symbol/ObjectFile.h"23#include "lldb/Utility/ArchSpec.h"2425class ObjectFileMinidump : public lldb_private::PluginInterface {26public:27// Static Functions28static void Initialize();29static void Terminate();3031static llvm::StringRef GetPluginNameStatic() { return "minidump"; }32static const char *GetPluginDescriptionStatic() {33return "Minidump object file.";34}3536// PluginInterface protocol37llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }3839static lldb_private::ObjectFile *40CreateInstance(const lldb::ModuleSP &module_sp, lldb::DataBufferSP data_sp,41lldb::offset_t data_offset, const lldb_private::FileSpec *file,42lldb::offset_t offset, lldb::offset_t length);4344static lldb_private::ObjectFile *CreateMemoryInstance(45const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP data_sp,46const lldb::ProcessSP &process_sp, lldb::addr_t header_addr);4748static size_t GetModuleSpecifications(const lldb_private::FileSpec &file,49lldb::DataBufferSP &data_sp,50lldb::offset_t data_offset,51lldb::offset_t file_offset,52lldb::offset_t length,53lldb_private::ModuleSpecList &specs);5455// Saves dump in Minidump file format56static bool SaveCore(const lldb::ProcessSP &process_sp,57const lldb_private::SaveCoreOptions &options,58lldb_private::Status &error);5960private:61ObjectFileMinidump() = default;62};6364#endif // LLDB_SOURCE_PLUGINS_OBJECTFILE_MINIDUMP_OBJECTFILEMINIDUMP_H656667