Unable to set breakpoints

please excuse again that I post it here, not in tracker...

I experience this very often, both in #1183 and #2013
and it is VERY annoying:

I set some breakpoints, then hit debug, and as soon as
the app is running, the breakpoints get crossed out.
The breakpoints ARE at valid positions, like beginning
of for loop etc.

I do recompile, even rebuild project, because I suspected
the ant script compiling without debug flag... but also
when project is rebuilt it does not change.

In some cases I'm "lucky" when I do recompile while
the app is running-> hot swap works, and then the
breakpoints work too!!
But in my current case, recompile + hotswap tells me
that the VM does not support that schema change.

And I cannot set that *$§%& breakpoints...

Let me know if I can do something to track this down...
Thank you.


4 comments
Comment actions Permalink

hm, is this a feature ?!

is it impossible to set a breakpoint in the following situation:
the project has two modules A and B.
B depends on A.
I set breakpoints in A.
I run with a debug configuration that uses "classpath and JDK of module B". JDK is same for both modules. Classpath differs in some library jars, but the relevant source code from module A (where I want to set breakpoints) should of course be in classpath for B, as B depends on A.

Do I have to hit some extra checkbox somewhere to
be able to set breakpoints in A?

Thanks again for any help...
M.

0
Comment actions Permalink

update: after adding debug="true" to the ant javac-target
I am able to set the breakpoint.

What exactly is "rebuild project" doing?

0
Comment actions Permalink

ok, to answer one of my questions:
rebuild project does NOT clear the .class files if
the checkbox "clear output directory on rebuild" is
not checked.
I understand that this is not enabled by default, as it
could delete some files one might want to keep.

But for that case I really would like to see a "Build->Clear Output Directory/ies" menu item.

Another option for making users life easier for the problem I describe: show a tooltip on the crossed out breakpoint,
stating "the class file lacks debug information."

Or, even better: as IDEA can obviously determine (when running debug configuration) that the debug info lacks in the .class file -> why not delete the .class and recompile it, so that the debug information will be there?
--> This would be convenient ;)

Summary: my problem was the non-ability to set breakpoints for classes that were compiled by ant script without debug info. Project rebuild did not fix the problem, as I had "clear output dirs" non-checked.

M.

0
Comment actions Permalink

one more remark:

when "clear output dir.." is disabled,
you could still delete the .class files on a rebuild.

I expect "rebuild all" to do what the name implies,
and that includes first deleting the old build - right?


0

Please sign in to leave a comment.