Commit 0bf78548 authored by hjk's avatar hjk

Debugger: Hard-code fallback path if LLDB does not handle -P

The fallback is the "standard" location for LLDB coming with XCode.

Change-Id: I1230176bc7e96476e2f748d850a5a4c93b57cafa
Reviewed-by: default avatarhjk <>
parent 69d0d6cd
......@@ -8,11 +8,24 @@ import select
import sys
import subprocess
proc = subprocess.Popen(args=[sys.argv[1], '-P'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(path, error) = proc.communicate()
if error.startswith('lldb: invalid option -- P'):
sys.stdout.write('msg=\'Could not run "%s -P". Trying to find from Xcode.\'@\n' % sys.argv[1])
proc = subprocess.Popen(args=['xcode-select', '--print-path'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(path, error) = proc.communicate()
if len(error):
path = '/Applications/'
sys.stdout.write('msg=\'Could not run "xcode-select --print-path"@\n')
sys.stdout.write('msg=\'Using hardcoded fallback at %s\'@\n' % path)
path = path.strip() + '/../SharedFrameworks/LLDB.framework/Versions/A/Resources/Python/'
sys.stdout.write('msg=\'Using fallback at %s\'@\n' % path)
proc = subprocess.Popen(args=[sys.argv[1], "-P"], stdout=subprocess.PIPE)
path =
sys.path.insert(1, path)
sys.path.insert(1, path.strip())
import lldb
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment