LLDB mainline
SBSaveCoreOptions.h
Go to the documentation of this file.
1//===-- SBSaveCoreOptions.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_API_SBSAVECOREOPTIONS_H
10#define LLDB_API_SBSAVECOREOPTIONS_H
11
12#include "lldb/API/SBDefines.h"
13#include "lldb/API/SBError.h"
14#include "lldb/API/SBFileSpec.h"
15#include "lldb/API/SBProcess.h"
16#include "lldb/API/SBThread.h"
17
18namespace lldb {
19
21public:
25
26 const SBSaveCoreOptions &operator=(const lldb::SBSaveCoreOptions &rhs);
27
28 /// Set the plugin name. Supplying null or empty string will reset
29 /// the option.
30 ///
31 /// \param plugin
32 /// Name of the object file plugin.
33 SBError SetPluginName(const char *plugin);
34
35 /// Get the Core dump plugin name, if set.
36 ///
37 /// \return
38 /// The name of the plugin, or null if not set.
39 const char *GetPluginName() const;
40
41 /// Set the Core dump style.
42 ///
43 /// \param style
44 /// The style of the core dump.
45 void SetStyle(lldb::SaveCoreStyle style);
46
47 /// Get the Core dump style, if set.
48 ///
49 /// \return
50 /// The core dump style, or undefined if not set.
51 lldb::SaveCoreStyle GetStyle() const;
52
53 /// Set the output file path
54 ///
55 /// \param
56 /// output_file a \class SBFileSpec object that describes the output file.
57 void SetOutputFile(SBFileSpec output_file);
58
59 /// Get the output file spec
60 ///
61 /// \return
62 /// The output file spec.
63 SBFileSpec GetOutputFile() const;
64
65 /// Set the process to save, or unset if supplied with a default constructed
66 /// process.
67 ///
68 /// \param process
69 /// The process to save.
70 ///
71 /// \return
72 /// Success if process was set, otherwise an error
73 ///
74 /// \note
75 /// This will clear all process specific options if a different process
76 /// is specified than the current set process, either explicitly from this
77 /// api, or implicitly from any function that requires a process.
78 SBError SetProcess(lldb::SBProcess process);
79
80 /// Add a thread to save in the core file.
81 ///
82 /// \param thread
83 /// The thread to save.
84 ///
85 /// \note
86 /// This will set the process if it is not already set, or return
87 /// and error if the SBThread is not from the set process.
88 SBError AddThread(lldb::SBThread thread);
89
90 /// Remove a thread from the list of threads to save.
91 ///
92 /// \param thread
93 /// The thread to remove.
94 ///
95 /// \return
96 /// True if the thread was removed, false if it was not in the list.
97 bool RemoveThread(lldb::SBThread thread);
98
99 /// Add a memory region to save in the core file.
100 ///
101 /// \param region
102 /// The memory region to save.
103 ///
104 /// \returns
105 /// An empty SBError upon success, or an error if the region is invalid.
106 ///
107 /// \note
108 /// Ranges that overlapped will be unioned into a single region, this also
109 /// supercedes stack minification. Specifying full regions and a non-custom
110 /// core style will include the specified regions and union them with all
111 /// style specific regions.
112 SBError AddMemoryRegionToSave(const SBMemoryRegionInfo &region);
113
114 /// Reset all options.
115 void Clear();
116
117protected:
118 friend class SBProcess;
120
121private:
122 std::unique_ptr<lldb_private::SaveCoreOptions> m_opaque_up;
123}; // SBSaveCoreOptions
124} // namespace lldb
125
126#endif // LLDB_API_SBSAVECOREOPTIONS_H
#define LLDB_API
Definition: SBDefines.h:28
Set the output file path.
std::unique_ptr< lldb_private::SaveCoreOptions > m_opaque_up
Definition: SBAddress.h:15