groovy
  1. groovy
  2. GROOVY-5208

Incorrect line numbers in code using optimized primitive operations

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta-1
    • Fix Version/s: 1.8.7, 2.0.1
    • Component/s: bytecode
    • Labels:
      None
    • Number of attachments :
      0

      Description

      The visible problem is that debugger doesn't stop on the lines containing only primitive value operations. See more details in http://youtrack.jetbrains.net/issue/IDEA-77107.

        Issue Links

          Activity

          Hide
          Jason Anderson added a comment -

          This isn't Grails specific. We have plain old Groovy unit tests run in IntelliJ + JUnit launcher, if you try to debug them, set breakpoints, the breakpoints do not get hit.

          It comes down to groovyc needs to generate bytecode that can be understood/debugged by current versions of JDK (eg 6+). This should not be a mystery in terms of how to test it. (the example is above in original report).

          Show
          Jason Anderson added a comment - This isn't Grails specific. We have plain old Groovy unit tests run in IntelliJ + JUnit launcher, if you try to debug them, set breakpoints, the breakpoints do not get hit. It comes down to groovyc needs to generate bytecode that can be understood/debugged by current versions of JDK (eg 6+). This should not be a mystery in terms of how to test it. (the example is above in original report).
          Hide
          Andrew Eisenberg added a comment -

          Same behavior in Groovy-Eclipse.

          Show
          Andrew Eisenberg added a comment - Same behavior in Groovy-Eclipse.
          Hide
          blackdrag blackdrag added a comment -

          there is actually one very simple possibility I haven't included yet and that is that the groovy compiler simply emits labels with a wrong line number. Peter mentioned GROOVY-4063, but that is about something not working in 1.6 already. That surely is not related to primtive optimizations at all. And it might be, that it is just the same here.

          Show
          blackdrag blackdrag added a comment - there is actually one very simple possibility I haven't included yet and that is that the groovy compiler simply emits labels with a wrong line number. Peter mentioned GROOVY-4063 , but that is about something not working in 1.6 already. That surely is not related to primtive optimizations at all. And it might be, that it is just the same here.
          Hide
          blackdrag blackdrag added a comment -

          After looking at the bytecode of the example in GROOVY-4063 I actually found an error. It seems we don't generate a line number information for simple method calls in the fast path.

          Show
          blackdrag blackdrag added a comment - After looking at the bytecode of the example in GROOVY-4063 I actually found an error. It seems we don't generate a line number information for simple method calls in the fast path.
          Hide
          blackdrag blackdrag added a comment -

          I fixed the issue I found through GROOVY-4063 and I think it fixes this issue here. But since GROOVY-4063 is reported for pre 1.8 I guess it is a different thing there actually. Please reopen if needed

          Show
          blackdrag blackdrag added a comment - I fixed the issue I found through GROOVY-4063 and I think it fixes this issue here. But since GROOVY-4063 is reported for pre 1.8 I guess it is a different thing there actually. Please reopen if needed

            People

            • Assignee:
              blackdrag blackdrag
              Reporter:
              Peter Gromov
            • Votes:
              9 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: