Question

I'm trying to do some research on iOS and it involves attaching lldb to a process. I'm able to do it with lldb console, however when I'm trying to convert it to a python script, it stuck at "process continue" for the first time and never reach the commands at the end. Can anyone helps? Thanks!

import lldb
debugger = lldb.SBDebugger.Create()
debugger.SetAsync(False)
debugger.HandleCommand('platform select remote-ios')
debugger.HandleCommand('process connect connect://localhost:1234')
debugger.HandleCommand('process continue')
#other commands
Was it helpful?

Solution

You are running in synchronous mode, so "process continue" won't return till the process stops for some reason. You didn't set any breakpoints, so short of crashing, there's nothing to make it stop.

If you want to have more control over handling the process as it runs, you might want to try modifying the event-handling example at:

http://llvm.org/svn/llvm-project/lldb/trunk/examples/python/process_events.py

to your purposes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top