The problem's description is the same to LLDB SBProcess stuck on launching Ubuntu 18.04.
Whenever I Launch a target the process gets stuck in the launching state and will never launch. I've tried lldb in bash and it works perfectly. I've read through the documentation with the tutorial and can't find an explanation about the launching state, or how to discover what is causing it to get stuck.
System: Ubuntu 16.04 64 bit
The most simple code to reproduce the error is as follows:
import lldb
exe = './a.out'
db = lldb.SBDebugger.Create()
db.SetAsync(False)
target = db.CreateTarget('a.out')
launch_info = lldb.SBLaunchInfo(None)
launch_info.SetExecutableFile (lldb.SBFileSpec(exe), True)
error = lldb.SBError()
print(error)
process = target.Launch (launch_info, error)
print(error)
print(process)
a.out
is compiled by helloworld.c
. Run above python code and the output is as follows:
error: <NULL>
error: unable to locate lldb-server-16.0.6
SBProcess: pid = 0, state = launching, threads = 0, executable = a.out
When I enter lldb-server-16.0.6
on ubuntu's cmd, and it outputs:
Usage:
lldb-server-16.0.6 v[ersion]
lldb-server-16.0.6 g[dbserver] [options]
lldb-server-16.0.6 p[latform] [options]
Invoke subcommand for additional help
It means that lldb-server-16.0.6
is already in the environment.
I also try the solution to the above problem (LLDB SBProcess stuck on launching Ubuntu 18.04), but it didn't work.
Update the method to solve the above problems.
I found a solution in https://github.com/lldb-tools/lldb-mi/issues/66
I solve this problem by setting:
export LLDB_DEBUGSERVER_PATH=/usr/bin/lldb-server-16.0.6
Then I run the Python code again. There comes another problem:
error: <NULL>
error: Cannot launch '/my/path/to/a.out': personality set failed: Operation not permitted
SBProcess: pid = 0, state = launching, threads = 0, executable = a.out
Please give me some solutions to this problem. Thank you!