From: John Salem Date: Wed, 19 Feb 2020 22:41:13 +0000 (-0800) Subject: Change COMPlus_DiagnosticsServerTransportPath (#32087) X-Git-Tag: submit/tizen/20210909.063632~9619 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e1be1f7c911941b90b7defa3d684998cfcb606da;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Change COMPlus_DiagnosticsServerTransportPath (#32087) * Change COMPlus_DiagnosticsServerTransportPath to DOTNET_DiagnosticsServerAddress --- diff --git a/src/coreclr/src/inc/clrconfigvalues.h b/src/coreclr/src/inc/clrconfigvalues.h index 2e2474fa766..1527ffe8700 100644 --- a/src/coreclr/src/inc/clrconfigvalues.h +++ b/src/coreclr/src/inc/clrconfigvalues.h @@ -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 diff --git a/src/coreclr/src/vm/diagnosticserver.cpp b/src/coreclr/src/vm/diagnosticserver.cpp index c1a8aa7acf6..5a80396179a 100644 --- a/src/coreclr/src/vm/diagnosticserver.cpp +++ b/src/coreclr/src/vm/diagnosticserver.cpp @@ -135,24 +135,22 @@ bool DiagnosticServer::Initialize() szMessage); // data2 }; - // char transportPath[MAX_PATH]; - NewArrayHolder transportPath = nullptr; - CLRConfigStringHolder wTransportPath = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_DiagnosticsServerTransportPath); + NewArrayHolder 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) {