@@ -19,6 +19,11 @@ def should_stop(self, event):
19
19
def should_step (self ):
20
20
return False
21
21
22
+ def stop_description (self , stream ):
23
+ if self .child_thread_plan .IsPlanComplete ():
24
+ return self .child_thread_plan .GetDescription (stream )
25
+ return True
26
+
22
27
def queue_child_thread_plan (self ):
23
28
return None
24
29
@@ -39,19 +44,18 @@ def queue_child_thread_plan(self):
39
44
# This plan does a step-over until a variable changes value.
40
45
class StepUntil (StepWithChild ):
41
46
def __init__ (self , thread_plan , args_data , dict ):
47
+ self .thread_plan = thread_plan
42
48
self .frame = thread_plan .GetThread ().frames [0 ]
43
49
self .target = thread_plan .GetThread ().GetProcess ().GetTarget ()
44
- func_entry = args_data .GetValueForKey ("variable_name" )
50
+ var_entry = args_data .GetValueForKey ("variable_name" )
45
51
46
- if not func_entry .IsValid ():
52
+ if not var_entry .IsValid ():
47
53
print ("Did not get a valid entry for variable_name" )
48
- func_name = func_entry .GetStringValue (100 )
54
+ self . var_name = var_entry .GetStringValue (100 )
49
55
50
- self .value = self .frame .FindVariable (func_name )
56
+ self .value = self .frame .FindVariable (self . var_name )
51
57
if self .value .GetError ().Fail ():
52
58
print ("Failed to get foo value: %s" % (self .value .GetError ().GetCString ()))
53
- else :
54
- print ("'foo' value: %d" % (self .value .GetValueAsUnsigned ()))
55
59
56
60
StepWithChild .__init__ (self , thread_plan )
57
61
@@ -70,17 +74,23 @@ def should_stop(self, event):
70
74
71
75
# If we've stepped out of this frame, stop.
72
76
if not self .frame .IsValid ():
77
+ self .thread_plan .SetPlanComplete (True )
73
78
return True
74
79
75
80
if not self .value .IsValid ():
81
+ self .thread_plan .SetPlanComplete (True )
76
82
return True
77
83
78
84
if not self .value .GetValueDidChange ():
79
85
self .child_thread_plan = self .queue_child_thread_plan ()
80
86
return False
81
87
else :
88
+ self .thread_plan .SetPlanComplete (True )
82
89
return True
83
90
91
+ def stop_description (self , stream ):
92
+ stream .Print (f"Stepped until { self .var_name } changed." )
93
+
84
94
# This plan does nothing, but sets stop_mode to the
85
95
# value of GetStopOthers for this plan.
86
96
class StepReportsStopOthers ():
@@ -92,7 +102,6 @@ def __init__(self, thread_plan, args_data, dict):
92
102
93
103
def should_stop (self , event ):
94
104
self .thread_plan .SetPlanComplete (True )
95
- print ("Called in should_stop" )
96
105
StepReportsStopOthers .stop_mode_dict [self .key ] = self .thread_plan .GetStopOthers ()
97
106
return True
98
107
0 commit comments