forked from qt-creator/qt-creator
lldb: allow lldbbridge.py to be directly imported in python
Change-Id: Ib0bcb4dd708e89cebe12407a3f8e375c79664a74 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -48,12 +48,13 @@ from misctypes import *
|
|||||||
from boosttypes import *
|
from boosttypes import *
|
||||||
from creatortypes import *
|
from creatortypes import *
|
||||||
|
|
||||||
|
lldbCmd = 'lldb'
|
||||||
proc = subprocess.Popen(args=[sys.argv[1], '-P'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
if len(sys.argv) > 1:
|
||||||
|
lldbCmd = sys.argv[1]
|
||||||
|
proc = subprocess.Popen(args=[lldbCmd, '-P'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
(path, error) = proc.communicate()
|
(path, error) = proc.communicate()
|
||||||
|
|
||||||
if error.startswith('lldb: invalid option -- P'):
|
if error.startswith('lldb: invalid option -- P'):
|
||||||
sys.stdout.write('msg=\'Could not run "%s -P". Trying to find lldb.so from Xcode.\'\n' % sys.argv[1])
|
sys.stdout.write('msg=\'Could not run "%s -P". Trying to find lldb.so from Xcode.\'\n' % lldbCmd)
|
||||||
proc = subprocess.Popen(args=['xcode-select', '--print-path'],
|
proc = subprocess.Popen(args=['xcode-select', '--print-path'],
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
(path, error) = proc.communicate()
|
(path, error) = proc.communicate()
|
||||||
@@ -65,7 +66,6 @@ if error.startswith('lldb: invalid option -- P'):
|
|||||||
path = path.strip() + '/../SharedFrameworks/LLDB.framework/Versions/A/Resources/Python/'
|
path = path.strip() + '/../SharedFrameworks/LLDB.framework/Versions/A/Resources/Python/'
|
||||||
sys.stdout.write('msg=\'Using fallback at %s\'\n' % path)
|
sys.stdout.write('msg=\'Using fallback at %s\'\n' % path)
|
||||||
|
|
||||||
#sys.path.append(path)
|
|
||||||
sys.path.insert(1, path.strip())
|
sys.path.insert(1, path.strip())
|
||||||
|
|
||||||
import lldb
|
import lldb
|
||||||
@@ -1729,7 +1729,7 @@ def testit():
|
|||||||
db.reportVariables()
|
db.reportVariables()
|
||||||
#db.report("DUMPER=%s" % qqDumpers)
|
#db.report("DUMPER=%s" % qqDumpers)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
if len(sys.argv) > 2:
|
if len(sys.argv) > 2:
|
||||||
testit()
|
testit()
|
||||||
else:
|
else:
|
||||||
|
Reference in New Issue
Block a user