summaryrefslogtreecommitdiff
path: root/src/pal/inc
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/pal/inc
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/pal/inc')
-rw-r--r--src/pal/inc/pal.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pal/inc/pal.h b/src/pal/inc/pal.h
index db2ce0d4fa..bb5e05f359 100644
--- a/src/pal/inc/pal.h
+++ b/src/pal/inc/pal.h
@@ -433,6 +433,7 @@ DWORD
PALAPI
PAL_RegisterForRuntimeStartup(
IN DWORD dwProcessId,
+ IN LPCWSTR lpApplicationGroupId,
IN PPAL_STARTUP_CALLBACK pfnCallback,
IN PVOID parameter,
OUT PVOID *ppUnregisterToken);
@@ -453,7 +454,7 @@ PALIMPORT
LPCSTR
PALAPI
PAL_GetApplicationGroupId();
-#endif // __APPLE__
+#endif
static const int MAX_DEBUGGER_TRANSPORT_PIPE_NAME_LENGTH = MAX_PATH;
@@ -463,6 +464,7 @@ PALAPI
PAL_GetTransportPipeName(
OUT char *name,
IN DWORD id,
+ IN const char *applicationGroupId,
IN const char *suffix);
PALIMPORT