summaryrefslogtreecommitdiff
path: root/src/debug/di/dbgtransportmanager.cpp
AgeCommit message (Collapse)AuthorFilesLines
2018-12-12Added support for debugging a sandboxed app on Mac (#21068)Oded Hanson1-4/+5
* 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
2017-04-26Enable build with clang 4.0 (#11226)Jan Vorlicek1-2/+2
This change enables build with clang 4.0 and fixes a bunch of new errors that the stricter compiler was reporting.
2016-01-27Update license headersdotnet-bot1-4/+3
2016-01-14Add debugger launch to dbgshim for xplat.Mike McLaughlin1-2/+1
Add the RegisterForRuntimeStartup/UnregisterForRuntimeStartup to dbghim. Executes the callback when the coreclr runtime starts in the specified process. The callback is passed the proper ICorDebug instance for the version of the runtime or an error if something fails. This API works for launch and attach (and even the attach scenario if the runtime hasn't been loaded yet) equally on both xplat and Windows. The callback is always called on a separate thread. This API returns immediately. The callback is invoke when the coreclr runtime module is loaded during early initialization. The runtime is blocked during initialization until the callback returns. HRESULT RegisterForRuntimeStartup( __in DWORD dwProcessId, __in PSTARTUP_CALLBACK pfnCallback, __in PVOID parameter, __out PVOID *ppUnregisterToken) HRESULT UnregisterForRuntimeStartup( __in PVOID pUnregisterToken) Most of the work is done for xplat in the PAL_RegisterForRuntimeStartup and PAL_UnregisterForRuntimeStartup. On Windows, the APIs are implemented on top of the old dbgshim ones. Added reference counting to DbgTransportSession so the cleanup can be done after the transport worker and the main code is finished. Fix a hang in OSX initializing multiple PALs in the debugging test dbg, dbgshim and mscordaccore by not calling FILEInitStdHandles() from PAL_InitializeDLL. Fixed a minor EnumerateCLRs bug in an error path. A ThrowHR instead of returning the HRESULT. Better pipe file/dbg transport cleanup. Now also call the dbg transport connection abort for an unhandled native exception. Added PROCAbort to replace most calls to abort(). The shutdown handler is called in PROCAbort(). Cleanup debugger transport pipes on CTRL-C termination. Cleanup process code; remove now useless CProcSharedData. Added "PROCESS" PAL trace type.
2015-03-03Pipe based communication between debugee and managed debugger on LinuxEugene Zemtsov1-1805/+124
Goal of this change is to make managed debugging on Linux possible. (It is not fully achieved, but we're getting there) So far our provision for debugging on Linux is somewhat different from debugging on Windows. Instead of using WaitForDebugEvent and RaiseException as means of communication between debugger and debuggee, we're gonna use pipes. Thankfully from old times of Silverlight Mac debugging we had debugging via network sockets under ifdefs FEATURE_DBGIPC_TRANSPORT_DI and FEATURE_DBGIPC_TRANSPORT_VM. So this change is taking that old way of debugging, changing sockets for network pipes, removes lots of unused stuff and implements whatever is missing on Linux. Testing: Due to infrastructural issues I wasn't able to test debugging on Linux yet. So my testing consistent of 1. End to end net pipe debugging on Windows 2. Testing of twowaypipe implementation on Linux 3. Testing of search for loaded CoreCLR module on Linux.
2015-02-07Ensure that every usage of va_start is complemented by a va_endGeoff Norton1-0/+2
2015-01-30Initial commit to populate CoreCLR repo dotnet-bot1-0/+1912
[tfs-changeset: 1407945]