Skip to content

Commit

Permalink
chore: obsolete StackFrame.InstructionOffset (#2689)
Browse files Browse the repository at this point in the history
  • Loading branch information
vaind committed Oct 3, 2023
1 parent bf4e0b3 commit 8cd3194
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Obsoletion

- `WithScope` and `WithScopeAsync` have been proven to not work correctly in desktop contexts when using a global scope. They are now deprecated in favor of the overloads of `CaptureEvent`, `CaptureMessage`, and `CaptureException`. Those methods provide a callback to a configurable scope. ([#2677](https://github.com/getsentry/sentry-dotnet/pull/2677))
- `StackFrame.InstructionOffset` has not been used in the SDK and has been ignored on the server for years. ([#2689](https://github.com/getsentry/sentry-dotnet/pull/2689))

### Features

Expand Down
5 changes: 5 additions & 0 deletions src/Sentry/SentryStackFrame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public sealed class SentryStackFrame : IJsonSerializable
/// 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.
/// </remarks>
[Obsolete("This property is unused and will be removed in the future.")]
public long? InstructionOffset { get; set; }

/// <summary>
Expand Down Expand Up @@ -168,7 +169,9 @@ public void WriteTo(Utf8JsonWriter writer, IDiagnosticLogger? logger)
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("addr_mode", AddressMode);
writer.WriteStringIfNotWhiteSpace("function_id", FunctionId);

Expand Down Expand Up @@ -263,7 +266,9 @@ 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,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,7 @@ namespace Sentry
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 int? LineNumber { get; set; }
public string? Module { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,7 @@ namespace Sentry
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 int? LineNumber { get; set; }
public string? Module { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,7 @@ namespace Sentry
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 int? LineNumber { get; set; }
public string? Module { get; set; }
Expand Down
1 change: 1 addition & 0 deletions test/Sentry.Tests/ApiApprovalTests.Run.Net4_8.verified.txt
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,7 @@ namespace Sentry
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 int? LineNumber { get; set; }
public string? Module { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ public void SerializeObject_AllPropertiesSetToNonDefault_SerializesValidObject()
Platform = "Platform",
ImageAddress = 3,
SymbolAddress = 4,
#pragma warning disable 0618
InstructionOffset = 5,
#pragma warning restore 0618
InstructionAddress = "0xffffffff",
AddressMode = "rel:0"
};
Expand Down

0 comments on commit 8cd3194

Please sign in to comment.