================
@@ -44,6 +44,34 @@ def step_out_with_scripted_plan(self, name):
         stop_desc = thread.GetStopDescription(1000)
         self.assertIn("Stepping out from", stop_desc, "Got right description")
 
+    def test_step_single_instruction(self):
+        self.build()
+        (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(
+            self, "Break on foo call", self.main_source_file
+        )
+
+        err = thread.StepUsingScriptedThreadPlan("Steps.StepSingleInstruction")
+        self.assertSuccess(err)
+
+        # Verify that stepping a single instruction after "foo();" steps into 
`foo`
+        frame = thread.GetFrameAtIndex(0)
+        self.assertEqual("foo", frame.GetFunctionName())
----------------
jimingham wrote:

In the case of step-i, we are really trying to assert that we step just one 
instruction.  That's actually not all that hard to test exactly.  Just add some 
simple arithmetic computation to the test, so it won't have branches, and then 
stop at the beginning of the computation, run your step-i plan, and assert that 
you did get to the NEXT instruction on the instruction list.

https://github.com/llvm/llvm-project/pull/137904
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to