[Lldb-commits] [lldb] SBThread::StepInstruction shouldn't discard other plans (PR #97493)
via lldb-commits
lldb-commits at lists.llvm.org
Tue Jul 2 17:20:12 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {darker}-->
:warning: Python code formatter, darker found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
darker --check --diff -r 57555c6a0a96790bf1408b056405abe07899ead4...3fba16eaee25b1d63907640b79019309e9c019a7 lldb/test/API/python_api/thread/TestThreadAPI.py
``````````
</details>
<details>
<summary>
View the diff from darker here.
</summary>
``````````diff
--- TestThreadAPI.py 2024-07-02 23:42:00.000000 +0000
+++ TestThreadAPI.py 2024-07-03 00:19:47.133473 +0000
@@ -309,25 +309,48 @@
for pos, neg in zip(pos_range, neg_range):
self.assertEqual(thread.frame[pos].idx, thread.frame[-neg].idx)
def step_instruction_in_called_function(self):
main_file_spec = lldb.SBFileSpec("main.cpp")
- target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(self, "Set break point at this line", main_file_spec)
+ target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(
+ self, "Set break point at this line", main_file_spec
+ )
options = lldb.SBExpressionOptions()
options.SetIgnoreBreakpoints(False)
- call_me_bkpt = target.BreakpointCreateBySourceRegex("Set a breakpoint in call_me",
- main_file_spec)
- self.assertGreater(call_me_bkpt.GetNumLocations(), 0, "Got at least one location in call_me")
+ call_me_bkpt = target.BreakpointCreateBySourceRegex(
+ "Set a breakpoint in call_me", main_file_spec
+ )
+ self.assertGreater(
+ call_me_bkpt.GetNumLocations(), 0, "Got at least one location in call_me"
+ )
# Now run the expression, this will fail because we stopped at a breakpoint:
- self.runCmd('expr -i 0 -- call_me(true)', check=False)
+ self.runCmd("expr -i 0 -- call_me(true)", check=False)
# Now we should be stopped in call_me:
- self.assertEqual(thread.frames[0].name, "call_me(bool)", "Stopped in call_me(bool)")
+ self.assertEqual(
+ thread.frames[0].name, "call_me(bool)", "Stopped in call_me(bool)"
+ )
# Now do a various API steps. These should not cause the expression context to get unshipped:
thread.StepInstruction(False)
- self.assertEqual(thread.frames[0].name, "call_me(bool)", "Still in call_me(bool) after StepInstruction")
+ self.assertEqual(
+ thread.frames[0].name,
+ "call_me(bool)",
+ "Still in call_me(bool) after StepInstruction",
+ )
thread.StepInstruction(True)
- self.assertEqual(thread.frames[0].name, "call_me(bool)", "Still in call_me(bool) after NextInstruction")
+ self.assertEqual(
+ thread.frames[0].name,
+ "call_me(bool)",
+ "Still in call_me(bool) after NextInstruction",
+ )
thread.StepInto()
- self.assertEqual(thread.frames[0].name, "call_me(bool)", "Still in call_me(bool) after StepInto")
+ self.assertEqual(
+ thread.frames[0].name,
+ "call_me(bool)",
+ "Still in call_me(bool) after StepInto",
+ )
thread.StepOver(False)
- self.assertEqual(thread.frames[0].name, "call_me(bool)", "Still in call_me(bool) after StepOver")
+ self.assertEqual(
+ thread.frames[0].name,
+ "call_me(bool)",
+ "Still in call_me(bool) after StepOver",
+ )
``````````
</details>
https://github.com/llvm/llvm-project/pull/97493
More information about the lldb-commits
mailing list