summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint
diff options
context:
space:
mode:
authorFrederic Riss <friss@apple.com>2018-06-18 04:34:33 +0000
committerFrederic Riss <friss@apple.com>2018-06-18 04:34:33 +0000
commit49c9d8b84918f654681cdb3b5a0be91bc66e412b (patch)
tree02cc1673a3a849b67caa75d0ecc66f04092414eb /lldb/packages/Python/lldbsuite/test/functionalities/breakpoint
parent916d0cf64972f2889322b271fa26c9102c66f72a (diff)
downloadbcm5719-llvm-49c9d8b84918f654681cdb3b5a0be91bc66e412b.tar.gz
bcm5719-llvm-49c9d8b84918f654681cdb3b5a0be91bc66e412b.zip
Fix the 'tb' alias command
No idea when this broke or if it ever worked. Added a small test for one-shot breakpoints while I was there. llvm-svn: 334921
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/functionalities/breakpoint')
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py
index e1281e63761..c56807af11f 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py
@@ -22,6 +22,31 @@ class BreakpointHitCountTestCase(TestBase):
self.build()
self.do_test_breakpoint_location_hit_count()
+ def test_breakpoint_one_shot(self):
+ """Check that one-shot breakpoints trigger only once."""
+ self.build()
+
+ exe = self.getBuildArtifact("a.out")
+ target = self.dbg.CreateTarget(exe)
+ self.assertTrue(target, VALID_TARGET)
+
+ self.runCmd("tb a")
+ process = target.LaunchSimple(
+ None, None, self.get_process_working_directory())
+ self.assertTrue(process, PROCESS_IS_VALID)
+
+ from lldbsuite.test.lldbutil import get_stopped_thread
+ thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
+ self.assertTrue(
+ thread.IsValid(),
+ "There should be a thread stopped due to breakpoint")
+
+ frame0 = thread.GetFrameAtIndex(0)
+ self.assertEqual(frame0.GetFunctionName(), "a(int)");
+
+ process.Continue()
+ self.assertEqual(process.GetState(), lldb.eStateExited)
+
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
OpenPOWER on IntegriCloud