Index: packages/Python/lldbsuite/test/lldbplatformutil.py =================================================================== --- packages/Python/lldbsuite/test/lldbplatformutil.py +++ packages/Python/lldbsuite/test/lldbplatformutil.py @@ -127,7 +127,15 @@ def getPlatform(): """Returns the target platform which the tests are running on.""" - platform = lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2] + if lldb.DBG.GetSelectedPlatform().GetTriple(): + platform = lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2] + else: + # In case of a core file, if the core file architecture(like x86_64) + # is incompatible with that of Host architecture(like Mips64) + # then platform is set to remote-platform. If the remote-platform is + # not connected then SBPlatform::GetTriple() will return none. + # Hence we assume target platform is same as the host platform. + platform = sys.platform if platform.startswith('freebsd'): platform = 'freebsd' elif platform.startswith('netbsd'):