Fix SOS/managed debugging failures from PR #36847 (#38689)
authorMike McLaughlin <mikem@microsoft.com>
Thu, 2 Jul 2020 02:30:12 +0000 (19:30 -0700)
committerGitHub <noreply@github.com>
Thu, 2 Jul 2020 02:30:12 +0000 (02:30 +0000)
Add PAL_GetApplicationGroupId() that returns null for Linux.

src/coreclr/src/pal/inc/pal.h
src/coreclr/src/pal/src/thread/process.cpp

index b7303bf..5154159 100644 (file)
@@ -449,12 +449,10 @@ BOOL
 PALAPI
 PAL_NotifyRuntimeStarted();
 
-#ifdef __APPLE__
 PALIMPORT
 LPCSTR
 PALAPI
 PAL_GetApplicationGroupId();
-#endif
 
 static const unsigned int MAX_DEBUGGER_TRANSPORT_PIPE_NAME_LENGTH = MAX_PATH;
 
index ee1e759..c0d8bc9 100644 (file)
@@ -2011,12 +2011,7 @@ PAL_NotifyRuntimeStarted()
     _ASSERTE(ret == TRUE || processIdDisambiguationKey == 0);
 
     UnambiguousProcessDescriptor unambiguousProcessDescriptor(gPID, processIdDisambiguationKey);
-    LPCSTR applicationGroupId =
-#ifdef __APPLE__
-        PAL_GetApplicationGroupId();
-#else
-        nullptr;
-#endif
+    LPCSTR applicationGroupId = PAL_GetApplicationGroupId();
     CreateSemaphoreName(startupSemName, RuntimeStartupSemaphoreName, unambiguousProcessDescriptor, applicationGroupId);
     CreateSemaphoreName(continueSemName, RuntimeContinueSemaphoreName, unambiguousProcessDescriptor, applicationGroupId);
 
@@ -2066,14 +2061,19 @@ exit:
     return launched;
 }
 
-#ifdef __APPLE__
 LPCSTR
 PALAPI
 PAL_GetApplicationGroupId()
 {
+#ifdef __APPLE__
     return gApplicationGroupId;
+#else
+    return nullptr;
+#endif
 }
 
+#ifdef __APPLE__
+
 // We use 7bits from each byte, so this computes the extra size we need to encode a given byte count
 constexpr int GetExtraEncodedAreaSize(UINT rawByteCount)
 {