David Pfau
David Pfau

Reputation: 813

Run python script in LLDB

I'd like to debug a Python script that runs some C code under the hood using LLDB. If I simply run lldb 'python my_script.py', LLDB informs me that error: unable to find executable for 'python my_script.py'. So what am I missing?

Upvotes: 1

Views: 3361

Answers (1)

Jim Ingham
Jim Ingham

Reputation: 27110

By putting 'python my_script.py' in quotes like that, you are telling lldb that your executable is called 'python my_script.py'. You want to run the 'python' binary, but supply my_script.py as the first argument. Do that by saying:

$ lldb python my_script.py

Note, since the lldb command can take various flag arguments, you can disambiguate flags sent to lldb and flags sent to your program by writing this:

$ lldb python -- my_script.py

or even more pedantically correct:

$ lldb -f python -- my_script.py

Upvotes: 4

Related Questions