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

Use compiler source map directly in forc-debug #6872

Merged
merged 5 commits into from
Jan 30, 2025

Conversation

JoshuaBatty
Copy link
Member

@JoshuaBatty JoshuaBatty commented Jan 30, 2025

Description

Replace the custom HashMap-based source map implementation in forc-debug with the compiler's source map format directly. This simplifies our source mapping logic and maintains better consistency with the compiler's source location tracking, while preserving all existing functionality.

Key changes:

  • Remove custom source map types and use compiler's SourceMap
  • Simplify breakpoint verification using compiler spans
  • Add test to verify source map instruction-to-line mappings

closes #6733

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@JoshuaBatty JoshuaBatty requested a review from a team as a code owner January 30, 2025 05:05
@JoshuaBatty JoshuaBatty self-assigned this Jan 30, 2025
@JoshuaBatty JoshuaBatty added the forc-debug Everything related to forc-debug label Jan 30, 2025
@JoshuaBatty JoshuaBatty marked this pull request as draft January 30, 2025 05:06
@JoshuaBatty JoshuaBatty marked this pull request as ready for review January 30, 2025 05:41
@JoshuaBatty JoshuaBatty requested a review from a team January 30, 2025 06:49
alfiedotwtf
alfiedotwtf previously approved these changes Jan 30, 2025
@JoshuaBatty JoshuaBatty requested a review from a team January 30, 2025 11:05
sdankel
sdankel previously approved these changes Jan 30, 2025
Copy link
Member

@sdankel sdankel left a comment

Choose a reason for hiding this comment

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

Looks good to me 🚀 Just left one comment on what Kaya pointed out. It could be done in a future PR.

@JoshuaBatty JoshuaBatty enabled auto-merge (squash) January 30, 2025 21:41
@JoshuaBatty JoshuaBatty merged commit f0ed57a into master Jan 30, 2025
39 checks passed
@JoshuaBatty JoshuaBatty deleted the josh/forc_debug_source_maps branch January 30, 2025 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forc-debug Everything related to forc-debug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace the current source map implementation with the source maps produced from the compiler.
5 participants