From: Mike McLaughlin Date: Mon, 23 Oct 2023 17:31:13 +0000 (-0700) Subject: Update Native AOT crash info with module base address (#4351) X-Git-Tag: accepted/tizen/unified/riscv/20231226.055542~35^2~1^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0b63c9c99edc5e489efa1cfc9eeccaff3758bfc3;p=platform%2Fcore%2Fdotnet%2Fdiagnostics.git Update Native AOT crash info with module base address (#4351) --- diff --git a/src/Microsoft.Diagnostics.DebugServices.Implementation/CrashInfoService.cs b/src/Microsoft.Diagnostics.DebugServices.Implementation/CrashInfoService.cs index a10c4001a..2f7282e0a 100644 --- a/src/Microsoft.Diagnostics.DebugServices.Implementation/CrashInfoService.cs +++ b/src/Microsoft.Diagnostics.DebugServices.Implementation/CrashInfoService.cs @@ -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; } diff --git a/src/Microsoft.Diagnostics.DebugServices/ICrashInfoService.cs b/src/Microsoft.Diagnostics.DebugServices/ICrashInfoService.cs index 797fb75fd..1d04cab52 100644 --- a/src/Microsoft.Diagnostics.DebugServices/ICrashInfoService.cs +++ b/src/Microsoft.Diagnostics.DebugServices/ICrashInfoService.cs @@ -41,6 +41,11 @@ namespace Microsoft.Diagnostics.DebugServices /// RuntimeType RuntimeType { get; } + /// + /// The module base address that contains the runtime + /// + ulong RuntimeBaseAddress { get; } + /// /// Runtime version and possible commit id /// diff --git a/src/Microsoft.Diagnostics.ExtensionCommands/CrashInfoCommand.cs b/src/Microsoft.Diagnostics.ExtensionCommands/CrashInfoCommand.cs index 994522dd2..67c69b3ae 100644 --- a/src/Microsoft.Diagnostics.ExtensionCommands/CrashInfoCommand.cs +++ b/src/Microsoft.Diagnostics.ExtensionCommands/CrashInfoCommand.cs @@ -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}");