Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / September 2005

Tip: Looking for answers? Try searching our database.

How to detect if class file contains debug symbols?

Thread view: 
thecrow - 27 Sep 2005 21:42 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.

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.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.