Skip to content

Conversation

@rcj1
Copy link
Contributor

@rcj1 rcj1 commented Jan 31, 2026

Testing on #122722 revealed some issues with #123333 so I am fixing these here.

After #123333 there remain two error cases:

  1. Our IL offset is greater than the previously found offset, but lower than the max found offset. In this case, we would like to advance the line number in accordance with the new IL offset, which was omitted after [NativeAOT] Source to native mapping fix for out-of-order code #123333.
  2. Our IL offset is greater than the highest IL offset for which there exists a sequence point. In this case, we want to ensure we can create a native <-> line mapping - [NativeAOT] Source to native mapping fix for out-of-order code #123333 had left these IL offsets with a Document of null, meaning no mappings were possible.
    This fixes both of these issues.

Before:
Screenshot 2026-01-30 192451
Screenshot 2026-01-30 192408

After:
Screenshot 2026-01-30 190332
Screenshot 2026-01-30 190613
foo.txt
foo2.txt
New Compressed (zipped) Folder.zip

@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib
See info in area-owners.md if you want to be subscribed.

@rcj1 rcj1 requested a review from jkotas January 31, 2026 02:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refines NativeAOT’s IL-to-native sequence point mapping to close gaps found after #123333, ensuring more accurate source line attribution in stack traces, especially for runtime-async scenarios described in #122722.

Changes:

  • Extend propagation of the last known document/line info across the entire temporary sequencePoints buffer so IL offsets beyond the last explicit sequence point still get a valid document/line mapping.
  • Replace the per-iteration previousIlOffset tracking with a maxIlOffset tracker and adjust the emission condition so sequence points are produced both when backed by PDB info and whenever the IL offset falls within or below the maximum IL offset seen so far, fixing cases where IL offsets re-enter earlier ranges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant