Home | History | Annotate | Download | only in python

Lines Matching full:process

51 def print_threads(process, options):
53 for thread in process:
68 description='''Debugs a program using the LLDB python API and uses asynchronous broadcast events to watch for process state changes.'''
84 parser.add_option('-l', '--launch-command', action='append', type='string', metavar='CMD', dest='launch_commands', help='LLDB command interpreter commands to run once after the process has launched. This option can be specified more than once.', default=[])
85 parser.add_option('-s', '--stop-command', action='append', type='string', metavar='CMD', dest='stop_commands', help='LLDB command interpreter commands to run each time the process stops. This option can be specified more than once.', default=[])
86 parser.add_option('-c', '--crash-command', action='append', type='string', metavar='CMD', dest='crash_commands', help='LLDB command interpreter commands to run in case the process crashes. This option can be specified more than once.', default=[])
87 parser.add_option('-x', '--exit-command', action='append', type='string', metavar='CMD', dest='exit_commands', help='LLDB command interpreter commands to run once after the process has exited. This option can be specified more than once.', default=[])
88 parser.add_option('-T', '--no-threads', action='store_false', dest='show_threads', help="Don't show threads when process stops.", default=True)
90 parser.add_option('-n', '--run-count', type='int', dest='run_count', metavar='N', help='How many times to run the process in case the process exits.', default=1)
91 parser.add_option('-t', '--event-timeout', type='int', dest='event_timeout', metavar='SEC', help='Specify the timeout in seconds to wait for process state change events.', default=lldb.UINT32_MAX)
92 parser.add_option('-e', '--environment', action='append', type='string', metavar='ENV', dest='env_vars', help='Environment variables to set in the inferior process when launching a process.')
93 parser.add_option('-d', '--working-dir', type='string', metavar='DIR', dest='working_dir', help='The the current working directory when launching a process.', default=None)
94 parser.add_option('-p', '--attach-pid', type='int', dest='attach_pid', metavar='PID', help='Specify a process to attach to by process ID.', default=-1)
95 parser.add_option('-P', '--attach-name', type='string', dest='attach_name', metavar='PROCESSNAME', help='Specify a process to attach to by name.', default=None)
96 parser.add_option('-w', '--attach-wait', action='store_true', dest='attach_wait', help='Wait for the next process to launch when attaching to a process by name.', default=False)
151 # Launch the process. Since we specified synchronous mode, we won't return
161 process = target.Launch (launch_info, error)
164 print 'Attaching to process %i...' % (options.attach_pid)
167 print 'Waiting for next to process named "%s" to launch...' % (options.attach_name)
169 print 'Attaching to existing process named "%s"...' % (options.attach_name)
170 process = target.Attach (attach_info, error)
173 if process and process.GetProcessID() != lldb.LLDB_INVALID_PROCESS_ID:
174 pid = process.GetProcessID()
176 # sign up for process state change events
186 print 'process event = %s' % (event)
188 print "process state changed event: %s" % (lldb.SBDebugger.StateAsCString(state))
192 print "process %u launched" % (pid)
195 print "attached to process %u" % (pid)
205 print "process %u stopped" % (pid)
208 print_threads (process, options)
209 print "continuing process %u" % (pid)
210 process.Continue()
212 exit_desc = process.GetExitDescription()
214 print "process %u exited with status %u: %s" % (pid, process.GetExitStatus (), exit_desc)
216 print "process %u exited with status %u" % (pid, process.GetExitStatus ())
220 print "process %u crashed" % (pid)
221 print_threads (process, options)
225 print "process %u detached" % (pid)
228 # process is running, don't say anything, we will always get one of these after resuming
230 print "process %u resumed" % (pid)
232 print "process %u unloaded, this shouldn't happen" % (pid)
235 print "process connected"
237 print "process attaching"
239 print "process launching"
244 print "no process event for %u seconds, killing the process..." % (options.event_timeout)
247 process_stdout = process.GetSTDOUT(1024)
249 print "Process STDOUT:\n%s" % (process_stdout)
251 process_stdout = process.GetSTDOUT(1024)
253 process_stderr = process.GetSTDERR(1024)
255 print "Process STDERR:\n%s" % (process_stderr)
257 process_stderr = process.GetSTDERR(1024)
259 process.Kill() # kill the process