LLDB mainline
SaveCoreOptions.h
Go to the documentation of this file.
1//===-- SaveCoreOptions.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_SaveCoreOPTIONS_H
10#define LLDB_SOURCE_PLUGINS_OBJECTFILE_SaveCoreOPTIONS_H
11
16
17#include <optional>
18#include <string>
19#include <unordered_set>
20
22
23namespace lldb_private {
24
26public:
27 SaveCoreOptions() = default;
28 ~SaveCoreOptions() = default;
29
30 lldb_private::Status SetPluginName(const char *name);
31 std::optional<std::string> GetPluginName() const;
32
33 void SetStyle(lldb::SaveCoreStyle style);
35
37 const std::optional<lldb_private::FileSpec> GetOutputFile() const;
38
41
43 bool RemoveThread(lldb::ThreadSP thread_sp);
44 bool ShouldThreadBeSaved(lldb::tid_t tid) const;
45 bool HasSpecifiedThreads() const;
46
49
51
52 llvm::Expected<lldb_private::CoreFileMemoryRanges> GetMemoryRegionsToSave();
54
55 llvm::Expected<uint64_t> GetCurrentSizeInBytes();
56
57 void Clear();
58
59private:
61
62 std::optional<std::string> m_plugin_name;
63 std::optional<lldb_private::FileSpec> m_file;
64 std::optional<lldb::SaveCoreStyle> m_style;
66 std::unordered_set<lldb::tid_t> m_threads_to_save;
68};
69} // namespace lldb_private
70
71#endif // LLDB_SOURCE_PLUGINS_OBJECTFILE_SAVECOREOPTIONS_H
lldb_private::RangeVector< lldb::addr_t, lldb::addr_t > MemoryRanges
A file utility class.
Definition FileSpec.h:57
Status SetProcess(lldb::ProcessSP process_sp)
lldb_private::Status SetPluginName(const char *name)
bool RemoveThread(lldb::ThreadSP thread_sp)
const std::optional< lldb_private::FileSpec > GetOutputFile() const
lldb::SaveCoreStyle GetStyle() const
Status AddThread(lldb::ThreadSP thread_sp)
std::optional< std::string > m_plugin_name
void SetStyle(lldb::SaveCoreStyle style)
void AddMemoryRegionToSave(const lldb_private::MemoryRegionInfo &region)
llvm::Expected< lldb_private::CoreFileMemoryRanges > GetMemoryRegionsToSave()
llvm::Expected< uint64_t > GetCurrentSizeInBytes()
std::optional< std::string > GetPluginName() const
const MemoryRanges & GetCoreFileMemoryRanges() const
std::optional< lldb::SaveCoreStyle > m_style
void SetOutputFile(lldb_private::FileSpec file)
lldb_private::ThreadCollection::collection GetThreadsToSave() const
std::unordered_set< lldb::tid_t > m_threads_to_save
bool ShouldThreadBeSaved(lldb::tid_t tid) const
std::optional< lldb_private::FileSpec > m_file
An error handling class.
Definition Status.h:118
std::vector< lldb::ThreadSP > collection
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::Thread > ThreadSP
std::shared_ptr< lldb_private::Process > ProcessSP
uint64_t tid_t
Definition lldb-types.h:84