[Lldb-commits] [lldb] r334921 - Fix the 'tb' alias command
Frederic Riss via lldb-commits
lldb-commits at lists.llvm.org
Sun Jun 17 21:34:33 PDT 2018
Author: friss
Date: Sun Jun 17 21:34:33 2018
New Revision: 334921
URL: http://llvm.org/viewvc/llvm-project?rev=334921&view=rev
Log:
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.
Modified:
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py
lldb/trunk/source/Interpreter/CommandInterpreter.cpp
Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py?rev=334921&r1=334920&r2=334921&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py Sun Jun 17 21:34:33 2018
@@ -22,6 +22,31 @@ class BreakpointHitCountTestCase(TestBas
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)
Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=334921&r1=334920&r2=334921&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Sun Jun 17 21:34:33 2018
@@ -543,7 +543,7 @@ void CommandInterpreter::LoadCommandDict
// sure to increase the size of this buffer.
char buffer[1024];
int num_printed =
- snprintf(buffer, 1024, "%s %s", break_regexes[i][1], "-o");
+ snprintf(buffer, 1024, "%s %s", break_regexes[i][1], "-o 1");
lldbassert(num_printed < 1024);
UNUSED_IF_ASSERT_DISABLED(num_printed);
success =
More information about the lldb-commits
mailing list