Re: Way to tell if a *.class file was compile with "-g" or not?
[email protected] Fri, 13 Jan 2006 14:16:43 -0800 (PST)
| Newsgroups | gmane.comp.java.jswat.user |
|---|---|
| Message-ID | <[email protected]> |
There is no specific API for this in the Java Debug Interface, but there
are round-about methods for determining if a particular method has local
variable information or not. One way to enable this in JSwat would be to
scan for non-native methods in a class and check if any of them have loca=
l
variables or not. If AbsentInformationException is thrown, then it means
that the class was not compiled with -g.
The other way is to invoke "javap -l classname" and it will show a
"LocalVariableTable:" line if compiled with javac -g. If that line is
missing, it was not compiled with -g, or was compiled with
-g:{lines,source} instead.
If you would like such a feature in JSwat, let me know, or enter it in th=
e
bug database.
Thanks
n
James Wilson wrote:
> Is there a tool or class I could use to determine how a *.class file is
> compiled (specifically if it has debug info in it or not)? It seems to
> me that JSwat might use such functionality. I have been trying all day
> to determine this about some class files, and I am at a loss...
>
> Jimmy