3
votes

I'm using IntelliJ IDEA 14.1.5 to step through a Java program that calls methods in a third party jar (JTidy).

The source for this jar is attached; if I highlight one of its methods and press ctrl-B to go to its declaration, IDEA goes there correctly.

I set a breakpoint within this method, on a statement I know is executing.

I turned off all stepping filters under Settings > Build, Execution Deployment > Debugger > Stepping.

Stepping into methods in the JCL, such as java.lang.String.append(), works properly.

Stepping into this third party jar, however, will not work. Even Force Step Into does not work. The breakpoint within that code also doesn't work; the whole method is treated as a Step Over, which means I can't look at the exact point in the process I need to inspect.

What do I have to check to get this working? It's plausible that attaching the source would not necessarily enable debugging on that code, except that there is at least one other answer on another SO question that suggests that this should work. So does a Tip in IntelliJ's documentation on debugging.

1
Hint: I think such specific product bug type of questions rarely get good answers here. I would rather suggest to turn to some JetBrain forum or bug tracker instead. You see, in the end IntelliJ is some product owned by people who might have A) more insight B) plenty of motivation and C) the means to fix that potential bug.GhostCat
Fair point. One reason for my asking it here is in hopes that it's not product-specific, and not a bug, but rather some general detail I'm missing. ...For example, I strongly believe this jar was not compiled with debugging information turned on; however, I'm given the impression that this won't stop debuggers from going in there anyway - IDEA 13 and later, for example, is apparently able to make some educated guesses given that it has both bytecode and source.Paul Brinkley

1 Answers

1
votes

I tried putting a breakpoint inside jTidy code using this code: https://github.com/ajorpheus/simple-maven-testbed (and specifically this commit).

Intellij Build Info:

IntelliJ IDEA 2016.3
Build #IU-163.7743.44, built on November 17, 2016
JRE: 1.8.0_112-release-408-b2 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

The dependency I used was:

    <dependency>
        <groupId>jtidy</groupId>
        <artifactId>jtidy</artifactId>
        <version>r820</version>
    </dependency>

And I had no problems with the breakpoint being hit as seen below: enter image description here

I thought that it was worth noting that the documentation link in your post is for v. 2016.2 and the other link is as recent as August, 2016. My first impression was that this might have to do with the Intellij IDEA version that you are using, however, this seems to suggest that stepping into decompiled third party code should be supported in 14.1.5 as well.

Is it worth you checking my code with your version of Intellij ?