[Lldb-commits] [PATCH] D68366: Parametrize scripted ThreadPlans using SBStructuredData
Jim Ingham via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Oct 2 17:58:11 PDT 2019
jingham created this revision.
jingham added reviewers: labath, JDevlieghere, aprantl.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
jingham added a parent revision: D68363: Segregate the Python class + key/value dictionary into a separate OptionGroup.
It is trivial to write a ScriptedThreadPlan to do "step until the variable 'foo' changes value". It is equally easy to write one that does "step until the variable 'bar' changes value". But you would have to write a different Python class for each of these tasks, since there's no way to pass parameters into the ThreadPlan on creation.
This patch adds that ability. You can say:
(lldb) thread step-scripted -C Module.ThreadPlan -k variable_name -v foo
lldb will package the key and value into an SBStructuredData dictionary, and pass that to the __init__ method of the ThreadPlan class. Then the ThreadPlan can fetch the value for that key from the dictionary and watch that variable.
I also added an SB API that allows you to pass any SBStructuredData to SBThread.StepUsingScriptedThreadPlan, if you need to pass in something more complex than a simple key/value dictionary.
This revision depends on:
Not sure who to put on to review this, most of the folks who worked actively on the PythonObjects aren't really active anymore... I added folks who touched some of the relevant files recently...
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 34665 bytes
Desc: not available
More information about the lldb-commits