LLDB mainline
ObjectFileMinidump.h
Go to the documentation of this file.
1//===-- ObjectFileMinidump.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/// \file
10/// Placeholder plugin for the save core functionality.
11///
12/// ObjectFileMinidump is created only to be able to save minidump core files
13/// from existing processes with the ObjectFileMinidump::SaveCore function.
14/// Minidump files are not ObjectFile objects, but they are core files and
15/// currently LLDB's ObjectFile plug-ins handle emitting core files. If the
16/// core file saving ever moves into a new plug-in type within LLDB, this code
17/// should move as well, but for now this is the best place architecturally.
18//===----------------------------------------------------------------------===//
19
20#ifndef LLDB_SOURCE_PLUGINS_OBJECTFILE_MINIDUMP_OBJECTFILEMINIDUMP_H
21#define LLDB_SOURCE_PLUGINS_OBJECTFILE_MINIDUMP_OBJECTFILEMINIDUMP_H
22
26
28public:
29 // Static Functions
30 static void Initialize();
31 static void Terminate();
32
33 static llvm::StringRef GetPluginNameStatic() { return "minidump"; }
34 static const char *GetPluginDescriptionStatic() {
35 return "Minidump object file.";
36 }
37
38 // PluginInterface protocol
39 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
40
42 CreateInstance(const lldb::ModuleSP &module_sp, lldb::DataBufferSP data_sp,
43 lldb::offset_t data_offset, const lldb_private::FileSpec *file,
44 lldb::offset_t offset, lldb::offset_t length);
45
47 const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP data_sp,
48 const lldb::ProcessSP &process_sp, lldb::addr_t header_addr);
49
50 static size_t GetModuleSpecifications(const lldb_private::FileSpec &file,
51 lldb::DataBufferSP &data_sp,
52 lldb::offset_t data_offset,
53 lldb::offset_t file_offset,
54 lldb::offset_t length,
56
57 // Saves dump in Minidump file format
58 static bool SaveCore(const lldb::ProcessSP &process_sp,
61
62private:
63 ObjectFileMinidump() = default;
64};
65
66#endif // LLDB_SOURCE_PLUGINS_OBJECTFILE_MINIDUMP_OBJECTFILEMINIDUMP_H
static llvm::raw_ostream & error(Stream &strm)
static const char * GetPluginDescriptionStatic()
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 offset, lldb::offset_t length)
llvm::StringRef GetPluginName() override
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)
static lldb_private::ObjectFile * CreateMemoryInstance(const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP data_sp, const lldb::ProcessSP &process_sp, lldb::addr_t header_addr)
ObjectFileMinidump()=default
static llvm::StringRef GetPluginNameStatic()
static bool SaveCore(const lldb::ProcessSP &process_sp, lldb_private::SaveCoreOptions &options, lldb_private::Status &error)
A file utility class.
Definition: FileSpec.h:56
A plug-in interface definition class for object file parsers.
Definition: ObjectFile.h:44
An error handling class.
Definition: Status.h:118
uint64_t offset_t
Definition: lldb-types.h:85
std::shared_ptr< lldb_private::Process > ProcessSP
Definition: lldb-forward.h:389
std::shared_ptr< lldb_private::DataBuffer > DataBufferSP
Definition: lldb-forward.h:336
std::shared_ptr< lldb_private::WritableDataBuffer > WritableDataBufferSP
Definition: lldb-forward.h:337
uint64_t addr_t
Definition: lldb-types.h:80
std::shared_ptr< lldb_private::Module > ModuleSP
Definition: lldb-forward.h:373