diff options
author | Jim Ingham <jingham@apple.com> | 2019-10-03 22:50:18 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2019-10-03 22:50:18 +0000 |
commit | 27a14f19c810f494adddb8aaff960336ab4492e7 (patch) | |
tree | a7eae222175b77917ee9ccfd1b0f21555d7118f4 /lldb/packages/Python/lldbsuite/test/functionalities/step_scripted/Steps.py | |
parent | 145cdad11925194ec41949b5c8f0cb037f9e7941 (diff) | |
download | bcm5719-llvm-27a14f19c810f494adddb8aaff960336ab4492e7.tar.gz bcm5719-llvm-27a14f19c810f494adddb8aaff960336ab4492e7.zip |
Pass an SBStructuredData to scripted ThreadPlans on use.
This will allow us to write reusable scripted ThreadPlans, since
you can use key/value pairs with known keys in the plan to parametrize
its behavior.
Differential Revision: https://reviews.llvm.org/D68366
llvm-svn: 373675
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/functionalities/step_scripted/Steps.py')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/functionalities/step_scripted/Steps.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/step_scripted/Steps.py b/lldb/packages/Python/lldbsuite/test/functionalities/step_scripted/Steps.py index f93559af736..4133cbbe608 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/step_scripted/Steps.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/step_scripted/Steps.py @@ -38,18 +38,29 @@ class StepScripted(StepWithChild): # This plan does a step-over until a variable changes value. class StepUntil(StepWithChild): - def __init__(self, thread_plan, dict): + def __init__(self, thread_plan, args_data, dict): self.frame = thread_plan.GetThread().frames[0] self.target = thread_plan.GetThread().GetProcess().GetTarget() - self.value = self.frame.FindVariable("foo") + func_entry = args_data.GetValueForKey("variable_name") + + if not func_entry.IsValid(): + print("Did not get a valid entry for variable_name") + func_name = func_entry.GetStringValue(100) + + self.value = self.frame.FindVariable(func_name) + if self.value.GetError().Fail(): + print("Failed to get foo value: %s"%(self.value.GetError().GetCString())) + else: + print("'foo' value: %d"%(self.value.GetValueAsUnsigned())) + StepWithChild.__init__(self, thread_plan) + def queue_child_thread_plan(self): le = self.frame.GetLineEntry() start_addr = le.GetStartAddress() start = start_addr.GetLoadAddress(self.target) end = le.GetEndAddress().GetLoadAddress(self.target) - print("Stepping from 0x%x to 0x%x (0x%x)"%(start, end, end - start)) return self.thread_plan.QueueThreadPlanForStepOverRange(start_addr, end - start) |