Skip to content

Commit

Permalink
Fix SOS/managed debugging failures from PR dotnet#36847 (dotnet#38689)
Browse files Browse the repository at this point in the history
Add PAL_GetApplicationGroupId() that returns null for Linux.
  • Loading branch information
mikem8361 committed Jul 2, 2020
1 parent f5691ed commit f170db7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 0 additions & 2 deletions src/coreclr/src/pal/inc/pal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
14 changes: 7 additions & 7 deletions src/coreclr/src/pal/src/thread/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -2066,14 +2061,19 @@ PAL_NotifyRuntimeStarted()
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)
{
Expand Down

0 comments on commit f170db7

Please sign in to comment.