[Lldb-commits] [lldb] c21dfa9 - [lldb] Remove prefer-dynamic-value test override
Dave Lee via lldb-commits
lldb-commits at lists.llvm.org
Mon Aug 22 15:46:18 PDT 2022
Author: Dave Lee
Date: 2022-08-22T15:46:03-07:00
New Revision: c21dfa9e4931a0a339813a5d384fc2eb0deee235
URL: https://github.com/llvm/llvm-project/commit/c21dfa9e4931a0a339813a5d384fc2eb0deee235
DIFF: https://github.com/llvm/llvm-project/commit/c21dfa9e4931a0a339813a5d384fc2eb0deee235.diff
LOG: [lldb] Remove prefer-dynamic-value test override
Remove the test override of `target.prefer-dynamic-value`.
Previously, the lldb default was `no-dynamic-values`. In rG9aa7e8e9ffbe (in
2015), the default was changed to `no-run-target`, but at that time the tests
were changed to be run with `no-dynamic-value`. I don't know the reasons for
not changing the tests, perhaps to avoid determining which tests to change, and
what about them to change.
Because `no-run-target` is the lldb default, I think it makes sense to make it
the test default too. It puts the test config closer to what's used in
practice.
This change removes the `target.prefer-dynamic-value` override, and for those
tests that failed, they have been updated to explicitly use
`no-dynamic-values`. Future changes could update these tests to use dynamic
values too, or they can be left as is to exercise non-dynamic typing.
Differential Revision: https://reviews.llvm.org/D132382
Added:
Modified:
lldb/packages/Python/lldbsuite/test/configuration.py
lldb/test/API/commands/expression/po_verbosity/TestPoVerbosity.py
lldb/test/API/commands/expression/two-files/TestObjCTypeQueryFromOtherCompileUnit.py
lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCCF.py
lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCExpr.py
lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCKVO.py
lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSContainer.py
lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSData.py
lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSNumber.py
lldb/test/API/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py
lldb/test/API/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py
lldb/test/API/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
lldb/test/API/lang/cpp/diamond/TestCppDiamond.py
lldb/test/API/lang/objc/blocks/TestObjCIvarsInBlocks.py
lldb/test/API/lang/objc/exceptions/TestObjCExceptions.py
lldb/test/API/lang/objc/foundation/TestObjCMethods.py
lldb/test/API/lang/objc/foundation/TestObjCMethodsString.py
lldb/test/API/lang/objc/foundation/TestRuntimeTypes.py
lldb/test/API/lang/objc/objc-new-syntax/TestObjCNewSyntaxLiteral.py
lldb/test/API/lang/objc/real-definition/TestRealDefinition.py
lldb/test/API/sanity/TestSettingSkipping.py
Removed:
################################################################################
diff --git a/lldb/packages/Python/lldbsuite/test/configuration.py b/lldb/packages/Python/lldbsuite/test/configuration.py
index 5133dedbe8524..2a8d125f2ee94 100644
--- a/lldb/packages/Python/lldbsuite/test/configuration.py
+++ b/lldb/packages/Python/lldbsuite/test/configuration.py
@@ -51,8 +51,7 @@
dwarf_version = 0
# Any overridden settings.
-# Always disable default dynamic types for testing purposes.
-settings = [('target.prefer-dynamic-value', 'no-dynamic-values')]
+settings = []
# Path to the FileCheck testing tool. Not optional.
filecheck = None
diff --git a/lldb/test/API/commands/expression/po_verbosity/TestPoVerbosity.py b/lldb/test/API/commands/expression/po_verbosity/TestPoVerbosity.py
index a9131360fef6e..9d143ec546c9d 100644
--- a/lldb/test/API/commands/expression/po_verbosity/TestPoVerbosity.py
+++ b/lldb/test/API/commands/expression/po_verbosity/TestPoVerbosity.py
@@ -41,6 +41,8 @@ def cleanup():
self.runCmd("run", RUN_SUCCEEDED)
+ self.runCmd("settings set target.prefer-dynamic-value no-dynamic-values")
+
self.expect("expr -O -v -- foo",
substrs=['(id) $', ' = 0x', '1 = 2', '2 = 3;'])
self.expect("expr -O -vfull -- foo",
diff --git a/lldb/test/API/commands/expression/two-files/TestObjCTypeQueryFromOtherCompileUnit.py b/lldb/test/API/commands/expression/two-files/TestObjCTypeQueryFromOtherCompileUnit.py
index a40eb120759eb..044c5324d9013 100644
--- a/lldb/test/API/commands/expression/two-files/TestObjCTypeQueryFromOtherCompileUnit.py
+++ b/lldb/test/API/commands/expression/two-files/TestObjCTypeQueryFromOtherCompileUnit.py
@@ -32,6 +32,8 @@ def test(self):
self.runCmd("run", RUN_SUCCEEDED)
+ self.runCmd("settings set target.prefer-dynamic-value no-dynamic-values")
+
# Now do a NSArry type query from the 'main.m' compile uint.
self.expect("expression (NSArray*)array_token",
substrs=['(NSArray *) $0 = 0x'])
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCCF.py b/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCCF.py
index 63ba59808880f..44b313e3aa28a 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCCF.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCCF.py
@@ -27,6 +27,8 @@ def test_coreframeworks_and_run_command(self):
STOPPED_DUE_TO_BREAKPOINT,
substrs=['stopped', 'stop reason = breakpoint'])
+ self.runCmd('settings set target.prefer-dynamic-value no-dynamic-values')
+
# check formatters for common Objective-C types
expect_strings = [
'(CFGregorianUnits) cf_greg_units = 1 years, 3 months, 5 days, 12 hours, 5 minutes 7 seconds',
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCExpr.py b/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCExpr.py
index 91a4567d86e49..70da09e0388c4 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCExpr.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCExpr.py
@@ -27,6 +27,8 @@ def test_expr_with_run_command(self):
STOPPED_DUE_TO_BREAKPOINT,
substrs=['stopped', 'stop reason = breakpoint'])
+ self.runCmd('settings set target.prefer-dynamic-value no-dynamic-values')
+
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
def cleanup():
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCKVO.py b/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCKVO.py
index f0b171636c7aa..0768534ddef67 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCKVO.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCKVO.py
@@ -21,6 +21,8 @@ def test_kvo_with_run_command(self):
self, '// Set break point at this line.',
lldb.SBFileSpec('main.m', False))
+ self.runCmd('settings set target.prefer-dynamic-value no-dynamic-values')
+
# The stop reason of the thread should be breakpoint.
self.expect(
"thread list",
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSContainer.py b/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSContainer.py
index 375aefe36422c..20f464adc7ccb 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSContainer.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSContainer.py
@@ -19,6 +19,8 @@ def test_nscontainers_with_run_command(self):
self.appkit_tester_impl(self.nscontainers_data_formatter_commands, False)
def nscontainers_data_formatter_commands(self):
+ self.runCmd('settings set target.prefer-dynamic-value no-dynamic-values')
+
self.expect(
'frame variable newArray nsDictionary newDictionary nscfDictionary cfDictionaryRef newMutableDictionary copyDictionary newMutableDictionaryRef cfarray_ref mutable_array_ref',
substrs=[
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSData.py b/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSData.py
index 846e1d9bb69a9..cf3ffeaab102b 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSData.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSData.py
@@ -24,6 +24,8 @@ def test_nsdata_with_run_command_no_const(self):
self.appkit_tester_impl(self.nsdata_data_formatter_commands, False)
def nsdata_data_formatter_commands(self):
+ self.runCmd('settings set target.prefer-dynamic-value no-dynamic-values')
+
self.expect(
'frame variable immutableData mutableData data_ref mutable_data_ref mutable_string_ref concreteData concreteMutableData',
substrs=[
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSNumber.py b/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSNumber.py
index beabb23d4ffef..4d90020861b21 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSNumber.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSNumber.py
@@ -24,6 +24,8 @@ def test_nsnumber_with_run_command_no_const(self):
self.appkit_tester_impl(self.nscontainers_data_formatter_commands, False)
def nscontainers_data_formatter_commands(self):
+ self.runCmd('settings set target.prefer-dynamic-value no-dynamic-values')
+
self.expect(
'frame variable newArray nsDictionary newDictionary nscfDictionary cfDictionaryRef newMutableDictionary cfarray_ref mutable_array_ref',
substrs=[
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py b/lldb/test/API/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py
index 64ba72cc39cbf..8a5bfee12f04d 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py
@@ -22,6 +22,8 @@ def appkit_tester_impl(self, commands):
self.runCmd("run", RUN_SUCCEEDED)
+ self.runCmd("settings set target.prefer-dynamic-value no-dynamic-values")
+
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
substrs=['stopped',
diff --git a/lldb/test/API/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py b/lldb/test/API/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py
index 15ad88f749a89..41c1d1a2a9b00 100644
--- a/lldb/test/API/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py
+++ b/lldb/test/API/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py
@@ -74,7 +74,7 @@ def cleanup():
substrs=[
'@"0 elements"'])
self.expect(
- 'frame variable arr --ptr-depth 1 -d no-run-target',
+ 'frame variable arr --ptr-depth 1',
substrs=[
'@"6 elements"',
'@"hello"',
@@ -84,14 +84,14 @@ def cleanup():
'@"me"',
'@"http://www.apple.com'])
self.expect(
- 'frame variable other_arr --ptr-depth 1 -d no-run-target',
+ 'frame variable other_arr --ptr-depth 1',
substrs=[
'@"4 elements"',
'(int)5',
'@"a string"',
'@"6 elements"'])
self.expect(
- 'frame variable other_arr --ptr-depth 2 -d no-run-target',
+ 'frame variable other_arr --ptr-depth 2',
substrs=[
'@"4 elements"',
'@"6 elements" {',
diff --git a/lldb/test/API/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py b/lldb/test/API/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
index fc6755f43ba71..9e6077263a594 100644
--- a/lldb/test/API/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
+++ b/lldb/test/API/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
@@ -86,7 +86,7 @@ def cleanup():
'[2] = ',
'[3] = '])
self.expect(
- 'frame variable dictionary --ptr-depth 1 --dynamic-type no-run-target',
+ 'frame variable dictionary --ptr-depth 1',
substrs=[
'3 key/value pairs',
'@"bar"',
@@ -94,7 +94,7 @@ def cleanup():
'@"baz"',
'2 key/value pairs'])
self.expect(
- 'frame variable mutabledict --ptr-depth 1 --dynamic-type no-run-target',
+ 'frame variable mutabledict --ptr-depth 1',
substrs=[
'4 key/value pairs',
'(int)23',
@@ -103,7 +103,7 @@ def cleanup():
'@"sourceofstuff"',
'3 key/value pairs'])
self.expect(
- 'frame variable mutabledict --ptr-depth 2 --dynamic-type no-run-target',
+ 'frame variable mutabledict --ptr-depth 2',
substrs=[
'4 key/value pairs',
'(int)23',
@@ -114,7 +114,7 @@ def cleanup():
'@"bar"',
'@"2 elements"'])
self.expect(
- 'frame variable mutabledict --ptr-depth 3 --dynamic-type no-run-target',
+ 'frame variable mutabledict --ptr-depth 3',
substrs=[
'4 key/value pairs',
'(int)23',
diff --git a/lldb/test/API/lang/cpp/diamond/TestCppDiamond.py b/lldb/test/API/lang/cpp/diamond/TestCppDiamond.py
index 811612bfcac4a..18933aaa6004a 100644
--- a/lldb/test/API/lang/cpp/diamond/TestCppDiamond.py
+++ b/lldb/test/API/lang/cpp/diamond/TestCppDiamond.py
@@ -19,6 +19,8 @@ def test_with_sbvalue(self):
self.build()
lldbutil.run_to_source_breakpoint(self, "// breakpoint 1", lldb.SBFileSpec("main.cpp"))
+ self.runCmd("settings set target.prefer-dynamic-value no-dynamic-values")
+
j1 = self.frame().FindVariable("j1")
j1_Derived1 = j1.GetChildAtIndex(0)
j1_Derived2 = j1.GetChildAtIndex(1)
diff --git a/lldb/test/API/lang/objc/blocks/TestObjCIvarsInBlocks.py b/lldb/test/API/lang/objc/blocks/TestObjCIvarsInBlocks.py
index 2c1ea723e5618..7a46138dca5de 100644
--- a/lldb/test/API/lang/objc/blocks/TestObjCIvarsInBlocks.py
+++ b/lldb/test/API/lang/objc/blocks/TestObjCIvarsInBlocks.py
@@ -44,6 +44,8 @@ def test_with_python_api(self):
process.GetState(), lldb.eStateStopped,
"Stopped it too.")
+ self.runCmd('settings set target.prefer-dynamic-value no-dynamic-values')
+
thread_list = lldbutil.get_threads_stopped_at_breakpoint(
process, breakpoint)
self.assertEqual(len(thread_list), 1)
diff --git a/lldb/test/API/lang/objc/exceptions/TestObjCExceptions.py b/lldb/test/API/lang/objc/exceptions/TestObjCExceptions.py
index 54473e03bb36e..663ab11ddfd56 100644
--- a/lldb/test/API/lang/objc/exceptions/TestObjCExceptions.py
+++ b/lldb/test/API/lang/objc/exceptions/TestObjCExceptions.py
@@ -64,7 +64,7 @@ def test_objc_exceptions_at_throw(self):
])
self.expect(
- 'frame variable --dynamic-type no-run-target *e1',
+ 'frame variable *e1',
substrs=[
'(NSException) *e1 = ',
'name = ', '"ExceptionName"',
@@ -93,7 +93,7 @@ def test_objc_exceptions_at_throw(self):
])
self.expect(
- 'frame variable --dynamic-type no-run-target *e2',
+ 'frame variable *e2',
substrs=[
'(NSException) *e2 = ',
'name = ', '"ThrownException"',
diff --git a/lldb/test/API/lang/objc/foundation/TestObjCMethods.py b/lldb/test/API/lang/objc/foundation/TestObjCMethods.py
index 3a61c7db87335..556efc50c01d2 100644
--- a/lldb/test/API/lang/objc/foundation/TestObjCMethods.py
+++ b/lldb/test/API/lang/objc/foundation/TestObjCMethods.py
@@ -124,6 +124,8 @@ def test_data_type_and_expr(self):
self.runCmd("run", RUN_SUCCEEDED)
+ self.runCmd("settings set target.prefer-dynamic-value no-dynamic-values")
+
# The backtrace should show we stop at -[MyString description].
self.expect("thread backtrace", "Stop at -[MyString description]",
substrs=["a.out`-[MyString description]"])
diff --git a/lldb/test/API/lang/objc/foundation/TestObjCMethodsString.py b/lldb/test/API/lang/objc/foundation/TestObjCMethodsString.py
index 9760d6ab5b8c7..2f3ffda892ca2 100644
--- a/lldb/test/API/lang/objc/foundation/TestObjCMethodsString.py
+++ b/lldb/test/API/lang/objc/foundation/TestObjCMethodsString.py
@@ -19,6 +19,8 @@ def test_NSString_expr_commands(self):
self, '// Break here for NSString tests',
lldb.SBFileSpec('main.m', False))
+ self.runCmd("settings set target.prefer-dynamic-value no-dynamic-values")
+
# Test_NSString:
self.runCmd("thread backtrace")
self.expect("expression (int)[str length]",
diff --git a/lldb/test/API/lang/objc/foundation/TestRuntimeTypes.py b/lldb/test/API/lang/objc/foundation/TestRuntimeTypes.py
index c2e9c6b16adc8..00bd44ab6fc7e 100644
--- a/lldb/test/API/lang/objc/foundation/TestRuntimeTypes.py
+++ b/lldb/test/API/lang/objc/foundation/TestRuntimeTypes.py
@@ -31,6 +31,8 @@ def test_break(self):
self.runCmd("run", RUN_SUCCEEDED)
+ self.runCmd("settings set target.prefer-dynamic-value no-dynamic-values")
+
# The backtrace should show we stop at -[MyString description].
self.expect("thread backtrace", "Stop at -[MyString description]",
substrs=["a.out`-[MyString description]"])
diff --git a/lldb/test/API/lang/objc/objc-new-syntax/TestObjCNewSyntaxLiteral.py b/lldb/test/API/lang/objc/objc-new-syntax/TestObjCNewSyntaxLiteral.py
index c67239d8d7b83..5732730172873 100644
--- a/lldb/test/API/lang/objc/objc-new-syntax/TestObjCNewSyntaxLiteral.py
+++ b/lldb/test/API/lang/objc/objc-new-syntax/TestObjCNewSyntaxLiteral.py
@@ -54,6 +54,8 @@ def test_integer_literals(self):
def test_float_literal(self):
self.runToBreakpoint()
+ self.runCmd("settings set target.prefer-dynamic-value no-dynamic-values")
+
self.expect("expr -- @123.45", VARIABLES_DISPLAYED_CORRECTLY,
substrs=["NSNumber", "123.45"])
@@ -62,6 +64,8 @@ def test_float_literal(self):
def test_expressions_in_literals(self):
self.runToBreakpoint()
+ self.runCmd("settings set target.prefer-dynamic-value no-dynamic-values")
+
self.expect(
"expr --object-description -- @( 1 + 3 )",
VARIABLES_DISPLAYED_CORRECTLY,
diff --git a/lldb/test/API/lang/objc/real-definition/TestRealDefinition.py b/lldb/test/API/lang/objc/real-definition/TestRealDefinition.py
index c182bc12ef20e..5f094e8e649c1 100644
--- a/lldb/test/API/lang/objc/real-definition/TestRealDefinition.py
+++ b/lldb/test/API/lang/objc/real-definition/TestRealDefinition.py
@@ -28,6 +28,8 @@ def test_frame_var_after_stop_at_interface(self):
# Run at stop at main
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
+ self.runCmd("settings set target.prefer-dynamic-value no-dynamic-values")
+
# This should display correctly.
self.expect(
"frame variable foo->_bar->_hidden_ivar",
@@ -53,6 +55,8 @@ def test_frame_var_after_stop_at_implementation(self):
# Run at stop at main
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
+ self.runCmd("settings set target.prefer-dynamic-value no-dynamic-values")
+
# This should display correctly.
self.expect(
"frame variable foo->_bar->_hidden_ivar",
diff --git a/lldb/test/API/sanity/TestSettingSkipping.py b/lldb/test/API/sanity/TestSettingSkipping.py
index 4e05446d0276d..0b44cc30e77ae 100644
--- a/lldb/test/API/sanity/TestSettingSkipping.py
+++ b/lldb/test/API/sanity/TestSettingSkipping.py
@@ -12,12 +12,12 @@ class SettingSkipSanityTestCase(TestBase):
NO_DEBUG_INFO_TESTCASE = True
- @skipIf(setting=('target.prefer-dynamic-value', 'no-dynamic-values'))
+ @skipIf(py_version=('>=', (3, 0)))
def testSkip(self):
"""This setting is on by default"""
self.assertTrue(False, "This test should not run!")
- @skipIf(setting=('target.prefer-dynamic-value', 'run-target'))
+ @skipIf(py_version=('<', (3, 0)))
def testNoMatch(self):
self.assertTrue(True, "This test should run!")
@@ -25,11 +25,11 @@ def testNoMatch(self):
def testNotExisting(self):
self.assertTrue(True, "This test should run!")
- @expectedFailureAll(setting=('target.prefer-dynamic-value', 'no-dynamic-values'))
+ @expectedFailureAll(py_version=('>=', (3, 0)))
def testXFAIL(self):
self.assertTrue(False, "This test should run and fail!")
- @expectedFailureAll(setting=('target.prefer-dynamic-value', 'run-target'))
+ @expectedFailureAll(py_version=('<', (3, 0)))
def testNotXFAIL(self):
self.assertTrue(True, "This test should run and succeed!")
More information about the lldb-commits
mailing list