[Lldb-commits] [PATCH] D149692: Allow scripted thread plans to modify the stop reason shown when the plan completes

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue May 2 13:58:45 PDT 2023


jingham created this revision.
jingham added reviewers: JDevlieghere, delcypher, mib.
Herald added a project: All.
jingham requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

We were just printing some fairly ugly boiler plate, for instance:

(lldb) thread step-scripted -C scripted_step.SimpleStep
Process 15467 stopped

- thread #1, queue = 'com.apple.main-thread', stop reason = Python thread plan implemented by class scripted_step.SimpleStep.

This change allows the scripted ThreadPlan to implement:

  def stop_description(self, stream):
      stream.Print("Simple step completed")

and then you will see:

(lldb) thread step-scripted -C scripted_step.SimpleStep
Process 15226 stopped

- thread #1, queue = 'com.apple.main-thread', stop reason = Simple step completed


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D149692

Files:
  lldb/bindings/python/python-wrapper.swig
  lldb/examples/python/scripted_step.py
  lldb/include/lldb/Interpreter/ScriptInterpreter.h
  lldb/include/lldb/Target/ThreadPlanPython.h
  lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h
  lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
  lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
  lldb/source/Target/ThreadPlanPython.cpp
  lldb/test/API/functionalities/step_scripted/Steps.py
  lldb/test/API/functionalities/step_scripted/TestStepScripted.py
  lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149692.518854.patch
Type: text/x-patch
Size: 16193 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230502/ea3a85ab/attachment-0001.bin>


More information about the lldb-commits mailing list