Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python script stuck when trying to continue process in lldb

Tags:

python

llvm

lldb

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
like image 765
jasondinh Avatar asked Nov 10 '22 08:11

jasondinh


1 Answers

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.

like image 75
Jim Ingham Avatar answered Nov 14 '22 21:11

Jim Ingham