Discussion:
Java debug information
Jesse Eichar
13 years ago
Permalink
Hi,

I was using milestone 7 and I just tried out the milestone9-snapshot. When
I was running jetty I attached a debugger and the debug information was all
missing. Is this expected behaviour? milestone 7 worked as expected but 9
does not have the debug information.

Jesse
Peter Niederwieser
13 years ago
Permalink
Post by Jesse Eichar
I was using milestone 7 and I just tried out the milestone9-snapshot.
When
I was running jetty I attached a debugger and the debug information was all
missing. Is this expected behaviour?
I'm not aware of any changes in this regard. Can you try with a clean
rebuild? Can you also try with `tasks.withType(Compile) { options.useAnt =
true }`?

--
Peter Niederwieser
Principal Engineer, Gradleware
http://gradleware.com
Creator, Spock Framework
http://spockframework.org
Twitter: @pniederw



--
View this message in context: http://gradle.1045684.n5.nabble.com/Java-debug-information-tp5547368p5548324.html
Sent from the gradle-user mailing list archive at Nabble.com.
Jesse Eichar
13 years ago
Permalink
I did a clean build. Deleted the $HOME/.gradle and the $PROJECT/.gradle
directories then ran the jettyRun task again. No debug information. Then
I added

tasks.withType(Compile) { options.useAnt =
true }

to allProject {...}

and the debug information is back.

Should I file a bug report?

jesse
...
Adam Murdoch
13 years ago
Permalink
I did a clean build. Deleted the $HOME/.gradle and the $PROJECT/.gradle directories then ran the jettyRun task again. No debug information. Then I added
tasks.withType(Compile) { options.useAnt =
true }
to allProject {...}
and the debug information is back.
Should I file a bug report?
Yes, please.
...
--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com
Peter Niederwieser
13 years ago
Permalink
I assume you were already doing something like:

tasks.withType(Compile) { options.debugOptions.debugLevel =
"source,lines,vars" }

(Without that, you should get debug information for source and lines, but
not for local variables.)

The new Java compiler integration in m9 doesn't honor
options.debugOptions.debugLevel yet. This is a bug. The workaround is:

tasks.withType(Compile) { options.compilerArgs = ["-g:source,lines,vars"] }

Without that, you should still get debug information for source and lines,
but not for local variables.

--
Peter Niederwieser
Principal Engineer, Gradleware
http://gradleware.com
Creator, Spock Framework
http://spockframework.org
Twitter: @pniederw







--
View this message in context: http://gradle.1045684.n5.nabble.com/Java-debug-information-tp5547368p5548944.html
Sent from the gradle-user mailing list archive at Nabble.com.
Jesse Eichar
13 years ago
Permalink
Post by Peter Niederwieser
tasks.withType(Compile) { options.debugOptions.debugLevel =
"source,lines,vars" }
In fact I was not doing even this. The defaults before (I assume in the
ant compiler) gave be these and I assumed they would stay the defaults
since ant, maven and even SBT all have those as defaults. I guess you
would need an option to disable debug information if you made this the
defaults.
Post by Peter Niederwieser
(Without that, you should get debug information for source and lines, but
not for local variables.)
The new Java compiler integration in m9 doesn't honor
tasks.withType(Compile) { options.compilerArgs = ["-g:source,lines,vars"] }
Without that, you should still get debug information for source and lines,
but not for local variables.
<http://gradleware.com>
That is exactly right. I currently get line and source debug information
but no var information.

Jesse
Peter Niederwieser
13 years ago
Permalink
I found one problem, namely that manually overriding the default debugOptions
didn't take effect (instead options.compilerArgs had to be used). That's
already fixed. However, I can't reproduce what you are saying about
useAnt=true. Even with that I only get source and line but not local
variable debug information. That's also what the Ant docs say. It's also the
default for the javac command line compiler.

--
Peter Niederwieser
Principal Engineer, Gradleware
http://gradleware.com
Creator, Spock Framework
http://spockframework.org
Twitter: @pniederw

--
View this message in context: http://gradle.1045684.n5.nabble.com/Java-debug-information-tp5547368p5553984.html
Sent from the gradle-user mailing list archive at Nabble.com.

Continue reading on narkive:
Loading...