annotate lldb/examples/python/step_and_print.py @ 227:21e6aa2e49ef

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 19 Jul 2021 06:57:16 +0900
parents 1d019706d866
children 1f2b6ac9f198
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 """ Does a step-over then prints the local variables or only the ones passed in """
anatofuz
parents:
diff changeset
2 import lldb
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 class StepAndPrint:
anatofuz
parents:
diff changeset
5 def __init__(self, debugger, unused):
anatofuz
parents:
diff changeset
6 return
anatofuz
parents:
diff changeset
7
anatofuz
parents:
diff changeset
8 def __call__(self, debugger, command, exe_ctx, result):
anatofuz
parents:
diff changeset
9 # Set the command to synchronous so the step will complete
anatofuz
parents:
diff changeset
10 # before we try to run the frame variable.
anatofuz
parents:
diff changeset
11 old_async = debugger.GetAsync()
anatofuz
parents:
diff changeset
12 debugger.SetAsync(False)
anatofuz
parents:
diff changeset
13
anatofuz
parents:
diff changeset
14 debugger.HandleCommand("thread step-over")
anatofuz
parents:
diff changeset
15 print("---------- Values: -------------------\n")
anatofuz
parents:
diff changeset
16 debugger.HandleCommand("frame variable %s"%(command))
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 debugger.SetAsync(old_async)
anatofuz
parents:
diff changeset
19
anatofuz
parents:
diff changeset
20 def get_short_help(self):
anatofuz
parents:
diff changeset
21 return "Does a step-over then runs frame variable passing the command args to it\n"
anatofuz
parents:
diff changeset
22
anatofuz
parents:
diff changeset
23 def __lldb_init_module(debugger, unused):
anatofuz
parents:
diff changeset
24 debugger.HandleCommand("command script add -c step_and_print.StepAndPrint sap")