Skip to content

Commit 6edb284

Browse files
committed
Rename every to SaveCoreOptions, fix null string setting the optional to nullopt
1 parent 1785ad3 commit 6edb284

30 files changed

+84
-81
lines changed

lldb/bindings/headers.swig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "lldb/API/SBCommandReturnObject.h"
2222
#include "lldb/API/SBCommunication.h"
2323
#include "lldb/API/SBCompileUnit.h"
24-
#include "lldb/API/SBCoreDumpOptions.h"
24+
#include "lldb/API/SBSaveCoreOptions.h"
2525
#include "lldb/API/SBData.h"
2626
#include "lldb/API/SBDebugger.h"
2727
#include "lldb/API/SBDeclaration.h"

lldb/bindings/interfaces.swig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
%include "./interface/SBCommandReturnObjectDocstrings.i"
2626
%include "./interface/SBCommunicationDocstrings.i"
2727
%include "./interface/SBCompileUnitDocstrings.i"
28-
%include "./interface/SBCoreDumpOptionsDocstrings.i"
28+
%include "./interface/SBSaveCoreOptionsDocstrings.i"
2929
%include "./interface/SBDataDocstrings.i"
3030
%include "./interface/SBDebuggerDocstrings.i"
3131
%include "./interface/SBDeclarationDocstrings.i"
@@ -102,7 +102,7 @@
102102
%include "lldb/API/SBCommandReturnObject.h"
103103
%include "lldb/API/SBCommunication.h"
104104
%include "lldb/API/SBCompileUnit.h"
105-
%include "lldb/API/SBCoreDumpOptions.h"
105+
%include "lldb/API/SBSaveCoreOptions.h"
106106
%include "lldb/API/SBData.h"
107107
%include "lldb/API/SBDebugger.h"
108108
%include "lldb/API/SBDeclaration.h"

lldb/include/lldb/API/LLDB.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include "lldb/API/SBCommandReturnObject.h"
2424
#include "lldb/API/SBCommunication.h"
2525
#include "lldb/API/SBCompileUnit.h"
26-
#include "lldb/API/SBCoreDumpOptions.h"
2726
#include "lldb/API/SBData.h"
2827
#include "lldb/API/SBDebugger.h"
2928
#include "lldb/API/SBDeclaration.h"
@@ -58,6 +57,7 @@
5857
#include "lldb/API/SBQueue.h"
5958
#include "lldb/API/SBQueueItem.h"
6059
#include "lldb/API/SBReproducer.h"
60+
#include "lldb/API/SBSaveCoreOptions.h"
6161
#include "lldb/API/SBSection.h"
6262
#include "lldb/API/SBSourceManager.h"
6363
#include "lldb/API/SBStatisticsOptions.h"

lldb/include/lldb/API/SBDefines.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class LLDB_API SBCommandPluginInterface;
6161
class LLDB_API SBCommandReturnObject;
6262
class LLDB_API SBCommunication;
6363
class LLDB_API SBCompileUnit;
64-
class LLDB_API SBCoreDumpOptions;
64+
class LLDB_API SBSaveCoreOptions;
6565
class LLDB_API SBData;
6666
class LLDB_API SBDebugger;
6767
class LLDB_API SBDeclaration;

lldb/include/lldb/API/SBError.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class LLDB_API SBError {
7777
friend class SBBreakpointName;
7878
friend class SBCommandReturnObject;
7979
friend class SBCommunication;
80-
friend class SBCoreDumpOptions;
80+
friend class SBSaveCoreOptions;
8181
friend class SBData;
8282
friend class SBDebugger;
8383
friend class SBFile;

lldb/include/lldb/API/SBFileSpec.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class LLDB_API SBFileSpec {
7878
friend class SBTarget;
7979
friend class SBThread;
8080
friend class SBTrace;
81-
friend class SBCoreDumpOptions;
81+
friend class SBSaveCoreOptions;
8282

8383
SBFileSpec(const lldb_private::FileSpec &fspec);
8484

lldb/include/lldb/API/SBProcess.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ class LLDB_API SBProcess {
382382
/// as defined in the options object.
383383
///
384384
/// \param[in] options - The options to use when saving the core file.
385-
lldb::SBError SaveCore(SBCoreDumpOptions &options);
385+
lldb::SBError SaveCore(SBSaveCoreOptions &options);
386386

387387
/// Query the address load_addr and store the details of the memory
388388
/// region that contains it in the supplied SBMemoryRegionInfo object.

lldb/include/lldb/API/SBCoreDumpOptions.h renamed to lldb/include/lldb/API/SBSaveCoreOptions.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
//===-- SBCoreDumpOptions.h -------------------------------------*- C++ -*-===//
1+
//===-- SBSaveCoreOptions.h -------------------------------------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLDB_API_SBCOREDUMPOPTIONS_H
10-
#define LLDB_API_SBCOREDUMPOPTIONS_H
9+
#ifndef LLDB_API_SBSaveCoreOPTIONS_H
10+
#define LLDB_API_SBSaveCoreOPTIONS_H
1111

1212
#include "lldb/API/SBDefines.h"
13-
#include "lldb/Symbol/CoreDumpOptions.h"
13+
#include "lldb/Symbol/SaveCoreOptions.h"
1414

1515
namespace lldb {
1616

17-
class LLDB_API SBCoreDumpOptions {
17+
class LLDB_API SBSaveCoreOptions {
1818
public:
19-
SBCoreDumpOptions();
20-
SBCoreDumpOptions(const lldb::SBCoreDumpOptions &rhs);
21-
~SBCoreDumpOptions() = default;
19+
SBSaveCoreOptions();
20+
SBSaveCoreOptions(const lldb::SBSaveCoreOptions &rhs);
21+
~SBSaveCoreOptions() = default;
2222

23-
const SBCoreDumpOptions &operator=(const lldb::SBCoreDumpOptions &rhs);
23+
const SBSaveCoreOptions &operator=(const lldb::SBSaveCoreOptions &rhs);
2424

2525
/// Set the plugin name. Supplying null or empty string will reset
2626
/// the option.
@@ -59,11 +59,11 @@ class LLDB_API SBCoreDumpOptions {
5959

6060
protected:
6161
friend class SBProcess;
62-
lldb_private::CoreDumpOptions &ref() const;
62+
lldb_private::SaveCoreOptions &ref() const;
6363

6464
private:
65-
std::unique_ptr<lldb_private::CoreDumpOptions> m_opaque_up;
66-
}; // SBCoreDumpOptions
65+
std::unique_ptr<lldb_private::SaveCoreOptions> m_opaque_up;
66+
}; // SBSaveCoreOptions
6767
} // namespace lldb
6868

69-
#endif // LLDB_API_SBCOREDUMPOPTIONS_H
69+
#endif // LLDB_API_SBSaveCoreOPTIONS_H

lldb/include/lldb/Core/PluginManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class PluginManager {
193193
GetObjectFileCreateMemoryCallbackForPluginName(llvm::StringRef name);
194194

195195
static Status SaveCore(const lldb::ProcessSP &process_sp,
196-
const lldb_private::CoreDumpOptions &core_options);
196+
const lldb_private::SaveCoreOptions &core_options);
197197

198198
// ObjectContainer
199199
static bool RegisterPlugin(

lldb/include/lldb/Symbol/CoreDumpOptions.h renamed to lldb/include/lldb/Symbol/SaveCoreOptions.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
//===-- CoreDumpOptions.h ---------------------------------------*- C++ -*-===//
1+
//===-- SaveCoreOptions.h ---------------------------------------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLDB_SOURCE_PLUGINS_OBJECTFILE_COREDUMPOPTIONS_H
10-
#define LLDB_SOURCE_PLUGINS_OBJECTFILE_COREDUMPOPTIONS_H
9+
#ifndef LLDB_SOURCE_PLUGINS_OBJECTFILE_SaveCoreOPTIONS_H
10+
#define LLDB_SOURCE_PLUGINS_OBJECTFILE_SaveCoreOPTIONS_H
1111

1212
#include "lldb/Utility/FileSpec.h"
1313
#include "lldb/lldb-forward.h"
@@ -18,10 +18,10 @@
1818

1919
namespace lldb_private {
2020

21-
class CoreDumpOptions {
21+
class SaveCoreOptions {
2222
public:
23-
CoreDumpOptions(){};
24-
~CoreDumpOptions() = default;
23+
SaveCoreOptions(){};
24+
~SaveCoreOptions() = default;
2525

2626
lldb_private::Status SetPluginName(const char *name);
2727
std::optional<std::string> GetPluginName() const;
@@ -41,4 +41,4 @@ class CoreDumpOptions {
4141
};
4242
} // namespace lldb_private
4343

44-
#endif // LLDB_SOURCE_PLUGINS_OBJECTFILE_COREDUMPOPTIONS_H
44+
#endif // LLDB_SOURCE_PLUGINS_OBJECTFILE_SaveCoreOPTIONS_H

lldb/include/lldb/lldb-private-interfaces.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#ifndef LLDB_LLDB_PRIVATE_INTERFACES_H
1010
#define LLDB_LLDB_PRIVATE_INTERFACES_H
1111

12-
#include "lldb/Symbol/CoreDumpOptions.h"
12+
#include "lldb/Symbol/SaveCoreOptions.h"
1313
#include "lldb/lldb-enumerations.h"
1414
#include "lldb/lldb-forward.h"
1515
#include "lldb/lldb-private-enumerations.h"
@@ -56,7 +56,7 @@ typedef ObjectFile *(*ObjectFileCreateMemoryInstance)(
5656
const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP data_sp,
5757
const lldb::ProcessSP &process_sp, lldb::addr_t offset);
5858
typedef bool (*ObjectFileSaveCore)(const lldb::ProcessSP &process_sp,
59-
const lldb_private::CoreDumpOptions &options,
59+
const lldb_private::SaveCoreOptions &options,
6060
Status &error);
6161
typedef EmulateInstruction *(*EmulateInstructionCreateInstance)(
6262
const ArchSpec &arch, InstructionType inst_type);

lldb/source/API/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ add_lldb_library(liblldb SHARED ${option_framework}
5656
SBCommandReturnObject.cpp
5757
SBCommunication.cpp
5858
SBCompileUnit.cpp
59-
SBCoreDumpOptions.cpp
59+
SBSaveCoreOptions.cpp
6060
SBData.cpp
6161
SBDebugger.cpp
6262
SBDeclaration.cpp

lldb/source/API/SBProcess.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@
3434

3535
#include "lldb/API/SBBroadcaster.h"
3636
#include "lldb/API/SBCommandReturnObject.h"
37-
#include "lldb/API/SBCoreDumpOptions.h"
3837
#include "lldb/API/SBDebugger.h"
3938
#include "lldb/API/SBEvent.h"
4039
#include "lldb/API/SBFile.h"
4140
#include "lldb/API/SBFileSpec.h"
4241
#include "lldb/API/SBMemoryRegionInfo.h"
4342
#include "lldb/API/SBMemoryRegionInfoList.h"
43+
#include "lldb/API/SBSaveCoreOptions.h"
4444
#include "lldb/API/SBScriptObject.h"
4545
#include "lldb/API/SBStream.h"
4646
#include "lldb/API/SBStringList.h"
@@ -1217,7 +1217,7 @@ bool SBProcess::IsInstrumentationRuntimePresent(
12171217

12181218
lldb::SBError SBProcess::SaveCore(const char *file_name) {
12191219
LLDB_INSTRUMENT_VA(this, file_name);
1220-
SBCoreDumpOptions options;
1220+
SBSaveCoreOptions options;
12211221
options.SetOutputFile(SBFileSpec(file_name));
12221222
options.SetStyle(SaveCoreStyle::eSaveCoreFull);
12231223
return SaveCore(options);
@@ -1227,14 +1227,14 @@ lldb::SBError SBProcess::SaveCore(const char *file_name,
12271227
const char *flavor,
12281228
SaveCoreStyle core_style) {
12291229
LLDB_INSTRUMENT_VA(this, file_name, flavor, core_style);
1230-
SBCoreDumpOptions options;
1230+
SBSaveCoreOptions options;
12311231
options.SetOutputFile(SBFileSpec(file_name));
12321232
options.SetPluginName(flavor);
12331233
options.SetStyle(core_style);
12341234
return SaveCore(options);
12351235
}
12361236

1237-
lldb::SBError SBProcess::SaveCore(SBCoreDumpOptions &options) {
1237+
lldb::SBError SBProcess::SaveCore(SBSaveCoreOptions &options) {
12381238

12391239
LLDB_INSTRUMENT_VA(this, options);
12401240

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,85 @@
1-
//===-- SBCoreDumpOptions.cpp -----------------------------------*- C++ -*-===//
1+
//===-- SBSaveCoreOptions.cpp -----------------------------------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "lldb/API/SBCoreDumpOptions.h"
9+
#include "lldb/API/SBSaveCoreOptions.h"
1010
#include "lldb/API/SBError.h"
1111
#include "lldb/API/SBFileSpec.h"
1212
#include "lldb/Host/FileSystem.h"
13-
#include "lldb/Symbol/CoreDumpOptions.h"
13+
#include "lldb/Symbol/SaveCoreOptions.h"
1414
#include "lldb/Utility/Instrumentation.h"
1515

1616
#include "Utils.h"
1717

1818
using namespace lldb;
1919

20-
SBCoreDumpOptions::SBCoreDumpOptions() {
20+
SBSaveCoreOptions::SBSaveCoreOptions() {
2121
LLDB_INSTRUMENT_VA(this)
2222

23-
m_opaque_up = std::make_unique<lldb_private::CoreDumpOptions>();
23+
m_opaque_up = std::make_unique<lldb_private::SaveCoreOptions>();
2424
}
2525

26-
SBCoreDumpOptions::SBCoreDumpOptions(const SBCoreDumpOptions &rhs) {
26+
SBSaveCoreOptions::SBSaveCoreOptions(const SBSaveCoreOptions &rhs) {
2727
LLDB_INSTRUMENT_VA(this, rhs);
2828

2929
m_opaque_up = clone(rhs.m_opaque_up);
3030
}
3131

32-
const SBCoreDumpOptions &
33-
SBCoreDumpOptions::operator=(const SBCoreDumpOptions &rhs) {
32+
const SBSaveCoreOptions &
33+
SBSaveCoreOptions::operator=(const SBSaveCoreOptions &rhs) {
3434
LLDB_INSTRUMENT_VA(this, rhs);
3535

3636
if (this != &rhs)
3737
m_opaque_up = clone(rhs.m_opaque_up);
3838
return *this;
3939
}
4040

41-
SBError SBCoreDumpOptions::SetPluginName(const char *name) {
41+
SBError SBSaveCoreOptions::SetPluginName(const char *name) {
4242
LLDB_INSTRUMENT_VA(this, name);
4343
lldb_private::Status error = m_opaque_up->SetPluginName(name);
4444
return SBError(error);
4545
}
4646

47-
void SBCoreDumpOptions::SetStyle(lldb::SaveCoreStyle style) {
47+
void SBSaveCoreOptions::SetStyle(lldb::SaveCoreStyle style) {
4848
LLDB_INSTRUMENT_VA(this, style);
4949
m_opaque_up->SetStyle(style);
5050
}
5151

52-
void SBCoreDumpOptions::SetOutputFile(lldb::SBFileSpec file_spec) {
52+
void SBSaveCoreOptions::SetOutputFile(lldb::SBFileSpec file_spec) {
5353
LLDB_INSTRUMENT_VA(this, file_spec);
5454
m_opaque_up->SetOutputFile(file_spec.ref());
5555
}
5656

57-
const char *SBCoreDumpOptions::GetPluginName() const {
57+
const char *SBSaveCoreOptions::GetPluginName() const {
5858
LLDB_INSTRUMENT_VA(this);
5959
const auto name = m_opaque_up->GetPluginName();
6060
if (!name)
6161
return nullptr;
6262
return lldb_private::ConstString(name.value()).GetCString();
6363
}
6464

65-
SBFileSpec SBCoreDumpOptions::GetOutputFile() const {
65+
SBFileSpec SBSaveCoreOptions::GetOutputFile() const {
6666
LLDB_INSTRUMENT_VA(this);
6767
const auto file_spec = m_opaque_up->GetOutputFile();
6868
if (file_spec)
6969
return SBFileSpec(file_spec.value());
7070
return SBFileSpec();
7171
}
7272

73-
lldb::SaveCoreStyle SBCoreDumpOptions::GetStyle() const {
73+
lldb::SaveCoreStyle SBSaveCoreOptions::GetStyle() const {
7474
LLDB_INSTRUMENT_VA(this);
7575
return m_opaque_up->GetStyle();
7676
}
7777

78-
void SBCoreDumpOptions::Clear() {
78+
void SBSaveCoreOptions::Clear() {
7979
LLDB_INSTRUMENT_VA(this);
8080
m_opaque_up->Clear();
8181
}
8282

83-
lldb_private::CoreDumpOptions &SBCoreDumpOptions::ref() const {
83+
lldb_private::SaveCoreOptions &SBSaveCoreOptions::ref() const {
8484
return *m_opaque_up.get();
8585
}

lldb/source/Commands/CommandObjectProcess.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@ class CommandObjectProcessSaveCore : public CommandObjectParsed {
12911291
}
12921292

12931293
// Instance variables to hold the values for command options.
1294-
CoreDumpOptions m_core_dump_options;
1294+
SaveCoreOptions m_core_dump_options;
12951295
};
12961296

12971297
protected:

lldb/source/Core/PluginManager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "lldb/Host/FileSystem.h"
1313
#include "lldb/Host/HostInfo.h"
1414
#include "lldb/Interpreter/OptionValueProperties.h"
15-
#include "lldb/Symbol/CoreDumpOptions.h"
15+
#include "lldb/Symbol/SaveCoreOptions.h"
1616
#include "lldb/Target/Process.h"
1717
#include "lldb/Utility/FileSpec.h"
1818
#include "lldb/Utility/Status.h"
@@ -702,7 +702,7 @@ PluginManager::GetObjectFileCreateMemoryCallbackForPluginName(
702702
}
703703

704704
Status PluginManager::SaveCore(const lldb::ProcessSP &process_sp,
705-
const lldb_private::CoreDumpOptions &options) {
705+
const lldb_private::SaveCoreOptions &options) {
706706
Status error;
707707
if (!options.GetOutputFile()) {
708708
error.SetErrorString("No output file specified");

lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6519,7 +6519,7 @@ struct page_object {
65196519
};
65206520

65216521
bool ObjectFileMachO::SaveCore(const lldb::ProcessSP &process_sp,
6522-
const lldb_private::CoreDumpOptions &options,
6522+
const lldb_private::SaveCoreOptions &options,
65236523
Status &error) {
65246524
auto core_style = options.GetStyle();
65256525
if (core_style == SaveCoreStyle::eSaveCoreUnspecified)

lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class ObjectFileMachO : public lldb_private::ObjectFile {
6262
lldb_private::ModuleSpecList &specs);
6363

6464
static bool SaveCore(const lldb::ProcessSP &process_sp,
65-
const lldb_private::CoreDumpOptions &options,
65+
const lldb_private::SaveCoreOptions &options,
6666
lldb_private::Status &error);
6767

6868
static bool MagicBytesMatch(lldb::DataBufferSP data_sp, lldb::addr_t offset,

0 commit comments

Comments
 (0)