Enable diagnostics for .NET app
authorWoongsuk Cho <ws77.cho@samsung.com>
Fri, 10 Apr 2020 01:13:39 +0000 (10:13 +0900)
committer이형주/Common Platform Lab(SR)/Staff Engineer/삼성전자 <leee.lee@samsung.com>
Mon, 13 Apr 2020 01:24:02 +0000 (10:24 +0900)
In the previous implementation, COMPlus_EnableDiagnostics is set to 0 to avoid creating clr-debug-pipe file.
But, from coreclr 3.1.0, that environment setting also affects the creation of diagnostics socket file.

To enable diagnostics at candidate process, set COMPlus_EnableDiagnostics to 1.

NativeLauncher/launcher/lib/dotnet_launcher.cc

index d9d14bc..5dc2304 100644 (file)
@@ -380,9 +380,9 @@ int CoreRuntime::initialize(LaunchMode launchMode, bool useDlog, const char* roo
        putenv(const_cast<char *>("UNW_ARM_UNWIND_METHOD=6"));
 #endif // __arm__
 
-       // Disable debug pipes and semaphores creation in case of non-standlone mode
-       if (launchMode == LaunchMode::loader)
-               putenv(const_cast<char *>("COMPlus_EnableDiagnostics=0"));
+       // Enable diagnostics.
+       // clr create clr-debug-pipe-xxx and dotnet-diagnostics-xxx file under /tmp dir.
+       putenv(const_cast<char *>("COMPlus_EnableDiagnostics=1"));
 
        // Write Debug.WriteLine to stderr
        putenv(const_cast<char *>("COMPlus_DebugWriteToStdErr=1"));