diff --git a/lldb/tools/debugserver/source/MacOSX/MachProcess.mm b/lldb/tools/debugserver/source/MacOSX/MachProcess.mm --- a/lldb/tools/debugserver/source/MacOSX/MachProcess.mm +++ b/lldb/tools/debugserver/source/MacOSX/MachProcess.mm @@ -742,8 +742,12 @@ return "bridgeos"; case PLATFORM_DRIVERKIT: return "driverkit"; + default: + DNBLogError( + "Unknown platform %u found for one binary, returning empty string", + platform); + return ""; } - return nullptr; } static bool mach_header_validity_test(uint32_t magic, uint32_t cputype) { diff --git a/lldb/tools/debugserver/source/RNBRemote.cpp b/lldb/tools/debugserver/source/RNBRemote.cpp --- a/lldb/tools/debugserver/source/RNBRemote.cpp +++ b/lldb/tools/debugserver/source/RNBRemote.cpp @@ -6261,7 +6261,7 @@ auto *platform = DNBGetDeploymentInfo(pid, is_executable, lc, load_command_addr, major_version, minor_version, patch_version); - if (platform) { + if (platform && *platform != '\0') { os_handled = true; rep << "ostype:" << platform << ";"; break;