I'm looking for a technique to tell if a class file contains debug
symbols (meaning that it was built with the -g flag enabled). The
simpler the technique, the better.
We aren't getting line numbers in our stack traces and are trying to
determine why. Thus, the first thing we'd like to check is whether any
debug symbols ended up in the class file at all.
As added info, here's what we are using in Ant, in case it's an Ant
error.
<javac srcdir="${app.source.dirs}" fork="yes"
memoryMaximumSize="512m"
debug="on"
executable="${app.gemstonejava.dir}/bin/javac"
bootclasspath="${app.bootclasspath}"
classpath="${app.classpath}"
destdir="${app.classes.dir}">
<compilerarg value="-g:lines">
</compilerarg>
</javac>
Roedy Green - 27 Sep 2005 23:17 GMT
>I'm looking for a technique to tell if a class file contains debug
>symbols (meaning that it was built with the -g flag enabled). The
>simpler the technique, the better.
see http://mindprod.com/jgloss/jasm.html
for libraries for reading and modifying class files.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
jessu - 28 Sep 2005 04:56 GMT
Change
>> <compilerarg value="-g:lines">
to
<compilerarg value="-g:none">
-------
FeedFeeds : A new way to read news and blogs!
http://www.feedfeeds.com
thecrow - 28 Sep 2005 15:07 GMT
We want the line numbers to appear in the exception. Doesn't -g:none
eliminate all debug symbols?
Roedy Green - 28 Sep 2005 08:01 GMT
> <compilerarg value="-g:lines">
> </compilerarg>
not a big issue, but you can collapse that:
<javac source="1.5" target="1.5" srcdir="${package.dir}"
sourcepath="${basedir}" debug="on">
<compilerarg value="-Xlint:unchecked" />
<compilerarg value="-Xlint:fallthrough" />
</javac>

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.