Change COMPlus_DiagnosticsServerTransportPath (#32087)
authorJohn Salem <josalem@microsoft.com>
Wed, 19 Feb 2020 22:41:13 +0000 (14:41 -0800)
committerGitHub <noreply@github.com>
Wed, 19 Feb 2020 22:41:13 +0000 (14:41 -0800)
* Change COMPlus_DiagnosticsServerTransportPath to DOTNET_DiagnosticsServerAddress

src/coreclr/src/inc/clrconfigvalues.h
src/coreclr/src/vm/diagnosticserver.cpp

index 2e2474fa76632207c13a7c78d29c8e623606ef8c..1527ffe87008ad7e13eec886994c2033b33fd589 100644 (file)
@@ -717,7 +717,7 @@ RETAIL_CONFIG_DWORD_INFO(INTERNAL_EventPipeProcNumbers, W("EventPipeProcNumbers"
 //
 // Diagnostics Server
 //
-RETAIL_CONFIG_STRING_INFO(EXTERNAL_DiagnosticsServerTransportPath, W("DiagnosticsServerTransportPath"), "The full path including filename for the OS transport (NamedPipe on Windows; Unix Domain Socket on Linux) to be used by the Diagnostics Server");
+RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_DOTNET_DiagnosticsServerAddress, W("DOTNET_DiagnosticsServerAddress"), "The full path including filename for the OS transport (NamedPipe on Windows; Unix Domain Socket on Linux) to be used by the Diagnostics Server", CLRConfig::DontPrependCOMPlus_);
 
 //
 // LTTng
index c1a8aa7acf6498b926e379abfecf1be4a023ce6f..5a80396179ae0046f68030f1a1e5772881daa1f0 100644 (file)
@@ -135,24 +135,22 @@ bool DiagnosticServer::Initialize()
                 szMessage);                                           // data2
         };
 
-        // char transportPath[MAX_PATH];
-        NewArrayHolder<char> transportPath = nullptr;
-        CLRConfigStringHolder wTransportPath = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_DiagnosticsServerTransportPath);
+        NewArrayHolder<char> address = nullptr;
+        CLRConfigStringHolder wAddress = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_DOTNET_DiagnosticsServerAddress);
         int nCharactersWritten = 0;
-        if (wTransportPath != nullptr)
+        if (wAddress != nullptr)
         {
-            nCharactersWritten = WideCharToMultiByte(CP_UTF8, 0, wTransportPath, -1, NULL, 0, NULL, NULL);
+            nCharactersWritten = WideCharToMultiByte(CP_UTF8, 0, wAddress, -1, NULL, 0, NULL, NULL);
             if (nCharactersWritten != 0)
             {
-                transportPath = new char[nCharactersWritten];
-                nCharactersWritten = WideCharToMultiByte(CP_UTF8, 0, wTransportPath, -1, transportPath, nCharactersWritten, NULL, NULL);
+                address = new char[nCharactersWritten];
+                nCharactersWritten = WideCharToMultiByte(CP_UTF8, 0, wAddress, -1, address, nCharactersWritten, NULL, NULL);
                 assert(nCharactersWritten != 0);
             }
         }
 
         // TODO: Should we handle/assert that (s_pIpc == nullptr)?
-        s_pIpc = IpcStream::DiagnosticsIpc::Create(
-            transportPath, ErrorCallback);
+        s_pIpc = IpcStream::DiagnosticsIpc::Create(address, ErrorCallback);
 
         if (s_pIpc != nullptr)
         {