Skip to content

Commit 24ca9aa

Browse files
committed
Merge commit 'f188f2579da3' from apple/stable/20200714 into swift/main
Conflicts: lldb/test/API/lit.cfg.py
2 parents 03a3e9a + f188f25 commit 24ca9aa

35 files changed

+166
-155
lines changed

lldb/include/lldb/Interpreter/OptionValue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class OptionValue {
8585
SetValueFromString(llvm::StringRef value,
8686
VarSetOperationType op = eVarSetOperationAssign);
8787

88-
virtual bool Clear() = 0;
88+
virtual void Clear() = 0;
8989

9090
virtual lldb::OptionValueSP DeepCopy() const = 0;
9191

lldb/include/lldb/Interpreter/OptionValueArch.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,9 @@ class OptionValueArch : public OptionValue {
4747
SetValueFromString(const char *,
4848
VarSetOperationType = eVarSetOperationAssign) = delete;
4949

50-
bool Clear() override {
50+
void Clear() override {
5151
m_current_value = m_default_value;
5252
m_value_was_set = false;
53-
return true;
5453
}
5554

5655
lldb::OptionValueSP DeepCopy() const override;

lldb/include/lldb/Interpreter/OptionValueArray.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,9 @@ class OptionValueArray : public OptionValue {
3636
SetValueFromString(const char *,
3737
VarSetOperationType = eVarSetOperationAssign) = delete;
3838

39-
bool Clear() override {
39+
void Clear() override {
4040
m_values.clear();
4141
m_value_was_set = false;
42-
return true;
4342
}
4443

4544
lldb::OptionValueSP DeepCopy() const override;

lldb/include/lldb/Interpreter/OptionValueBoolean.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@ class OptionValueBoolean : public OptionValue {
3737
SetValueFromString(const char *,
3838
VarSetOperationType = eVarSetOperationAssign) = delete;
3939

40-
bool Clear() override {
40+
void Clear() override {
4141
m_current_value = m_default_value;
4242
m_value_was_set = false;
43-
return true;
4443
}
4544

4645
void AutoComplete(CommandInterpreter &interpreter,

lldb/include/lldb/Interpreter/OptionValueChar.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@ class OptionValueChar : public OptionValue {
3838
SetValueFromString(const char *,
3939
VarSetOperationType = eVarSetOperationAssign) = delete;
4040

41-
bool Clear() override {
41+
void Clear() override {
4242
m_current_value = m_default_value;
4343
m_value_was_set = false;
44-
return true;
4544
}
4645

4746
// Subclass specific functions

lldb/include/lldb/Interpreter/OptionValueDictionary.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@ class OptionValueDictionary : public OptionValue {
3535
SetValueFromString(llvm::StringRef value,
3636
VarSetOperationType op = eVarSetOperationAssign) override;
3737

38-
bool Clear() override {
38+
void Clear() override {
3939
m_values.clear();
4040
m_value_was_set = false;
41-
return true;
4241
}
4342

4443
lldb::OptionValueSP DeepCopy() const override;

lldb/include/lldb/Interpreter/OptionValueEnumeration.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,9 @@ class OptionValueEnumeration : public OptionValue {
4747
SetValueFromString(const char *,
4848
VarSetOperationType = eVarSetOperationAssign) = delete;
4949

50-
bool Clear() override {
50+
void Clear() override {
5151
m_current_value = m_default_value;
5252
m_value_was_set = false;
53-
return true;
5453
}
5554

5655
lldb::OptionValueSP DeepCopy() const override;

lldb/include/lldb/Interpreter/OptionValueFileColonLine.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ class OptionValueFileColonLine : public OptionValue {
3535
SetValueFromString(const char *,
3636
VarSetOperationType = eVarSetOperationAssign) = delete;
3737

38-
bool Clear() override {
38+
void Clear() override {
3939
m_file_spec.Clear();
4040
m_line_number = LLDB_INVALID_LINE_NUMBER;
41-
m_column_number = 0;
41+
m_column_number = LLDB_INVALID_COLUMN_NUMBER;
4242
}
4343

4444
lldb::OptionValueSP DeepCopy() const override;
@@ -49,7 +49,7 @@ class OptionValueFileColonLine : public OptionValue {
4949
FileSpec &GetFileSpec() { return m_file_spec; }
5050
uint32_t GetLineNumber() { return m_line_number; }
5151
uint32_t GetColumnNumber() { return m_column_number; }
52-
52+
5353
void SetCompletionMask(uint32_t mask) { m_completion_mask = mask; }
5454

5555
protected:

lldb/include/lldb/Interpreter/OptionValueFileSpec.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,11 @@ class OptionValueFileSpec : public OptionValue {
4141
SetValueFromString(const char *,
4242
VarSetOperationType = eVarSetOperationAssign) = delete;
4343

44-
bool Clear() override {
44+
void Clear() override {
4545
m_current_value = m_default_value;
4646
m_value_was_set = false;
4747
m_data_sp.reset();
4848
m_data_mod_time = llvm::sys::TimePoint<>();
49-
return true;
5049
}
5150

5251
lldb::OptionValueSP DeepCopy() const override;

lldb/include/lldb/Interpreter/OptionValueFileSpecList.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,10 @@ class OptionValueFileSpecList : public OptionValue {
3939
SetValueFromString(const char *,
4040
VarSetOperationType = eVarSetOperationAssign) = delete;
4141

42-
bool Clear() override {
42+
void Clear() override {
4343
std::lock_guard<std::recursive_mutex> lock(m_mutex);
4444
m_current_value.Clear();
4545
m_value_was_set = false;
46-
return true;
4746
}
4847

4948
lldb::OptionValueSP DeepCopy() const override;

lldb/include/lldb/Interpreter/OptionValueFormat.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@ class OptionValueFormat : public OptionValue {
3838
SetValueFromString(const char *,
3939
VarSetOperationType = eVarSetOperationAssign) = delete;
4040

41-
bool Clear() override {
41+
void Clear() override {
4242
m_current_value = m_default_value;
4343
m_value_was_set = false;
44-
return true;
4544
}
4645

4746
lldb::OptionValueSP DeepCopy() const override;

lldb/include/lldb/Interpreter/OptionValueFormatEntity.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class OptionValueFormatEntity : public OptionValue {
3434
SetValueFromString(const char *,
3535
VarSetOperationType = eVarSetOperationAssign) = delete;
3636

37-
bool Clear() override;
37+
void Clear() override;
3838

3939
lldb::OptionValueSP DeepCopy() const override;
4040

lldb/include/lldb/Interpreter/OptionValueLanguage.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,9 @@ class OptionValueLanguage : public OptionValue {
4141
SetValueFromString(const char *,
4242
VarSetOperationType = eVarSetOperationAssign) = delete;
4343

44-
bool Clear() override {
44+
void Clear() override {
4545
m_current_value = m_default_value;
4646
m_value_was_set = false;
47-
return true;
4847
}
4948

5049
lldb::OptionValueSP DeepCopy() const override;

lldb/include/lldb/Interpreter/OptionValuePathMappings.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@ class OptionValuePathMappings : public OptionValue {
3535
SetValueFromString(const char *,
3636
VarSetOperationType = eVarSetOperationAssign) = delete;
3737

38-
bool Clear() override {
38+
void Clear() override {
3939
m_path_mappings.Clear(m_notify_changes);
4040
m_value_was_set = false;
41-
return true;
4241
}
4342

4443
lldb::OptionValueSP DeepCopy() const override;

lldb/include/lldb/Interpreter/OptionValueProperties.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class OptionValueProperties
3434

3535
Type GetType() const override { return eTypeProperties; }
3636

37-
bool Clear() override;
37+
void Clear() override;
3838

3939
lldb::OptionValueSP DeepCopy() const override;
4040

lldb/include/lldb/Interpreter/OptionValueRegex.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,9 @@ class OptionValueRegex : public OptionValue {
3636
SetValueFromString(const char *,
3737
VarSetOperationType = eVarSetOperationAssign) = delete;
3838

39-
bool Clear() override {
39+
void Clear() override {
4040
m_regex = RegularExpression(m_default_regex_str);
4141
m_value_was_set = false;
42-
return true;
4342
}
4443

4544
lldb::OptionValueSP DeepCopy() const override;

lldb/include/lldb/Interpreter/OptionValueSInt64.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,9 @@ class OptionValueSInt64 : public OptionValue {
5050
SetValueFromString(const char *,
5151
VarSetOperationType = eVarSetOperationAssign) = delete;
5252

53-
bool Clear() override {
53+
void Clear() override {
5454
m_current_value = m_default_value;
5555
m_value_was_set = false;
56-
return true;
5756
}
5857

5958
lldb::OptionValueSP DeepCopy() const override;

lldb/include/lldb/Interpreter/OptionValueString.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,9 @@ class OptionValueString : public OptionValue {
8585
SetValueFromString(const char *,
8686
VarSetOperationType = eVarSetOperationAssign) = delete;
8787

88-
bool Clear() override {
88+
void Clear() override {
8989
m_current_value = m_default_value;
9090
m_value_was_set = false;
91-
return true;
9291
}
9392

9493
lldb::OptionValueSP DeepCopy() const override;

lldb/include/lldb/Interpreter/OptionValueUInt64.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,9 @@ class OptionValueUInt64 : public OptionValue {
4747
SetValueFromString(const char *,
4848
VarSetOperationType = eVarSetOperationAssign) = delete;
4949

50-
bool Clear() override {
50+
void Clear() override {
5151
m_current_value = m_default_value;
5252
m_value_was_set = false;
53-
return true;
5453
}
5554

5655
lldb::OptionValueSP DeepCopy() const override;

lldb/include/lldb/Interpreter/OptionValueUUID.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,9 @@ class OptionValueUUID : public OptionValue {
3636
SetValueFromString(const char *,
3737
VarSetOperationType = eVarSetOperationAssign) = delete;
3838

39-
bool Clear() override {
39+
void Clear() override {
4040
m_uuid.Clear();
4141
m_value_was_set = false;
42-
return true;
4342
}
4443

4544
lldb::OptionValueSP DeepCopy() const override;

lldb/packages/Python/lldbsuite/test/decorators.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,10 +527,9 @@ def are_sb_headers_missing():
527527
if lldb.remote_platform:
528528
return "skip because SBHeaders tests make no sense remotely"
529529

530-
if lldbplatformutil.getHostPlatform() == 'darwin':
530+
if lldbplatformutil.getHostPlatform() == 'darwin' and configuration.lldb_framework_path:
531531
header = os.path.join(
532-
os.environ["LLDB_LIB_DIR"],
533-
'LLDB.framework',
532+
configuration.lldb_framework_path,
534533
'Versions',
535534
'Current',
536535
'Headers',

lldb/packages/Python/lldbsuite/test/dotest.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -549,13 +549,6 @@ def setupSysPath():
549549
print("The 'lldb' executable cannot be located. Some of the tests may not be run as a result.")
550550
sys.exit(-1)
551551

552-
# confusingly, this is the "bin" directory
553-
lldbLibDir = os.path.dirname(lldbtest_config.lldbExec)
554-
os.environ["LLDB_LIB_DIR"] = lldbLibDir
555-
lldbImpLibDir = configuration.lldb_libs_dir
556-
os.environ["LLDB_IMPLIB_DIR"] = lldbImpLibDir
557-
print("LLDB library dir:", os.environ["LLDB_LIB_DIR"])
558-
print("LLDB import library dir:", os.environ["LLDB_IMPLIB_DIR"])
559552
os.system('%s -v' % lldbtest_config.lldbExec)
560553

561554
lldbDir = os.path.dirname(lldbtest_config.lldbExec)
@@ -570,8 +563,6 @@ def setupSysPath():
570563
configuration.skip_categories.append("lldb-vscode")
571564

572565
lldbPythonDir = None # The directory that contains 'lldb/__init__.py'
573-
if not configuration.lldb_framework_path and os.path.exists(os.path.join(lldbLibDir, "LLDB.framework")):
574-
configuration.lldb_framework_path = os.path.join(lldbLibDir, "LLDB.framework")
575566
if configuration.lldb_framework_path:
576567
lldbtest_config.lldb_framework_path = configuration.lldb_framework_path
577568
candidatePath = os.path.join(

lldb/packages/Python/lldbsuite/test/lldbtest.py

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -846,28 +846,18 @@ def setUp(self):
846846
self.setPlatformWorkingDir()
847847
self.enableLogChannelsForCurrentTest()
848848

849-
lib_dir = os.environ["LLDB_LIB_DIR"]
850-
self.dsym = None
849+
self.lib_lldb = None
851850
self.framework_dir = None
852-
self.darwinWithFramework = self.platformIsDarwin()
853-
if sys.platform.startswith("darwin"):
854-
# Handle the framework environment variable if it is set
855-
if hasattr(lldbtest_config, 'lldb_framework_path'):
856-
framework_path = lldbtest_config.lldb_framework_path
857-
# Framework dir should be the directory containing the framework
858-
self.framework_dir = framework_path[:framework_path.rfind('LLDB.framework')]
859-
# If a framework dir was not specified assume the Xcode build
860-
# directory layout where the framework is in LLDB_LIB_DIR.
861-
else:
862-
self.framework_dir = lib_dir
863-
self.dsym = os.path.join(self.framework_dir, 'LLDB.framework', 'LLDB')
864-
# If the framework binary doesn't exist, assume we didn't actually
865-
# build a framework, and fallback to standard *nix behavior by
866-
# setting framework_dir and dsym to None.
867-
if not os.path.exists(self.dsym):
868-
self.framework_dir = None
869-
self.dsym = None
870-
self.darwinWithFramework = False
851+
self.darwinWithFramework = False
852+
853+
if sys.platform.startswith("darwin") and configuration.lldb_framework_path:
854+
framework = configuration.lldb_framework_path
855+
lib = os.path.join(framework, 'LLDB')
856+
if os.path.exists(lib):
857+
self.framework_dir = os.path.dirname(framework)
858+
self.lib_lldb = lib
859+
self.darwinWithFramework = self.platformIsDarwin()
860+
871861
self.makeBuildDir()
872862

873863
def setAsync(self, value):
@@ -1432,7 +1422,7 @@ def buildDriver(self, sources, exe_name):
14321422
'EXE': exe_name,
14331423
'CFLAGS_EXTRAS': "%s %s" % (stdflag, stdlibflag),
14341424
'FRAMEWORK_INCLUDES': "-F%s" % self.framework_dir,
1435-
'LD_EXTRAS': "%s -Wl,-rpath,%s" % (self.dsym, self.framework_dir),
1425+
'LD_EXTRAS': "%s -Wl,-rpath,%s" % (self.lib_lldb, self.framework_dir),
14361426
}
14371427
elif sys.platform.startswith('win'):
14381428
d = {
@@ -1443,7 +1433,7 @@ def buildDriver(self, sources, exe_name):
14431433
os.path.join(
14441434
os.environ["LLDB_SRC"],
14451435
"include")),
1446-
'LD_EXTRAS': "-L%s -lliblldb" % os.environ["LLDB_IMPLIB_DIR"]}
1436+
'LD_EXTRAS': "-L%s -lliblldb" % lib_dir}
14471437
else:
14481438
d = {
14491439
'CXX_SOURCES': sources,
@@ -1472,7 +1462,7 @@ def buildLibrary(self, sources, lib_name):
14721462
'DYLIB_NAME': lib_name,
14731463
'CFLAGS_EXTRAS': "%s -stdlib=libc++" % stdflag,
14741464
'FRAMEWORK_INCLUDES': "-F%s" % self.framework_dir,
1475-
'LD_EXTRAS': "%s -Wl,-rpath,%s -dynamiclib" % (self.dsym, self.framework_dir),
1465+
'LD_EXTRAS': "%s -Wl,-rpath,%s -dynamiclib" % (self.lib_lldb, self.framework_dir),
14761466
}
14771467
elif self.getPlatform() == 'windows':
14781468
d = {
@@ -1482,7 +1472,7 @@ def buildLibrary(self, sources, lib_name):
14821472
os.path.join(
14831473
os.environ["LLDB_SRC"],
14841474
"include")),
1485-
'LD_EXTRAS': "-shared -l%s\liblldb.lib" % self.os.environ["LLDB_IMPLIB_DIR"]}
1475+
'LD_EXTRAS': "-shared -l%s\liblldb.lib" % lib_dir}
14861476
else:
14871477
d = {
14881478
'DYLIB_CXX_SOURCES': sources,
@@ -1697,13 +1687,11 @@ def getLLDBLibraryEnvVal(self):
16971687
"""
16981688
existing_library_path = os.environ[
16991689
self.dylibPath] if self.dylibPath in os.environ else None
1700-
lib_dir = os.environ["LLDB_LIB_DIR"]
17011690
if existing_library_path:
1702-
return "%s:%s" % (existing_library_path, lib_dir)
1703-
elif sys.platform.startswith("darwin"):
1704-
return os.path.join(lib_dir, 'LLDB.framework')
1705-
else:
1706-
return lib_dir
1691+
return "%s:%s" % (existing_library_path, configuration.lldb_libs_dir)
1692+
if sys.platform.startswith("darwin") and configuration.lldb_framework_path:
1693+
return configuration.lldb_framework_path
1694+
return configuration.lldb_libs_dir
17071695

17081696
def getLibcPlusPlusLibs(self):
17091697
if self.getPlatform() in ('freebsd', 'linux', 'netbsd', 'openbsd'):

lldb/source/Interpreter/OptionValueFormatEntity.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@ OptionValueFormatEntity::OptionValueFormatEntity(const char *default_format)
2929
}
3030
}
3131

32-
bool OptionValueFormatEntity::Clear() {
32+
void OptionValueFormatEntity::Clear() {
3333
m_current_entry = m_default_entry;
3434
m_current_format = m_default_format;
3535
m_value_was_set = false;
36-
return true;
3736
}
3837

3938
static void EscapeBackticks(llvm::StringRef str, std::string &dst) {

lldb/source/Interpreter/OptionValueProperties.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,11 +517,10 @@ bool OptionValueProperties::SetPropertyAtIndexAsUInt64(
517517
return false;
518518
}
519519

520-
bool OptionValueProperties::Clear() {
520+
void OptionValueProperties::Clear() {
521521
const size_t num_properties = m_properties.size();
522522
for (size_t i = 0; i < num_properties; ++i)
523523
m_properties[i].GetValue()->Clear();
524-
return true;
525524
}
526525

527526
Status OptionValueProperties::SetValueFromString(llvm::StringRef value,

0 commit comments

Comments
 (0)