From 43d850b6df64d801d53013d17eea2baef646ad4d Mon Sep 17 00:00:00 2001 From: Quentin Bernet Date: Thu, 29 Jun 2023 15:50:32 +0200 Subject: [PATCH 1/2] Add debugger tip to section "Trace a Tree Creation Site" of the contributing guide [Cherry-picked efa92032496c7daacd211ae3f6164394c890426a] --- docs/_docs/contributing/issues/cause.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/_docs/contributing/issues/cause.md b/docs/_docs/contributing/issues/cause.md index 002dd69135f0..34ef0fe583ed 100644 --- a/docs/_docs/contributing/issues/cause.md +++ b/docs/_docs/contributing/issues/cause.md @@ -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 ` 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 in the `ownId == debugId` section of 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:` can be enhanced with further configuration flags, found in From f228d5f41d2a4eefb8201ad630a1e95bc16d1a12 Mon Sep 17 00:00:00 2001 From: Quentin Bernet Date: Thu, 29 Jun 2023 16:05:21 +0200 Subject: [PATCH 2/2] Fix cause.md [Cherry-picked ebca289d0fd8dc398d55644a7a252d24c4e05b65] --- docs/_docs/contributing/issues/cause.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_docs/contributing/issues/cause.md b/docs/_docs/contributing/issues/cause.md index 34ef0fe583ed..385c72dc8738 100644 --- a/docs/_docs/contributing/issues/cause.md +++ b/docs/_docs/contributing/issues/cause.md @@ -38,7 +38,7 @@ the tree was generated by looking for its unique ID, and then generating a stack 3. Run the compiler with `-Ydebug-tree-with-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 in the `ownId == debugId` section of method `allocateId` of `Positioned.scala` (you will still need the flag), this will allow you to navigate the stack with more ease. +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