Skip to content

Add debugger tip to section "Trace a Tree Creation Site" of the contributing guide #18098

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

Merged
merged 2 commits into from
Jun 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/_docs/contributing/issues/cause.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ the tree was generated by looking for its unique ID, and then generating a stack
3. Run the compiler with `-Ydebug-tree-with-id <tree-id>` flag. The compiler will print a stack trace
pointing to the creation site of the tree with the provided ID.

If you are using a debugger, you can add a breakpoint after `if ownId == debugId then` in method `allocateId` of `Positioned.scala` (you will still need the flag), this will allow you to navigate the stack with more ease.
Do not use a conditional breakpoint, the time overhead is very significant for a method called as often as this one.

### Enhanced Tree Printing

As seen above `-Xprint:<phase>` can be enhanced with further configuration flags, found in
Expand Down