1*a6976269SJim Ingham""" Does a step-over then prints the local variables or only the ones passed in """
2*a6976269SJim Inghamimport lldb
3*a6976269SJim Ingham
4*a6976269SJim Inghamclass StepAndPrint:
5*a6976269SJim Ingham    def __init__(self, debugger, unused):
6*a6976269SJim Ingham        return
7*a6976269SJim Ingham
8*a6976269SJim Ingham    def __call__(self, debugger, command, exe_ctx, result):
9*a6976269SJim Ingham        # Set the command to synchronous so the step will complete
10*a6976269SJim Ingham        # before we try to run the frame variable.
11*a6976269SJim Ingham        old_async = debugger.GetAsync()
12*a6976269SJim Ingham        debugger.SetAsync(False)
13*a6976269SJim Ingham
14*a6976269SJim Ingham        debugger.HandleCommand("thread step-over")
15*a6976269SJim Ingham        print("---------- Values: -------------------\n")
16*a6976269SJim Ingham        debugger.HandleCommand("frame variable %s"%(command))
17*a6976269SJim Ingham
18*a6976269SJim Ingham        debugger.SetAsync(old_async)
19*a6976269SJim Ingham
20*a6976269SJim Ingham    def get_short_help(self):
21*a6976269SJim Ingham        return "Does a step-over then runs frame variable passing the command args to it\n"
22*a6976269SJim Ingham
23*a6976269SJim Inghamdef __lldb_init_module(debugger, unused):
24*a6976269SJim Ingham    debugger.HandleCommand("command script add -c step_and_print.StepAndPrint sap")
25