Update Native AOT crash info with module base address (#4351)
authorMike McLaughlin <mikem@microsoft.com>
Mon, 23 Oct 2023 17:31:13 +0000 (10:31 -0700)
committerGitHub <noreply@github.com>
Mon, 23 Oct 2023 17:31:13 +0000 (10:31 -0700)
src/Microsoft.Diagnostics.DebugServices.Implementation/CrashInfoService.cs
src/Microsoft.Diagnostics.DebugServices/ICrashInfoService.cs
src/Microsoft.Diagnostics.ExtensionCommands/CrashInfoCommand.cs

index a10c4001a314d74d06810ba644aea71542c4c427..2f7282e0ae4d2b4632ec8d519718950fc49ec623 100644 (file)
@@ -30,12 +30,16 @@ namespace Microsoft.Diagnostics.DebugServices.Implementation
             [JsonPropertyName("reason")]
             public int Reason { get; set; }
 
-            [JsonPropertyName("runtime")]
-            public string Runtime { get; set; }
-
             [JsonPropertyName("runtime_type")]
             public int RuntimeType { get; set; }
 
+            [JsonPropertyName("runtime_base")]
+            [JsonConverter(typeof(HexUInt64Converter))]
+            public ulong RuntimeBaseAddress { get; set; }
+
+            [JsonPropertyName("runtime_version")]
+            public string RuntimeVersion { get; set; }
+
             [JsonPropertyName("thread")]
             [JsonConverter(typeof(HexUInt32Converter))]
             public uint Thread { get; set; }
@@ -165,7 +169,8 @@ namespace Microsoft.Diagnostics.DebugServices.Implementation
             ThreadId = threadId;
             HResult = hresult;
             CrashReason = (CrashReason)crashInfo.Reason;
-            RuntimeVersion = crashInfo.Runtime;
+            RuntimeBaseAddress = crashInfo.RuntimeBaseAddress;
+            RuntimeVersion = crashInfo.RuntimeVersion;
             RuntimeType = (RuntimeType)crashInfo.RuntimeType;
             Message = crashInfo.Message;
             Exception = crashInfo.Exception;
@@ -179,10 +184,12 @@ namespace Microsoft.Diagnostics.DebugServices.Implementation
 
         public CrashReason CrashReason { get; }
 
-        public string RuntimeVersion { get; }
+        public ulong RuntimeBaseAddress { get; }
 
         public RuntimeType RuntimeType { get; }
 
+        public string RuntimeVersion { get; }
+
         public string Message { get; }
 
         public IManagedException Exception { get; }
index 797fb75fd1d154366ff6461c4239075abe27e176..1d04cab52088e6c9a6d17fa65d7039dd915e374e 100644 (file)
@@ -41,6 +41,11 @@ namespace Microsoft.Diagnostics.DebugServices
         /// </summary>
         RuntimeType RuntimeType { get; }
 
+        /// <summary>
+        /// The module base address that contains the runtime
+        /// </summary>
+        ulong RuntimeBaseAddress { get; }
+
         /// <summary>
         /// Runtime version and possible commit id
         /// </summary>
index 994522dd2aa4867d08356b9646712b7765c82523..67c69b3aed100d8ef39a9c483eac7eca09e9c01c 100644 (file)
@@ -30,6 +30,7 @@ namespace Microsoft.Diagnostics.ExtensionCommands
             WriteLine($"ThreadId:           {CrashInfo.ThreadId:X4}");
             WriteLine($"HResult:            {CrashInfo.HResult:X4}");
             WriteLine($"RuntimeType:        {CrashInfo.RuntimeType}");
+            WriteLine($"RuntimeBaseAddress: {CrashInfo.RuntimeBaseAddress:X16}");
             WriteLine($"RuntimeVersion:     {CrashInfo.RuntimeVersion}");
             WriteLine($"Message:            {CrashInfo.Message}");