summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
authorTatyana Krasnukha <tatyana@synopsys.com>2019-12-10 18:00:50 +0300
committerTatyana Krasnukha <tatyana@synopsys.com>2019-12-26 18:49:35 +0300
commita58bd0e42cf21a80c0f2c69bddf8fe32b6e99a40 (patch)
tree329ad3d13474442e901ae0ee73ee64c2e84ef605 /lldb/packages/Python/lldbsuite/test
parentf57b35af2f00791d1203080c43ca1d87db6cad41 (diff)
downloadbcm5719-llvm-a58bd0e42cf21a80c0f2c69bddf8fe32b6e99a40.tar.gz
bcm5719-llvm-a58bd0e42cf21a80c0f2c69bddf8fe32b6e99a40.zip
[lldb][tests] Platform triple can be None
If a remote target is not connected, SBPlatform's GetTriple function returns None.
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbplatformutil.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
index 3515bc812ac..02946f0398b 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
@@ -129,7 +129,12 @@ def getDarwinOSTriples():
def getPlatform():
"""Returns the target platform which the tests are running on."""
- platform = lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2]
+ triple = lldb.DBG.GetSelectedPlatform().GetTriple()
+ if triple is None:
+ # It might be an unconnected remote platform.
+ return ''
+
+ platform = triple.split('-')[2]
if platform.startswith('freebsd'):
platform = 'freebsd'
elif platform.startswith('netbsd'):
OpenPOWER on IntegriCloud