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.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@334921 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py
index e1281e6..c56807a 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py
@@ -22,6 +22,31 @@
         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)
diff --git a/source/Interpreter/CommandInterpreter.cpp b/source/Interpreter/CommandInterpreter.cpp
index bb8da85..cb31a4a 100644
--- a/source/Interpreter/CommandInterpreter.cpp
+++ b/source/Interpreter/CommandInterpreter.cpp
@@ -543,7 +543,7 @@
       // 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 =