Uses lldb wrapper if exists for gdbclient.py
Bug: 161853714
Change-Id: I3c19e06195569d46889d4c967cdab1fc5c7e39b8
diff --git a/scripts/gdbclient.py b/scripts/gdbclient.py
index f78ef2b..2665261 100755
--- a/scripts/gdbclient.py
+++ b/scripts/gdbclient.py
@@ -62,6 +62,14 @@
return path.format(root, arch, "")
+def get_lldb_path(toolchain_path):
+ for lldb_name in ['lldb.sh', 'lldb.cmd', 'lldb', 'lldb.exe']:
+ debugger_path = os.path.join(toolchain_path, "bin", lldb_name)
+ if os.path.isfile(debugger_path):
+ return debugger_path
+ return None
+
+
def get_lldb_server_path(root, clang_base, clang_version, arch):
arch = {
'arm': 'arm',
@@ -457,7 +465,7 @@
remote="tcp:{}".format(args.port))
if use_lldb:
- debugger_path = os.path.join(toolchain_path, "bin", "lldb")
+ debugger_path = get_lldb_path(toolchain_path)
debugger = 'lldb'
else:
debugger_path = os.path.join(