diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c7748f52d..e98a457d00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ API Changes: - Removed unused `StackFrame.InstructionOffset`. ([#2691](https://github.com/getsentry/sentry-dotnet/pull/2691)) - Change `StackFrame`'s `ImageAddress`, `InstructionAddress` and `FunctionId` to `long?`. ([#2691](https://github.com/getsentry/sentry-dotnet/pull/2691)) - Enable `CaptureFailedRequests` by default. ([2688](https://github.com/getsentry/sentry-dotnet/pull/2688)) +- Change `DebugImage.ImageAddress` to `long?`. ([#2725](https://github.com/getsentry/sentry-dotnet/pull/2725)) - Additional constructors removed from `TransactionTracer`. ([#2694](https://github.com/getsentry/sentry-dotnet/pull/2694)) - Removed the `Scope.Platform` property as it was never applied. ([#2695](https://github.com/getsentry/sentry-dotnet/pull/2695)) - Reordered parameters for ther TransactionContext and SpanContext constructors. If you're constructing instances of these classes, you will need to adjust the order in which you pass parameters to these. ([#2696](https://github.com/getsentry/sentry-dotnet/pull/2696)) diff --git a/src/Sentry/DebugImage.cs b/src/Sentry/DebugImage.cs index 00c633aa23..afce6ab282 100644 --- a/src/Sentry/DebugImage.cs +++ b/src/Sentry/DebugImage.cs @@ -16,9 +16,8 @@ public sealed class DebugImage : IJsonSerializable /// /// Memory address, at which the image is mounted in the virtual address space of the process. - /// Should be a string in hex representation prefixed with "0x". /// - public string? ImageAddress { get; set; } + public long? ImageAddress { get; set; } /// /// The size of the image in virtual memory. @@ -60,7 +59,7 @@ public void WriteTo(Utf8JsonWriter writer, IDiagnosticLogger? logger) writer.WriteStartObject(); writer.WriteStringIfNotWhiteSpace("type", Type); - writer.WriteStringIfNotWhiteSpace("image_addr", ImageAddress); + writer.WriteStringIfNotWhiteSpace("image_addr", ImageAddress?.NullIfDefault()?.ToHexString()); writer.WriteNumberIfNotNull("image_size", ImageSize); writer.WriteStringIfNotWhiteSpace("debug_id", DebugId); writer.WriteStringIfNotWhiteSpace("debug_checksum", DebugChecksum); @@ -77,7 +76,7 @@ public void WriteTo(Utf8JsonWriter writer, IDiagnosticLogger? logger) public static DebugImage FromJson(JsonElement json) { var type = json.GetPropertyOrNull("type")?.GetString(); - var imageAddress = json.GetPropertyOrNull("image_addr")?.GetString(); + var imageAddress = json.GetPropertyOrNull("image_addr")?.GetHexAsLong(); var imageSize = json.GetPropertyOrNull("image_size")?.GetInt64(); var debugId = json.GetPropertyOrNull("debug_id")?.GetString(); var debugChecksum = json.GetPropertyOrNull("debug_checksum")?.GetString(); diff --git a/src/Sentry/SentryStackFrame.cs b/src/Sentry/SentryStackFrame.cs index b90f86f73f..9df19f15eb 100644 --- a/src/Sentry/SentryStackFrame.cs +++ b/src/Sentry/SentryStackFrame.cs @@ -224,7 +224,7 @@ public static SentryStackFrame FromJson(JsonElement json) var inApp = json.GetPropertyOrNull("in_app")?.GetBoolean(); var package = json.GetPropertyOrNull("package")?.GetString(); var platform = json.GetPropertyOrNull("platform")?.GetString(); - var imageAddress = json.GetPropertyOrNull("image_addr")?.GetHexAsLong() ?? 0; + var imageAddress = json.GetPropertyOrNull("image_addr")?.GetHexAsLong(); var symbolAddress = json.GetPropertyOrNull("symbol_addr")?.GetHexAsLong(); var instructionAddress = json.GetPropertyOrNull("instruction_addr")?.GetHexAsLong(); var addressMode = json.GetPropertyOrNull("addr_mode")?.GetString(); diff --git a/test/Sentry.Tests/ApiApprovalTests.Run.Core3_1.verified.txt b/test/Sentry.Tests/ApiApprovalTests.Run.Core3_1.verified.txt index 25b8f4f551..3419a81138 100644 --- a/test/Sentry.Tests/ApiApprovalTests.Run.Core3_1.verified.txt +++ b/test/Sentry.Tests/ApiApprovalTests.Run.Core3_1.verified.txt @@ -90,7 +90,7 @@ namespace Sentry public string? DebugChecksum { get; set; } public string? DebugFile { get; set; } public string? DebugId { get; set; } - public string? ImageAddress { get; set; } + public long? ImageAddress { get; set; } public long? ImageSize { get; set; } public string? Type { get; set; } public void WriteTo(System.Text.Json.Utf8JsonWriter writer, Sentry.Extensibility.IDiagnosticLogger? logger) { } diff --git a/test/Sentry.Tests/ApiApprovalTests.Run.DotNet6_0.verified.txt b/test/Sentry.Tests/ApiApprovalTests.Run.DotNet6_0.verified.txt index c869007fd7..7bb8107619 100644 --- a/test/Sentry.Tests/ApiApprovalTests.Run.DotNet6_0.verified.txt +++ b/test/Sentry.Tests/ApiApprovalTests.Run.DotNet6_0.verified.txt @@ -90,7 +90,7 @@ namespace Sentry public string? DebugChecksum { get; set; } public string? DebugFile { get; set; } public string? DebugId { get; set; } - public string? ImageAddress { get; set; } + public long? ImageAddress { get; set; } public long? ImageSize { get; set; } public string? Type { get; set; } public void WriteTo(System.Text.Json.Utf8JsonWriter writer, Sentry.Extensibility.IDiagnosticLogger? logger) { } diff --git a/test/Sentry.Tests/ApiApprovalTests.Run.DotNet7_0.verified.txt b/test/Sentry.Tests/ApiApprovalTests.Run.DotNet7_0.verified.txt index c869007fd7..7bb8107619 100644 --- a/test/Sentry.Tests/ApiApprovalTests.Run.DotNet7_0.verified.txt +++ b/test/Sentry.Tests/ApiApprovalTests.Run.DotNet7_0.verified.txt @@ -90,7 +90,7 @@ namespace Sentry public string? DebugChecksum { get; set; } public string? DebugFile { get; set; } public string? DebugId { get; set; } - public string? ImageAddress { get; set; } + public long? ImageAddress { get; set; } public long? ImageSize { get; set; } public string? Type { get; set; } public void WriteTo(System.Text.Json.Utf8JsonWriter writer, Sentry.Extensibility.IDiagnosticLogger? logger) { } diff --git a/test/Sentry.Tests/ApiApprovalTests.Run.Net4_8.verified.txt b/test/Sentry.Tests/ApiApprovalTests.Run.Net4_8.verified.txt index d1ed86a0e7..6724473aef 100644 --- a/test/Sentry.Tests/ApiApprovalTests.Run.Net4_8.verified.txt +++ b/test/Sentry.Tests/ApiApprovalTests.Run.Net4_8.verified.txt @@ -90,7 +90,7 @@ namespace Sentry public string? DebugChecksum { get; set; } public string? DebugFile { get; set; } public string? DebugId { get; set; } - public string? ImageAddress { get; set; } + public long? ImageAddress { get; set; } public long? ImageSize { get; set; } public string? Type { get; set; } public void WriteTo(System.Text.Json.Utf8JsonWriter writer, Sentry.Extensibility.IDiagnosticLogger? logger) { } diff --git a/test/Sentry.Tests/Protocol/DebugImageTests.cs b/test/Sentry.Tests/Protocol/DebugImageTests.cs index dd13dfc71c..40d181c0c8 100644 --- a/test/Sentry.Tests/Protocol/DebugImageTests.cs +++ b/test/Sentry.Tests/Protocol/DebugImageTests.cs @@ -15,7 +15,7 @@ public void SerializeObject_AllPropertiesSetToNonDefault_SerializesValidObject() var sut = new DebugImage { Type = "elf", - ImageAddress = "0xffffffff", + ImageAddress = 5, ImageSize = 1234, DebugId = "900f7d1b868432939de4457478f34720", DebugFile = "libc.debug", @@ -28,7 +28,7 @@ public void SerializeObject_AllPropertiesSetToNonDefault_SerializesValidObject() Assert.Equal(""" { "type": "elf", - "image_addr": "0xffffffff", + "image_addr": "0x5", "image_size": 1234, "debug_id": "900f7d1b868432939de4457478f34720", "debug_file": "libc.debug", diff --git a/test/Sentry.Tests/Protocol/ProfilerTests.ProfileInfo_Serialization.verified.txt b/test/Sentry.Tests/Protocol/ProfilerTests.ProfileInfo_Serialization.verified.txt index a9b12aa921..faac5c1682 100644 --- a/test/Sentry.Tests/Protocol/ProfilerTests.ProfileInfo_Serialization.verified.txt +++ b/test/Sentry.Tests/Protocol/ProfilerTests.ProfileInfo_Serialization.verified.txt @@ -8,7 +8,7 @@ debug_meta: { images: [ { - image_addr: 0xABCDEF + image_addr: 0x5 } ] }, diff --git a/test/Sentry.Tests/Protocol/ProfilerTests.verify.cs b/test/Sentry.Tests/Protocol/ProfilerTests.verify.cs index 34165209a9..7d58ea2435 100644 --- a/test/Sentry.Tests/Protocol/ProfilerTests.verify.cs +++ b/test/Sentry.Tests/Protocol/ProfilerTests.verify.cs @@ -82,7 +82,7 @@ public Task ProfileInfo_Serialization() sut.StartTimestamp = DateTimeOffset.UtcNow; sut.DebugMeta.Images = new List { new () { - ImageAddress = "0xABCDEF" + ImageAddress = 5 } }; sut.Profile = CreateSampleProfile();