This is indeed a problem, but is not IDEA's bug. In this particular case breakpoint request gets added (notice brekpoint's icon change while executing the program), but breakpoint event is never generated by the debuggee VM. IDEA receives only VMDeath and VMDisconnected events.
-- Best regards, Eugene Zhuravlev Software Developer JetBrains Inc. http://www.jetbrains.com "Develop with pleasure!"
This is indeed a problem, but is not IDEA's bug. In this particular case breakpoint request gets added (notice brekpoint's icon change while executing the program), but breakpoint event is never generated by the debuggee VM. IDEA receives only VMDeath and VMDisconnected events.
But Eclipse IDE is working fine in this test case. The breakpoint is working. So, I would say it's not a JVM problem.
>> are you using the same VM in both cases ? DK> Yes, VMs are the same for IDEA and Eclipse projects. I've tried jdk DK> 1.6.0 and 1.6.0_01. Eclipse works fine with given TestCase, IDEA is DK> not.
And the same compiler? I wouldn't wonder that the eclipse compiler didn't generate the same debugging info than the sun compiler.
An idea is putting the test inside a jar and try debugging it in both Idea and Eclipse.
And the same compiler? I wouldn't wonder that the eclipse compiler didn't generate the same debugging info than the sun compiler.
I have not find a way to use javac in Eclipse. So probably Eclipse is compiling a TestCase with its own compiler. But I've checked a TestCase with Netbeans 6.1 - it works, break point is fired. I do believe Netbeans is using javac :)
Ater investigation I've found the reason. First of all, Carlos was right - the differences in behaviour of IDEA and Eclipse are due to the different compilers. Both IDEs do not stop at the breakpoint if the classfile was generated by javac and hit the breakpoint if the classfile was generated by eclipse compiler.
The differences in IDEA and Netbeans are in the way breakpoint requests are created. IDEA creates request for the proper line, but for the "wrong" instruction. This instruction is incorrectly attributed by javac to the line of interest, but in fact the control flow does not reach the location if exception was thrown. Eclipse compiler does better job here by attributing instructions to proper lines.
We've added the code that makes IDEA insensitive to such things so the behaviour now is just as in Netbeans. Thanks for drawing our attention to the issue.
-- Best regards, Eugene Zhuravlev Software Developer JetBrains Inc. http://www.jetbrains.com "Develop with pleasure!"
We've made an experiment. Created a project with code given in the first post. Compiled it with maven, ==> javac. The resulting jar (with sources) was attached to eclipse project as a dependency. So eclipse could not recompile it. And the code in a ".jar" was called from eclipse project. The breakpoint is still working :)
Are you sure there were no eclipse-compiled classes in the claspath? You could do much simplier experiment - just compile the code from the command line with javac and replace with the resulting class the one that is located in eclipse's output directory. No jarring, attaching of additional libraries or maven is required. Also please note that eclipse stops there twice: onece because of exception breakpoint and another time because of the line breakpoint. If the code is compiled by javac, it stops only because of exception breakpoint.
-- Best regards, Eugene Zhuravlev Software Developer JetBrains Inc. http://www.jetbrains.com "Develop with pleasure!"
We've made an experiment. Created a project with code given in the first post. Compiled it with maven, ==> javac. The resulting jar (with sources) was attached to eclipse project as a dependency. So eclipse could not recompile it. And the code in a ".jar" was called from eclipse project. The breakpoint is still working :)
This is indeed a problem, but is not IDEA's bug. In this particular case breakpoint request gets added (notice brekpoint's icon
change while executing the program), but breakpoint event is never generated by the debuggee VM. IDEA receives only VMDeath and
VMDisconnected events.
--
Best regards,
Eugene Zhuravlev
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"
But Eclipse IDE is working fine in this test case. The breakpoint is working.
So, I would say it's not a JVM problem.
W BR,
Dmitry.
are you using the same VM in both cases ?
Yes, VMs are the same for IDEA and Eclipse projects.
I've tried jdk 1.6.0 and 1.6.0_01. Eclipse works fine with given TestCase, IDEA is not.
Will check this and come back with results. Thanks for the info.
--
Best regards,
Eugene Zhuravlev
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"
>>
>> are you using the same VM in both cases ?
DK> Yes, VMs are the same for IDEA and Eclipse projects. I've tried jdk
DK> 1.6.0 and 1.6.0_01. Eclipse works fine with given TestCase, IDEA is
DK> not.
And the same compiler? I wouldn't wonder that the eclipse compiler didn't
generate the same debugging info than the sun compiler.
An idea is putting the test inside a jar and try debugging it in both Idea
and Eclipse.
Carlos
I have not find a way to use javac in Eclipse.
So probably Eclipse is compiling a TestCase with its own compiler.
But I've checked a TestCase with Netbeans 6.1 - it works, break point is fired.
I do believe Netbeans is using javac :)
W BR,
Dmitry
Ater investigation I've found the reason.
First of all, Carlos was right - the differences in behaviour of IDEA and Eclipse are due to the different compilers. Both IDEs do
not stop at the breakpoint if the classfile was generated by javac and hit the breakpoint if the classfile was generated by eclipse
compiler.
The differences in IDEA and Netbeans are in the way breakpoint requests are created. IDEA creates request for the proper line, but
for the "wrong" instruction. This instruction is incorrectly attributed by javac to the line of interest, but in fact the control
flow does not reach the location if exception was thrown. Eclipse compiler does better job here by attributing instructions to
proper lines.
We've added the code that makes IDEA insensitive to such things so the behaviour now is just as in Netbeans.
Thanks for drawing our attention to the issue.
--
Best regards,
Eugene Zhuravlev
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"
We've made an experiment.
Created a project with code given in the first post.
Compiled it with maven, ==> javac.
The resulting jar (with sources) was attached to eclipse project as a dependency. So eclipse could not recompile it.
And the code in a ".jar" was called from eclipse project.
The breakpoint is still working :)
W BR,
Dmitry
Are you sure there were no eclipse-compiled classes in the claspath? You could do much simplier experiment - just compile the code
from the command line with javac and replace with the resulting class the one that is located in eclipse's output directory. No
jarring, attaching of additional libraries or maven is required. Also please note that eclipse stops there twice: onece because of
exception breakpoint and another time because of the line breakpoint. If the code is compiled by javac, it stops only because of
exception breakpoint.
--
Best regards,
Eugene Zhuravlev
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"
"Dmitry Kirillov" <no_reply@jetbrains.com> wrote in message news:16771912.55701214564123380.JavaMail.jive@app4.labs.intellij.net...
>