Change the GenerateCoreDump protocol to use UTF16 dump file name (#258)
authorMike McLaughlin <mikem@microsoft.com>
Wed, 8 May 2019 21:45:33 +0000 (14:45 -0700)
committerGitHub <noreply@github.com>
Wed, 8 May 2019 21:45:33 +0000 (14:45 -0700)
src/Microsoft.Diagnostics.Tools.RuntimeClient/DiagnosticHelpers.cs
src/Microsoft.Diagnostics.Tools.RuntimeClient/Eventing/EventPipeClient.cs
src/Microsoft.Diagnostics.Tools.RuntimeClient/Extensions.cs

index dc62ec1a426d1bac1df68c4a22337c087af1f64f..1ebaeeea669ce181faf3bfd84f4e1e2d126adcca 100644 (file)
@@ -57,7 +57,7 @@ namespace Microsoft.Diagnostics.Tools.RuntimeClient
                 bw.Write((uint)header.RequestType);
                 bw.Write(header.Pid);
 
-                bw.WriteAsciiString(dumpName);
+                bw.WriteString(dumpName);
                 bw.Write((int)dumpType);
                 bw.Write(diagnostics ? 1 : 0);
 
index f44630a80e6c58896b9703bd4a5710b7d76c4b1b..71d5ae7419afb72b0d652ee3dbd64f7df814d85f 100644 (file)
@@ -51,7 +51,7 @@ namespace Microsoft.Diagnostics.Tools.RuntimeClient
                     .SingleOrDefault(input => Regex.IsMatch(input, $"^dotnetcore-diagnostic-{processId}-(\\d+)-socket$"));
                 if (ipcPort == null)
                 {
-                    throw new InvalidOperationException($"Process {processId} not running compatible .NET Core runtime");
+                    throw new PlatformNotSupportedException($"Process {processId} not running compatible .NET Core runtime");
                 }
                 string path = Path.Combine(Path.GetTempPath(), ipcPort);
                 var remoteEP = new UnixDomainSocketEndPoint(path);
@@ -124,7 +124,7 @@ namespace Microsoft.Diagnostics.Tools.RuntimeClient
                     .SingleOrDefault(input => Regex.IsMatch(input, $"^dotnetcore-diagnostic-{processId}-(\\d+)-socket$"));
                 if (ipcPort == null)
                 {
-                    throw new InvalidOperationException($"Process {processId} not running compatible .NET Core runtime");
+                    throw new PlatformNotSupportedException($"Process {processId} not running compatible .NET Core runtime");
                 }
                 string path = Path.Combine(Path.GetTempPath(), ipcPort);
                 var remoteEP = new UnixDomainSocketEndPoint(path);
index 47b183db9775499a3eb17faf565f7316015bb6d4..f0ab1ed71db01a1f1ccebbfd7e84e33fc91d7969 100644 (file)
@@ -21,16 +21,6 @@ namespace Microsoft.Diagnostics.Tools.RuntimeClient
                 @this.Write(Encoding.Unicode.GetBytes(value + '\0'));
         }
 
-        public static void WriteAsciiString(this BinaryWriter @this, string value)
-        {
-            if (@this == null)
-                throw new ArgumentNullException(nameof(@this));
-
-            @this.Write(value != null ? (value.Length + 1) : 0);
-            if (value != null)
-                @this.Write(Encoding.ASCII.GetBytes(value + '\0'));
-        }
-
 #if DEBUG
         private static int GetByteCount(this string @this)
         {