Skip to content

Commit a283b6d

Browse files
author
Kevin Frei
committed
Updated to respond to (very late) code review feedback
1 parent e1b446e commit a283b6d

File tree

6 files changed

+36
-30
lines changed

6 files changed

+36
-30
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,6 +1053,10 @@ def _get_bool_config_skip_if_decorator(key):
10531053
return unittest.skipIf(not have, "requires " + key)
10541054

10551055

1056+
def skipIfCurlSupportMissing(func):
1057+
return _get_bool_config_skip_if_decorator("curl")(func)
1058+
1059+
10561060
def skipIfCursesSupportMissing(func):
10571061
return _get_bool_config_skip_if_decorator("curses")(func)
10581062

lldb/source/API/SBDebugger.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,9 @@ SBStructuredData SBDebugger::GetBuildConfiguration() {
775775
AddBoolConfigEntry(
776776
*config_up, "xml", XMLDocument::XMLEnabled(),
777777
"A boolean value that indicates if XML support is enabled in LLDB");
778+
AddBoolConfigEntry(
779+
*config_up, "curl", LLVM_ENABLE_CURL,
780+
"A boolean value that indicates if CURL support is enabled in LLDB");
778781
AddBoolConfigEntry(
779782
*config_up, "curses", LLDB_ENABLE_CURSES,
780783
"A boolean value that indicates if curses support is enabled in LLDB");
@@ -1724,20 +1727,20 @@ SBDebugger::LoadTraceFromFile(SBError &error,
17241727

17251728
void SBDebugger::RequestInterrupt() {
17261729
LLDB_INSTRUMENT_VA(this);
1727-
1730+
17281731
if (m_opaque_sp)
1729-
m_opaque_sp->RequestInterrupt();
1732+
m_opaque_sp->RequestInterrupt();
17301733
}
17311734
void SBDebugger::CancelInterruptRequest() {
17321735
LLDB_INSTRUMENT_VA(this);
1733-
1736+
17341737
if (m_opaque_sp)
1735-
m_opaque_sp->CancelInterruptRequest();
1738+
m_opaque_sp->CancelInterruptRequest();
17361739
}
17371740

17381741
bool SBDebugger::InterruptRequested() {
17391742
LLDB_INSTRUMENT_VA(this);
1740-
1743+
17411744
if (m_opaque_sp)
17421745
return m_opaque_sp->InterruptRequested();
17431746
return false;

lldb/test/API/debuginfod/Normal/TestDebuginfod.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ class DebugInfodTests(TestBase):
2222
# No need to try every flavor of debug inf.
2323
NO_DEBUG_INFO_TESTCASE = True
2424

25-
def setUp(self):
26-
TestBase.setUp(self)
27-
# Don't run these tests if we don't have Debuginfod support
28-
if "Debuginfod" not in configuration.enabled_plugins:
29-
self.skipTest("The Debuginfod SymbolLocator plugin is not enabled")
25+
# def setUp(self):
26+
# TestBase.setUp(self)
27+
# # Don't run these tests if we don't have Debuginfod support
28+
# if "Debuginfod" not in configuration.enabled_plugins:
29+
# self.skipTest("The Debuginfod SymbolLocator plugin is not enabled")
3030

3131
def test_normal_no_symbols(self):
3232
"""
@@ -44,6 +44,7 @@ def test_normal_default(self):
4444
test_root = self.config_test(["a.out", "a.out.debug"])
4545
self.try_breakpoint(True)
4646

47+
@skipIfCurlSupportMissing
4748
def test_debuginfod_symbols(self):
4849
"""
4950
Test behavior with the full binary available from Debuginfod as
@@ -52,6 +53,7 @@ def test_debuginfod_symbols(self):
5253
test_root = self.config_test(["a.out"], "a.out.unstripped")
5354
self.try_breakpoint(True)
5455

56+
@skipIfCurlSupportMissing
5557
def test_debuginfod_executable(self):
5658
"""
5759
Test behavior with the full binary available from Debuginfod as
@@ -60,6 +62,7 @@ def test_debuginfod_executable(self):
6062
test_root = self.config_test(["a.out"], None, "a.out.unstripped")
6163
self.try_breakpoint(True)
6264

65+
@skipIfCurlSupportMissing
6366
def test_debuginfod_okd_symbols(self):
6467
"""
6568
Test behavior with the 'only-keep-debug' symbols available from Debuginfod.
@@ -174,10 +177,9 @@ def config_test(self, local_files, debuginfo=None, executable=None):
174177

175178
def getUUID(self, filename):
176179
try:
177-
target = self.dbg.CreateTarget(self.getBuildArtifact(filename))
178-
module = target.GetModuleAtIndex(0)
179-
uuid = module.GetUUIDString().replace("-", "").lower()
180-
self.dbg.DeleteTarget(target)
181-
return uuid if len(uuid) == 40 else None
180+
spec = lldb.SBModuleSpec()
181+
spec.SetFileSpec(self.getBuildArtifact(filename))
182+
uuid = lldb.SBModule(spec).GetUUIDString().replace("-", "").lower()
183+
return uuid if len(uuid) > 8 else None # Shouldn't have CRC's in this field
182184
except:
183185
return None

lldb/test/API/debuginfod/SplitDWARF/TestDebuginfodDWP.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ class DebugInfodDWPTests(TestBase):
2525
# No need to try every flavor of debug inf.
2626
NO_DEBUG_INFO_TESTCASE = True
2727

28-
def setUp(self):
29-
TestBase.setUp(self)
30-
# Don't run these tests if we don't have Debuginfod support
31-
if "Debuginfod" not in configuration.enabled_plugins:
32-
self.skipTest("The Debuginfod SymbolLocator plugin is not enabled")
28+
# def setUp(self):
29+
# TestBase.setUp(self)
30+
# # Don't run these tests if we don't have Debuginfod support
31+
# if "Debuginfod" not in configuration.enabled_plugins:
32+
# self.skipTest("The Debuginfod SymbolLocator plugin is not enabled")
3333

3434
def test_normal_stripped(self):
3535
"""
@@ -54,13 +54,15 @@ def test_normal_stripped_only_dwp(self):
5454
self.config_test(["a.out", "a.out.dwp"])
5555
self.try_breakpoint(False)
5656

57+
@skipIfCurlSupportMissing
5758
def test_debuginfod_dwp_from_service(self):
5859
"""
5960
Test behavior with the unstripped binary, and DWP from the service.
6061
"""
6162
self.config_test(["a.out.debug"], "a.out.dwp")
6263
self.try_breakpoint(True)
6364

65+
@skipIfCurlSupportMissing
6466
def test_debuginfod_both_symfiles_from_service(self):
6567
"""
6668
Test behavior with a stripped binary, with the unstripped binary and
@@ -69,6 +71,7 @@ def test_debuginfod_both_symfiles_from_service(self):
6971
self.config_test(["a.out"], "a.out.dwp", "a.out.unstripped")
7072
self.try_breakpoint(True)
7173

74+
@skipIfCurlSupportMissing
7275
def test_debuginfod_both_okd_symfiles_from_service(self):
7376
"""
7477
Test behavior with both the only-keep-debug symbols and the dwp symbols
@@ -183,10 +186,9 @@ def config_test(self, local_files, debuginfo=None, executable=None):
183186

184187
def getUUID(self, filename):
185188
try:
186-
target = self.dbg.CreateTarget(self.getBuildArtifact(filename))
187-
module = target.GetModuleAtIndex(0)
188-
uuid = module.GetUUIDString().replace("-", "").lower()
189-
self.dbg.DeleteTarget(target)
190-
return uuid if len(uuid) == 40 else None
189+
spec = lldb.SBModuleSpec()
190+
spec.SetFileSpec(self.getBuildArtifact(filename))
191+
uuid = lldb.SBModule(spec).GetUUIDString().replace("-", "").lower()
192+
return uuid if len(uuid) > 8 else None # Shouldn't have CRC's in this field
191193
except:
192194
return None

lldb/test/API/lit.site.cfg.py.in

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ lldb_build_intel_pt = '@LLDB_BUILD_INTEL_PT@'
4444
if lldb_build_intel_pt == '1':
4545
config.enabled_plugins.append('intel-pt')
4646

47-
llvm_enable_curl = '@LLVM_ENABLE_CURL@'
48-
if llvm_enable_curl == '1':
49-
config.enabled_plugins.append('Debuginfod')
50-
5147
# Additional dotest arguments can be passed to lit by providing a
5248
# semicolon-separates list: --param dotest-args="arg;arg".
5349
dotest_lit_args_str = lit_config.params.get('dotest-args', None)

lldb/test/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ endif()
238238
# These values are not canonicalized within LLVM.
239239
llvm_canonicalize_cmake_booleans(
240240
LLDB_BUILD_INTEL_PT
241-
LLVM_ENABLE_CURL
242241
LLDB_ENABLE_PYTHON
243242
LLDB_ENABLE_LUA
244243
LLDB_ENABLE_LZMA

0 commit comments

Comments
 (0)