diff --git a/CHANGELOG.md b/CHANGELOG.md index 01ad145e7b..9b15a6961c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,8 @@ API Changes: - ISpanContext was removed. Use ITraceContext instead. ([#2668](https://github.com/getsentry/sentry-dotnet/pull/2668)) - Removed IHasTransactionNameSource. Use ITransactionContext instead. ([#2654](https://github.com/getsentry/sentry-dotnet/pull/2654)) - Adding `Distribution` to `IEventLike` ([#2660](https://github.com/getsentry/sentry-dotnet/pull/2660)) +- 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)) ## Unreleased diff --git a/src/Sentry.Profiling/SampleProfileBuilder.cs b/src/Sentry.Profiling/SampleProfileBuilder.cs index 9e9b86f71a..1be7e7c4dc 100644 --- a/src/Sentry.Profiling/SampleProfileBuilder.cs +++ b/src/Sentry.Profiling/SampleProfileBuilder.cs @@ -178,11 +178,7 @@ private SentryStackFrame CreateStackFrame(CodeAddressIndex codeAddressIndex) } // TODO enable this once we implement symbolication (we will need to send debug_meta too), see StackTraceFactory. - // if (_traceLog.CodeAddresses.ILOffset(codeAddressIndex) is { } ilOffset && ilOffset >= 0) - // { - // frame.InstructionOffset = ilOffset; - // } - // else if (_traceLog.CodeAddresses.Address(codeAddressIndex) is { } address) + // if (_traceLog.CodeAddresses.Address(codeAddressIndex) is { } address) // { // frame.InstructionAddress = $"0x{address:x}"; // } diff --git a/src/Sentry/Internal/DebugStackTrace.cs b/src/Sentry/Internal/DebugStackTrace.cs index 056bfe010a..1d92182b50 100644 --- a/src/Sentry/Internal/DebugStackTrace.cs +++ b/src/Sentry/Internal/DebugStackTrace.cs @@ -232,8 +232,7 @@ private SentryStackFrame InternalCreateFrame(StackFrame stackFrame, bool demangl // See https://docs.microsoft.com/en-us/dotnet/framework/unmanaged-api/metadata/cortokentype-enumeration if (tokenType == 0x06000000) // CorTokenType.mdtMethodDef { - var recordId = token & 0x00ffffff; - frame.FunctionId = $"0x{recordId:x}"; + frame.FunctionId = token & 0x00ffffff; } } catch (InvalidOperationException) @@ -261,7 +260,7 @@ private SentryStackFrame InternalCreateFrame(StackFrame stackFrame, bool demangl var ilOffset = stackFrame.GetILOffset(); if (ilOffset != StackFrame.OFFSET_UNKNOWN) { - frame.InstructionAddress = $"0x{ilOffset:x}"; + frame.InstructionAddress = ilOffset; } var lineNo = stackFrame.GetFileLineNumber(); diff --git a/src/Sentry/Internal/Extensions/JsonExtensions.cs b/src/Sentry/Internal/Extensions/JsonExtensions.cs index 500cf71aaa..440426d6f0 100644 --- a/src/Sentry/Internal/Extensions/JsonExtensions.cs +++ b/src/Sentry/Internal/Extensions/JsonExtensions.cs @@ -29,9 +29,9 @@ internal static void ResetSerializerOptions() .AddDefaultConverters(); AltSerializerOptions = new JsonSerializerOptions - { - ReferenceHandler = ReferenceHandler.Preserve - } + { + ReferenceHandler = ReferenceHandler.Preserve + } .AddDefaultConverters(); } @@ -183,7 +183,7 @@ public static void Deconstruct(this JsonProperty jsonProperty, out string name, return double.Parse(json.ToString()!, CultureInfo.InvariantCulture); } - public static long? GetAddressAsLong(this JsonElement json) + public static long? GetHexAsLong(this JsonElement json) { // If the address is in json as a number, we can just use it. if (json.ValueKind == JsonValueKind.Number) diff --git a/src/Sentry/SentryStackFrame.cs b/src/Sentry/SentryStackFrame.cs index 9682e2176f..b90f86f73f 100644 --- a/src/Sentry/SentryStackFrame.cs +++ b/src/Sentry/SentryStackFrame.cs @@ -106,7 +106,7 @@ public sealed class SentryStackFrame : IJsonSerializable /// Optionally an address of the debug image to reference. /// If this is set and a known image is defined by debug_meta then symbolication can take place. /// - public long ImageAddress { get; set; } + public long? ImageAddress { get; set; } /// /// An optional address that points to a symbol. @@ -116,20 +116,9 @@ public sealed class SentryStackFrame : IJsonSerializable /// /// An optional instruction address for symbolication.
- /// This should be a string with a hexadecimal number that includes a 0x prefix.
/// If this is set and a known image is defined in the Debug Meta Interface, then symbolication can take place.
///
- public string? InstructionAddress { get; set; } - - /// - /// The instruction offset. - /// - /// - /// The official docs refer to it as 'The difference between instruction address and symbol address in bytes.' - /// In .NET this means the IL Offset within the assembly. - /// - [Obsolete("This property is unused and will be removed in the future.")] - public long? InstructionOffset { get; set; } + public long? InstructionAddress { get; set; } /// /// Optionally changes the addressing mode. The default value is the same as @@ -141,11 +130,9 @@ public sealed class SentryStackFrame : IJsonSerializable /// /// The optional Function Id.
- /// This is derived from the `MetadataToken`, and should be the record id - /// of a `MethodDef`.
- /// This should be a string with a hexadecimal number that includes a 0x prefix.
+ /// This is derived from the `MetadataToken`, and should be the record id of a `MethodDef`. ///
- public string? FunctionId { get; set; } + public long? FunctionId { get; set; } /// public void WriteTo(Utf8JsonWriter writer, IDiagnosticLogger? logger) @@ -166,14 +153,11 @@ public void WriteTo(Utf8JsonWriter writer, IDiagnosticLogger? logger) writer.WriteBooleanIfNotNull("in_app", InApp); writer.WriteStringIfNotWhiteSpace("package", Package); writer.WriteStringIfNotWhiteSpace("platform", Platform); - writer.WriteStringIfNotWhiteSpace("image_addr", ImageAddress.NullIfDefault()?.ToHexString()); - writer.WriteStringIfNotWhiteSpace("symbol_addr", SymbolAddress?.ToHexString()); - writer.WriteStringIfNotWhiteSpace("instruction_addr", InstructionAddress); -#pragma warning disable 0618 - writer.WriteNumberIfNotNull("instruction_offset", InstructionOffset); -#pragma warning restore 0618 + writer.WriteStringIfNotWhiteSpace("image_addr", ImageAddress?.NullIfDefault()?.ToHexString()); + writer.WriteStringIfNotWhiteSpace("symbol_addr", SymbolAddress?.NullIfDefault()?.ToHexString()); + writer.WriteStringIfNotWhiteSpace("instruction_addr", InstructionAddress?.ToHexString()); writer.WriteStringIfNotWhiteSpace("addr_mode", AddressMode); - writer.WriteStringIfNotWhiteSpace("function_id", FunctionId); + writer.WriteStringIfNotWhiteSpace("function_id", FunctionId?.ToHexString()); writer.WriteEndObject(); } @@ -240,12 +224,11 @@ 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")?.GetAddressAsLong() ?? 0; - var symbolAddress = json.GetPropertyOrNull("symbol_addr")?.GetAddressAsLong(); - var instructionAddress = json.GetPropertyOrNull("instruction_addr")?.GetString(); - var instructionOffset = json.GetPropertyOrNull("instruction_offset")?.GetInt64(); + var imageAddress = json.GetPropertyOrNull("image_addr")?.GetHexAsLong() ?? 0; + var symbolAddress = json.GetPropertyOrNull("symbol_addr")?.GetHexAsLong(); + var instructionAddress = json.GetPropertyOrNull("instruction_addr")?.GetHexAsLong(); var addressMode = json.GetPropertyOrNull("addr_mode")?.GetString(); - var functionId = json.GetPropertyOrNull("function_id")?.GetString(); + var functionId = json.GetPropertyOrNull("function_id")?.GetHexAsLong(); return new SentryStackFrame { @@ -266,9 +249,6 @@ public static SentryStackFrame FromJson(JsonElement json) ImageAddress = imageAddress, SymbolAddress = symbolAddress, InstructionAddress = instructionAddress, -#pragma warning disable 0618 - InstructionOffset = instructionOffset, -#pragma warning restore 0618 AddressMode = addressMode, FunctionId = functionId, }; diff --git a/test/Sentry.NLog.Tests/IntegrationTests.Simple.Core3_1.verified.txt b/test/Sentry.NLog.Tests/IntegrationTests.Simple.Core3_1.verified.txt index 8592621b82..b6eda23faa 100644 --- a/test/Sentry.NLog.Tests/IntegrationTests.Simple.Core3_1.verified.txt +++ b/test/Sentry.NLog.Tests/IntegrationTests.Simple.Core3_1.verified.txt @@ -47,12 +47,11 @@ InApp: false, Package: Sentry.NLog.Tests, Version=SCRUBBED, Culture=SCRUBBED, PublicKeyToken=SCRUBBED, Platform: null, - ImageAddress: 0, + ImageAddress: null, SymbolAddress: null, - InstructionAddress: ____, - InstructionOffset: null, + InstructionAddress: 1, AddressMode: rel:0, - FunctionId: ____ + FunctionId: 2 } ] }, @@ -80,7 +79,7 @@ Request: {}, Contexts: { trace: { - Operation: + Operation: } }, User: { diff --git a/test/Sentry.NLog.Tests/IntegrationTests.Simple.DotNet6_0.verified.txt b/test/Sentry.NLog.Tests/IntegrationTests.Simple.DotNet6_0.verified.txt index 8592621b82..b6eda23faa 100644 --- a/test/Sentry.NLog.Tests/IntegrationTests.Simple.DotNet6_0.verified.txt +++ b/test/Sentry.NLog.Tests/IntegrationTests.Simple.DotNet6_0.verified.txt @@ -47,12 +47,11 @@ InApp: false, Package: Sentry.NLog.Tests, Version=SCRUBBED, Culture=SCRUBBED, PublicKeyToken=SCRUBBED, Platform: null, - ImageAddress: 0, + ImageAddress: null, SymbolAddress: null, - InstructionAddress: ____, - InstructionOffset: null, + InstructionAddress: 1, AddressMode: rel:0, - FunctionId: ____ + FunctionId: 2 } ] }, @@ -80,7 +79,7 @@ Request: {}, Contexts: { trace: { - Operation: + Operation: } }, User: { diff --git a/test/Sentry.NLog.Tests/IntegrationTests.Simple.DotNet7_0.verified.txt b/test/Sentry.NLog.Tests/IntegrationTests.Simple.DotNet7_0.verified.txt index 8592621b82..b6eda23faa 100644 --- a/test/Sentry.NLog.Tests/IntegrationTests.Simple.DotNet7_0.verified.txt +++ b/test/Sentry.NLog.Tests/IntegrationTests.Simple.DotNet7_0.verified.txt @@ -47,12 +47,11 @@ InApp: false, Package: Sentry.NLog.Tests, Version=SCRUBBED, Culture=SCRUBBED, PublicKeyToken=SCRUBBED, Platform: null, - ImageAddress: 0, + ImageAddress: null, SymbolAddress: null, - InstructionAddress: ____, - InstructionOffset: null, + InstructionAddress: 1, AddressMode: rel:0, - FunctionId: ____ + FunctionId: 2 } ] }, @@ -80,7 +79,7 @@ Request: {}, Contexts: { trace: { - Operation: + Operation: } }, User: { diff --git a/test/Sentry.NLog.Tests/IntegrationTests.Simple.Mono4_0.verified.txt b/test/Sentry.NLog.Tests/IntegrationTests.Simple.Mono4_0.verified.txt index 5b4398486b..395db88fda 100644 --- a/test/Sentry.NLog.Tests/IntegrationTests.Simple.Mono4_0.verified.txt +++ b/test/Sentry.NLog.Tests/IntegrationTests.Simple.Mono4_0.verified.txt @@ -47,12 +47,11 @@ InApp: false, Package: Sentry.NLog.Tests, Version=SCRUBBED, Culture=SCRUBBED, PublicKeyToken=SCRUBBED, Platform: null, - ImageAddress: 0, + ImageAddress: null, SymbolAddress: null, - InstructionAddress: ____, - InstructionOffset: null, + InstructionAddress: 1, AddressMode: rel:0, - FunctionId: ____ + FunctionId: 2 } ] }, @@ -80,7 +79,7 @@ Request: {}, Contexts: { trace: { - Operation: + Operation: } }, User: { diff --git a/test/Sentry.NLog.Tests/IntegrationTests.Simple.Net4_8.verified.txt b/test/Sentry.NLog.Tests/IntegrationTests.Simple.Net4_8.verified.txt index 8592621b82..b6eda23faa 100644 --- a/test/Sentry.NLog.Tests/IntegrationTests.Simple.Net4_8.verified.txt +++ b/test/Sentry.NLog.Tests/IntegrationTests.Simple.Net4_8.verified.txt @@ -47,12 +47,11 @@ InApp: false, Package: Sentry.NLog.Tests, Version=SCRUBBED, Culture=SCRUBBED, PublicKeyToken=SCRUBBED, Platform: null, - ImageAddress: 0, + ImageAddress: null, SymbolAddress: null, - InstructionAddress: ____, - InstructionOffset: null, + InstructionAddress: 1, AddressMode: rel:0, - FunctionId: ____ + FunctionId: 2 } ] }, @@ -80,7 +79,7 @@ Request: {}, Contexts: { trace: { - Operation: + Operation: } }, User: { diff --git a/test/Sentry.Serilog.Tests/IntegrationTests.Simple.Core3_1.verified.txt b/test/Sentry.Serilog.Tests/IntegrationTests.Simple.Core3_1.verified.txt index e7b68e6710..c8e080c180 100644 --- a/test/Sentry.Serilog.Tests/IntegrationTests.Simple.Core3_1.verified.txt +++ b/test/Sentry.Serilog.Tests/IntegrationTests.Simple.Core3_1.verified.txt @@ -29,7 +29,7 @@ Request: {}, Contexts: { trace: { - Operation: + Operation: } }, User: { @@ -76,7 +76,7 @@ Request: {}, Contexts: { trace: { - Operation: + Operation: } }, User: { @@ -129,7 +129,7 @@ Request: {}, Contexts: { trace: { - Operation: + Operation: } }, User: { @@ -207,12 +207,11 @@ InApp: false, Package: Sentry.Serilog.Tests, Version=SCRUBBED, Culture=SCRUBBED, PublicKeyToken=SCRUBBED, Platform: null, - ImageAddress: 0, + ImageAddress: null, SymbolAddress: null, - InstructionAddress: ____, - InstructionOffset: null, + InstructionAddress: 1, AddressMode: rel:0, - FunctionId: ____ + FunctionId: 2 } ] }, @@ -243,7 +242,7 @@ Request: {}, Contexts: { trace: { - Operation: + Operation: } }, User: { diff --git a/test/Sentry.Serilog.Tests/IntegrationTests.Simple.DotNet6_0.verified.txt b/test/Sentry.Serilog.Tests/IntegrationTests.Simple.DotNet6_0.verified.txt index e7b68e6710..c8e080c180 100644 --- a/test/Sentry.Serilog.Tests/IntegrationTests.Simple.DotNet6_0.verified.txt +++ b/test/Sentry.Serilog.Tests/IntegrationTests.Simple.DotNet6_0.verified.txt @@ -29,7 +29,7 @@ Request: {}, Contexts: { trace: { - Operation: + Operation: } }, User: { @@ -76,7 +76,7 @@ Request: {}, Contexts: { trace: { - Operation: + Operation: } }, User: { @@ -129,7 +129,7 @@ Request: {}, Contexts: { trace: { - Operation: + Operation: } }, User: { @@ -207,12 +207,11 @@ InApp: false, Package: Sentry.Serilog.Tests, Version=SCRUBBED, Culture=SCRUBBED, PublicKeyToken=SCRUBBED, Platform: null, - ImageAddress: 0, + ImageAddress: null, SymbolAddress: null, - InstructionAddress: ____, - InstructionOffset: null, + InstructionAddress: 1, AddressMode: rel:0, - FunctionId: ____ + FunctionId: 2 } ] }, @@ -243,7 +242,7 @@ Request: {}, Contexts: { trace: { - Operation: + Operation: } }, User: { diff --git a/test/Sentry.Serilog.Tests/IntegrationTests.Simple.DotNet7_0.verified.txt b/test/Sentry.Serilog.Tests/IntegrationTests.Simple.DotNet7_0.verified.txt index e7b68e6710..c8e080c180 100644 --- a/test/Sentry.Serilog.Tests/IntegrationTests.Simple.DotNet7_0.verified.txt +++ b/test/Sentry.Serilog.Tests/IntegrationTests.Simple.DotNet7_0.verified.txt @@ -29,7 +29,7 @@ Request: {}, Contexts: { trace: { - Operation: + Operation: } }, User: { @@ -76,7 +76,7 @@ Request: {}, Contexts: { trace: { - Operation: + Operation: } }, User: { @@ -129,7 +129,7 @@ Request: {}, Contexts: { trace: { - Operation: + Operation: } }, User: { @@ -207,12 +207,11 @@ InApp: false, Package: Sentry.Serilog.Tests, Version=SCRUBBED, Culture=SCRUBBED, PublicKeyToken=SCRUBBED, Platform: null, - ImageAddress: 0, + ImageAddress: null, SymbolAddress: null, - InstructionAddress: ____, - InstructionOffset: null, + InstructionAddress: 1, AddressMode: rel:0, - FunctionId: ____ + FunctionId: 2 } ] }, @@ -243,7 +242,7 @@ Request: {}, Contexts: { trace: { - Operation: + Operation: } }, User: { diff --git a/test/Sentry.Serilog.Tests/IntegrationTests.Simple.Mono4_0.verified.txt b/test/Sentry.Serilog.Tests/IntegrationTests.Simple.Mono4_0.verified.txt index df00db54ed..5f6cedfc60 100644 --- a/test/Sentry.Serilog.Tests/IntegrationTests.Simple.Mono4_0.verified.txt +++ b/test/Sentry.Serilog.Tests/IntegrationTests.Simple.Mono4_0.verified.txt @@ -29,7 +29,7 @@ Request: {}, Contexts: { trace: { - Operation: + Operation: } }, User: { @@ -76,7 +76,7 @@ Request: {}, Contexts: { trace: { - Operation: + Operation: } }, User: { @@ -129,7 +129,7 @@ Request: {}, Contexts: { trace: { - Operation: + Operation: } }, User: { @@ -207,12 +207,11 @@ InApp: false, Package: Sentry.Serilog.Tests, Version=SCRUBBED, Culture=SCRUBBED, PublicKeyToken=SCRUBBED, Platform: null, - ImageAddress: 0, + ImageAddress: null, SymbolAddress: null, - InstructionAddress: ____, - InstructionOffset: null, + InstructionAddress: 1, AddressMode: rel:0, - FunctionId: ____ + FunctionId: 2 } ] }, @@ -243,7 +242,7 @@ Request: {}, Contexts: { trace: { - Operation: + Operation: } }, User: { diff --git a/test/Sentry.Serilog.Tests/IntegrationTests.Simple.Net4_8.verified.txt b/test/Sentry.Serilog.Tests/IntegrationTests.Simple.Net4_8.verified.txt index e7b68e6710..c8e080c180 100644 --- a/test/Sentry.Serilog.Tests/IntegrationTests.Simple.Net4_8.verified.txt +++ b/test/Sentry.Serilog.Tests/IntegrationTests.Simple.Net4_8.verified.txt @@ -29,7 +29,7 @@ Request: {}, Contexts: { trace: { - Operation: + Operation: } }, User: { @@ -76,7 +76,7 @@ Request: {}, Contexts: { trace: { - Operation: + Operation: } }, User: { @@ -129,7 +129,7 @@ Request: {}, Contexts: { trace: { - Operation: + Operation: } }, User: { @@ -207,12 +207,11 @@ InApp: false, Package: Sentry.Serilog.Tests, Version=SCRUBBED, Culture=SCRUBBED, PublicKeyToken=SCRUBBED, Platform: null, - ImageAddress: 0, + ImageAddress: null, SymbolAddress: null, - InstructionAddress: ____, - InstructionOffset: null, + InstructionAddress: 1, AddressMode: rel:0, - FunctionId: ____ + FunctionId: 2 } ] }, @@ -243,7 +242,7 @@ Request: {}, Contexts: { trace: { - Operation: + Operation: } }, User: { diff --git a/test/Sentry.Testing/VerifyExtensions.cs b/test/Sentry.Testing/VerifyExtensions.cs index 914f0165a8..68464cca9d 100644 --- a/test/Sentry.Testing/VerifyExtensions.cs +++ b/test/Sentry.Testing/VerifyExtensions.cs @@ -103,8 +103,8 @@ private class StackFrameConverter : WriteOnlyJsonConverter public override void Write(VerifyJsonWriter writer, SentryStackFrame obj) { - obj.FunctionId = ScrubAlphaNum(obj.FunctionId); - obj.InstructionAddress = ScrubAlphaNum(obj.InstructionAddress); + obj.FunctionId = obj.FunctionId is null ? null : 1; + obj.InstructionAddress = obj.InstructionAddress is null ? null : 2; obj.Package = obj.Package.Replace(PackageRegex, "=SCRUBBED"); if (RuntimeInfo.GetRuntime().IsMono()) diff --git a/test/Sentry.Tests/ApiApprovalTests.Run.Core3_1.verified.txt b/test/Sentry.Tests/ApiApprovalTests.Run.Core3_1.verified.txt index c3cf7fc093..bb2834b791 100644 --- a/test/Sentry.Tests/ApiApprovalTests.Run.Core3_1.verified.txt +++ b/test/Sentry.Tests/ApiApprovalTests.Run.Core3_1.verified.txt @@ -809,12 +809,10 @@ namespace Sentry public string? FileName { get; set; } public System.Collections.Generic.IList FramesOmitted { get; } public string? Function { get; set; } - public string? FunctionId { get; set; } - public long ImageAddress { get; set; } + public long? FunctionId { get; set; } + public long? ImageAddress { get; set; } public bool? InApp { get; set; } - public string? InstructionAddress { get; set; } - [System.Obsolete("This property is unused and will be removed in the future.")] - public long? InstructionOffset { get; set; } + public long? InstructionAddress { get; set; } public int? LineNumber { get; set; } public string? Module { get; set; } public string? Package { get; set; } diff --git a/test/Sentry.Tests/ApiApprovalTests.Run.DotNet6_0.verified.txt b/test/Sentry.Tests/ApiApprovalTests.Run.DotNet6_0.verified.txt index 3f754b380c..7c2dc23b39 100644 --- a/test/Sentry.Tests/ApiApprovalTests.Run.DotNet6_0.verified.txt +++ b/test/Sentry.Tests/ApiApprovalTests.Run.DotNet6_0.verified.txt @@ -810,12 +810,10 @@ namespace Sentry public string? FileName { get; set; } public System.Collections.Generic.IList FramesOmitted { get; } public string? Function { get; set; } - public string? FunctionId { get; set; } - public long ImageAddress { get; set; } + public long? FunctionId { get; set; } + public long? ImageAddress { get; set; } public bool? InApp { get; set; } - public string? InstructionAddress { get; set; } - [System.Obsolete("This property is unused and will be removed in the future.")] - public long? InstructionOffset { get; set; } + public long? InstructionAddress { get; set; } public int? LineNumber { get; set; } public string? Module { get; set; } public string? Package { get; set; } diff --git a/test/Sentry.Tests/ApiApprovalTests.Run.DotNet7_0.verified.txt b/test/Sentry.Tests/ApiApprovalTests.Run.DotNet7_0.verified.txt index 3f754b380c..7c2dc23b39 100644 --- a/test/Sentry.Tests/ApiApprovalTests.Run.DotNet7_0.verified.txt +++ b/test/Sentry.Tests/ApiApprovalTests.Run.DotNet7_0.verified.txt @@ -810,12 +810,10 @@ namespace Sentry public string? FileName { get; set; } public System.Collections.Generic.IList FramesOmitted { get; } public string? Function { get; set; } - public string? FunctionId { get; set; } - public long ImageAddress { get; set; } + public long? FunctionId { get; set; } + public long? ImageAddress { get; set; } public bool? InApp { get; set; } - public string? InstructionAddress { get; set; } - [System.Obsolete("This property is unused and will be removed in the future.")] - public long? InstructionOffset { get; set; } + public long? InstructionAddress { get; set; } public int? LineNumber { get; set; } public string? Module { get; set; } public string? Package { get; set; } diff --git a/test/Sentry.Tests/ApiApprovalTests.Run.Net4_8.verified.txt b/test/Sentry.Tests/ApiApprovalTests.Run.Net4_8.verified.txt index 6e824962ac..1ff0447115 100644 --- a/test/Sentry.Tests/ApiApprovalTests.Run.Net4_8.verified.txt +++ b/test/Sentry.Tests/ApiApprovalTests.Run.Net4_8.verified.txt @@ -808,12 +808,10 @@ namespace Sentry public string? FileName { get; set; } public System.Collections.Generic.IList FramesOmitted { get; } public string? Function { get; set; } - public string? FunctionId { get; set; } - public long ImageAddress { get; set; } + public long? FunctionId { get; set; } + public long? ImageAddress { get; set; } public bool? InApp { get; set; } - public string? InstructionAddress { get; set; } - [System.Obsolete("This property is unused and will be removed in the future.")] - public long? InstructionOffset { get; set; } + public long? InstructionAddress { get; set; } public int? LineNumber { get; set; } public string? Module { get; set; } public string? Package { get; set; } diff --git a/test/Sentry.Tests/Protocol/Exceptions/SentryStackFrameTests.cs b/test/Sentry.Tests/Protocol/Exceptions/SentryStackFrameTests.cs index f36cee2514..8b444ca209 100644 --- a/test/Sentry.Tests/Protocol/Exceptions/SentryStackFrameTests.cs +++ b/test/Sentry.Tests/Protocol/Exceptions/SentryStackFrameTests.cs @@ -30,10 +30,7 @@ public void SerializeObject_AllPropertiesSetToNonDefault_SerializesValidObject() Platform = "Platform", ImageAddress = 3, SymbolAddress = 4, -#pragma warning disable 0618 - InstructionOffset = 5, -#pragma warning restore 0618 - InstructionAddress = "0xffffffff", + InstructionAddress = 5, AddressMode = "rel:0" }; @@ -66,8 +63,7 @@ public void SerializeObject_AllPropertiesSetToNonDefault_SerializesValidObject() "platform": "Platform", "image_addr": "0x3", "symbol_addr": "0x4", - "instruction_addr": "0xffffffff", - "instruction_offset": 5, + "instruction_addr": "0x5", "addr_mode": "rel:0" } """,