hiraditya created this revision.
hiraditya added reviewers: xiaobai, clayborg.
Herald added a reviewer: serge-sans-paille.
Herald added a project: LLDB.
Repository:
rLLDB LLDB
https://reviews.llvm.org/D57830
Files:
examples/python/process_events.py
Index: examples/python/process_events.py
===
--- examples/python/process_events.py
+++ examples/python/process_events.py
@@ -184,6 +184,12 @@
help='Specify the timeout in seconds to wait for process state change
events.',
default=lldb.UINT32_MAX)
parser.add_option(
+'-f',
+'--trace-function',
+type='string',
+dest='trace_function',
+help='Trace a function during execution, Warning: tracing is really
slow.')
+parser.add_option(
'-e',
'--environment',
action='append',
@@ -275,6 +281,9 @@
for bp in options.breakpoints:
debugger.HandleCommand("_regexp-break %s" % (bp))
run_commands(command_interpreter, ['breakpoint list'])
+if launch_info and options.trace_function:
+debugger.HandleCommand("_regexp-break &%s" %
(options.trace_function))
+run_commands(command_interpreter, ['breakpoint list'])
for run_idx in range(options.run_count):
# Launch the process. Since we specified synchronous mode, we
won't return
@@ -348,7 +357,10 @@
stop_idx += 1
print_threads(process, options)
print "continuing process %u" % (pid)
-process.Continue()
+if options.trace_function:
+process.GetThreadAtIndex(0).StepInto()
+else:
+process.Continue()
elif state == lldb.eStateExited:
exit_desc = process.GetExitDescription()
if exit_desc:
Index: examples/python/process_events.py
===
--- examples/python/process_events.py
+++ examples/python/process_events.py
@@ -184,6 +184,12 @@
help='Specify the timeout in seconds to wait for process state change events.',
default=lldb.UINT32_MAX)
parser.add_option(
+'-f',
+'--trace-function',
+type='string',
+dest='trace_function',
+help='Trace a function during execution, Warning: tracing is really slow.')
+parser.add_option(
'-e',
'--environment',
action='append',
@@ -275,6 +281,9 @@
for bp in options.breakpoints:
debugger.HandleCommand("_regexp-break %s" % (bp))
run_commands(command_interpreter, ['breakpoint list'])
+if launch_info and options.trace_function:
+debugger.HandleCommand("_regexp-break &%s" % (options.trace_function))
+run_commands(command_interpreter, ['breakpoint list'])
for run_idx in range(options.run_count):
# Launch the process. Since we specified synchronous mode, we won't return
@@ -348,7 +357,10 @@
stop_idx += 1
print_threads(process, options)
print "continuing process %u" % (pid)
-process.Continue()
+if options.trace_function:
+process.GetThreadAtIndex(0).StepInto()
+else:
+process.Continue()
elif state == lldb.eStateExited:
exit_desc = process.GetExitDescription()
if exit_desc:
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits