summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/functionalities/frame-recognizer/TestFrameRecognizer.py
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@gmail.com>2019-09-01 09:12:37 +0000
committerRaphael Isemann <teemperor@gmail.com>2019-09-01 09:12:37 +0000
commit29872606d220420d53fde7cc5e3bea15f8da62e7 (patch)
tree47d7a82ccea48a6dd10a2d8ecb6b3c3127724131 /lldb/packages/Python/lldbsuite/test/functionalities/frame-recognizer/TestFrameRecognizer.py
parentadfdcb9c2652aeee585b9005fd6c67be06af8ea9 (diff)
downloadbcm5719-llvm-29872606d220420d53fde7cc5e3bea15f8da62e7.tar.gz
bcm5719-llvm-29872606d220420d53fde7cc5e3bea15f8da62e7.zip
[lldb] Restructure test folders to match LLDB command hierarchy
Summary: As discussed on lldb-dev, this patch moves some LLDB tests into a hierarchy that more closely resembles the commands we use in the LLDB interpreter. This patch should only move tests that use the command interpreter and shouldn't touch any tests that primarily test the SB API. Reviewers: #lldb, jfb, JDevlieghere Reviewed By: #lldb, JDevlieghere Subscribers: dexonsmith, arphaman, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D67033 llvm-svn: 370605
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/functionalities/frame-recognizer/TestFrameRecognizer.py')
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/frame-recognizer/TestFrameRecognizer.py119
1 files changed, 0 insertions, 119 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/frame-recognizer/TestFrameRecognizer.py b/lldb/packages/Python/lldbsuite/test/functionalities/frame-recognizer/TestFrameRecognizer.py
deleted file mode 100644
index 2ecbe1e4c15..00000000000
--- a/lldb/packages/Python/lldbsuite/test/functionalities/frame-recognizer/TestFrameRecognizer.py
+++ /dev/null
@@ -1,119 +0,0 @@
-# encoding: utf-8
-"""
-Test lldb's frame recognizers.
-"""
-
-import lldb
-from lldbsuite.test.decorators import *
-from lldbsuite.test.lldbtest import *
-from lldbsuite.test import lldbutil
-
-import recognizer
-
-class FrameRecognizerTestCase(TestBase):
-
- mydir = TestBase.compute_mydir(__file__)
- NO_DEBUG_INFO_TESTCASE = True
-
- @skipUnlessDarwin
- def test_frame_recognizer_1(self):
- self.build()
-
- target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
- self.assertTrue(target, VALID_TARGET)
-
- self.runCmd("command script import " + os.path.join(self.getSourceDir(), "recognizer.py"))
-
- self.expect("frame recognizer list",
- substrs=['no matching results found.'])
-
- self.runCmd("frame recognizer add -l recognizer.MyFrameRecognizer -s a.out -n foo")
-
- self.expect("frame recognizer list",
- substrs=['0: recognizer.MyFrameRecognizer, module a.out, function foo'])
-
- self.runCmd("frame recognizer add -l recognizer.MyOtherFrameRecognizer -s a.out -n bar -x")
-
- self.expect("frame recognizer list",
- substrs=['0: recognizer.MyFrameRecognizer, module a.out, function foo',
- '1: recognizer.MyOtherFrameRecognizer, module a.out, function bar (regexp)'
- ])
-
- self.runCmd("frame recognizer delete 0")
-
- self.expect("frame recognizer list",
- substrs=['1: recognizer.MyOtherFrameRecognizer, module a.out, function bar (regexp)'])
-
- self.runCmd("frame recognizer clear")
-
- self.expect("frame recognizer list",
- substrs=['no matching results found.'])
-
- self.runCmd("frame recognizer add -l recognizer.MyFrameRecognizer -s a.out -n foo")
-
- lldbutil.run_break_set_by_symbol(self, "foo")
- self.runCmd("r")
-
- self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs=['stopped', 'stop reason = breakpoint'])
-
- process = target.GetProcess()
- thread = process.GetSelectedThread()
- frame = thread.GetSelectedFrame()
-
- self.assertEqual(frame.GetSymbol().GetName(), "foo")
- self.assertFalse(frame.GetLineEntry().IsValid())
-
- self.expect("frame variable",
- substrs=['(int) a = 42', '(int) b = 56'])
-
- # 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")
- self.assertEqual(variables.GetValueAtIndex(0).signed, 42)
- self.assertEqual(variables.GetValueAtIndex(0).GetValueType(), lldb.eValueTypeVariableArgument)
- self.assertEqual(variables.GetValueAtIndex(1).name, "b")
- self.assertEqual(variables.GetValueAtIndex(1).signed, 56)
- self.assertEqual(variables.GetValueAtIndex(1).GetValueType(), lldb.eValueTypeVariableArgument)
-
- self.expect("frame recognizer info 0",
- substrs=['frame 0 is recognized by recognizer.MyFrameRecognizer'])
-
- self.expect("frame recognizer info 999", error=True,
- substrs=['no frame with index 999'])
-
- self.expect("frame recognizer info 1",
- substrs=['frame 1 not recognized by any recognizer'])
-
- # FIXME: The following doesn't work yet, but should be fixed.
- """
- lldbutil.run_break_set_by_symbol(self, "bar")
- self.runCmd("c")
-
- self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs=['stopped', 'stop reason = breakpoint'])
-
- self.expect("frame variable -t",
- substrs=['(int *) a = '])
-
- self.expect("frame variable -t *a",
- substrs=['*a = 78'])
- """
OpenPOWER on IntegriCloud