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