Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: obsolete StackFrame.InstructionOffset #2689

Merged
merged 3 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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