From 4c7f5d5c5aeeb4336da0f044ab543d76971068f4 Mon Sep 17 00:00:00 2001 From: Kuba Mracek Date: Thu, 20 Dec 2018 23:38:19 +0000 Subject: [lldb] Add a "display-recognized-arguments" target setting to show recognized arguments by default Differential Revision: https://reviews.llvm.org/D55954 llvm-svn: 349856 --- .../frame-recognizer/TestFrameRecognizer.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'lldb/packages/Python/lldbsuite/test/functionalities/frame-recognizer/TestFrameRecognizer.py') diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/frame-recognizer/TestFrameRecognizer.py b/lldb/packages/Python/lldbsuite/test/functionalities/frame-recognizer/TestFrameRecognizer.py index abd4ae8b382..1162157bad5 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/frame-recognizer/TestFrameRecognizer.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/frame-recognizer/TestFrameRecognizer.py @@ -67,9 +67,24 @@ class FrameRecognizerTestCase(TestBase): self.expect("frame variable", substrs=['(int) a = 42', '(int) b = 56']) - opts = lldb.SBVariablesOptions(); - opts.SetIncludeRecognizedArguments(True); - variables = frame.GetVariables(opts); + # Recognized arguments don't show up by default... + variables = frame.GetVariables(lldb.SBVariablesOptions()) + self.assertEqual(variables.GetSize(), 0) + + # ...unless you set target.display-recognized-arguments to 1... + self.runCmd("settings set target.display-recognized-arguments 1") + variables = frame.GetVariables(lldb.SBVariablesOptions()) + self.assertEqual(variables.GetSize(), 2) + + # ...and you can reset it back to 0 to hide them again... + self.runCmd("settings set target.display-recognized-arguments 0") + variables = frame.GetVariables(lldb.SBVariablesOptions()) + self.assertEqual(variables.GetSize(), 0) + + # ... or explicitly ask for them with SetIncludeRecognizedArguments(True). + opts = lldb.SBVariablesOptions() + opts.SetIncludeRecognizedArguments(True) + variables = frame.GetVariables(opts) self.assertEqual(variables.GetSize(), 2) self.assertEqual(variables.GetValueAtIndex(0).name, "a") -- cgit v1.2.3