summaryrefslogtreecommitdiff
path: root/src/debug/di/shimprocess.cpp
diff options
context:
space:
mode:
authorOded Hanson <odhanson@microsoft.com>2018-12-12 02:42:17 +0200
committerJan Vorlicek <janvorli@microsoft.com>2018-12-12 01:42:17 +0100
commit5b687cf51745790ff02c2de3f9f992ddc94bfae1 (patch)
tree0e6b24b35e3482f6e0244cf2f724331c807faef6 /src/debug/di/shimprocess.cpp
parentfc90b973bf806410b836541a3d0af2293152c787 (diff)
downloadcoreclr-5b687cf51745790ff02c2de3f9f992ddc94bfae1.tar.gz
coreclr-5b687cf51745790ff02c2de3f9f992ddc94bfae1.tar.bz2
coreclr-5b687cf51745790ff02c2de3f9f992ddc94bfae1.zip
Added support for debugging a sandboxed app on Mac (#21068)
* Fixed bug in StackString where the size is not initialized correctly to STACK_COUNT * Added CharString and WCharString template classes and a generic CharStringFromLPCWSTR method * Added support for debugging a sandboxed app on Mac This change fixes the usage of IPC while debugging while running in a sandbox. When running in a sandbox, the temporary folder for each process will be different. Thus the pipes being created in TwoWayPipe right now would be created in different directories in the debugger process and the process being debugged. This change configures the folder to be used based on the application group ID that the sandboxed app belongs to. For the same reasons, the names sempahores being used to synchronize the debugger attach need to be prefixed with the application group ID. This change was abit more involved since the name of the semaphore is limited to 31 characters, so we had to encode the semaphore names differently to make them shorter. Last, new APIs to the debugger shim were added to support this new feature. This change only handles the runtime side and the dbgshim. An additional change to vsdbg needs to be done to use the new APIs. fixes #21066 * Fixed build breaks on non Mac Unix platforms * Fixed usage of gApplicationGroupId in non apple environments * Fixed bug in semaphore names * Got rid of usage of StackString * Made PAL_GetApplicationGroupId Apple specific * Added comment about pragma pack * Fixed comment * Added exported symbols * Duplicated applicationGroupId so it can be used from another thread during register complete callback * Renamed BitNum2ByteNum to GetExtraEncodedAreaSize to make intent clearer * Fixed nit comments * Removed redundant changes in StackString * Fixed windows build break * Fixed compilation switch from __APPLE to __APPLE__ * Added missing exports
Diffstat (limited to 'src/debug/di/shimprocess.cpp')
-rw-r--r--src/debug/di/shimprocess.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/debug/di/shimprocess.cpp b/src/debug/di/shimprocess.cpp
index 684173abca..b45bbe4ff4 100644
--- a/src/debug/di/shimprocess.cpp
+++ b/src/debug/di/shimprocess.cpp
@@ -132,7 +132,7 @@ void ShimProcess::SetProcess(ICorDebugProcess * pProcess)
if (pProcess != NULL)
{
// Verify that DataTarget + new process have the same pid?
- _ASSERTE(m_pProcess->GetPid() == m_pLiveDataTarget->GetPid());
+ _ASSERTE(m_pProcess->GetProcessDescriptor()->m_Pid == m_pLiveDataTarget->GetPid());
}
}
@@ -152,12 +152,12 @@ void ShimProcess::SetProcess(ICorDebugProcess * pProcess)
// Notes:
// Only call this once, during the initialization dance.
//
-HRESULT ShimProcess::InitializeDataTarget(DWORD processId)
+HRESULT ShimProcess::InitializeDataTarget(const ProcessDescriptor * pProcessDescriptor)
{
_ASSERTE(m_pLiveDataTarget == NULL);
- HRESULT hr = BuildPlatformSpecificDataTarget(GetMachineInfo(), processId, &m_pLiveDataTarget);
+ HRESULT hr = BuildPlatformSpecificDataTarget(GetMachineInfo(), pProcessDescriptor, &m_pLiveDataTarget);
if (FAILED(hr))
{
_ASSERTE(m_pLiveDataTarget == NULL);