-
Enhancement
-
Resolution: Won't Fix
-
P4
-
None
-
1.4.2
-
generic
-
generic
Name: kbR10066 Date: 04/07/2003
Java compiler does not generate any source code mapping information
for native and abstract methods. However this information would be desirable for
debugger/profiler tools. For example, Sun internal Java code coverage tool
(JCov) is currently unable to locate native/abstract methods in the source due
to the lack of the requested feature in Javac.
Since abstract and native methods have no "Code" attribute, they can not have
usual "LineNumberTable" code's attribute. Instead, some new method-level attribute could be
introduced for such methods to implement this rfe.
To reproduce, do the following (see a.java at the bottom):
1. compile a.java
% <JDK1.4.2>/javac -Xjcov a.java
2. decode the class file with JCoder (JCK utility which comes with JavaTest product)
% java -cp <JavaTest>/binaries/lib/asmtools.jar javasoft.sqe.jdec.Main -g a.class > a.jdec
3. Look at the a.jdec file, particularly at those pieces which correspond to foo_native and
foo_abstract methods:
. . .
Utf8 "foo_native"; // #9 at 0x53
Utf8 "foo_abstract"; // #10 at 0x60
. . .
{ // Member at 0x011B
0x0109; // access
#9; // name_cpx
#5; // sig_cpx
[0] { // Attributes
} // Attributes
} // Member
;
{ // Member at 0x0123
0x0401; // access
#10; // name_cpx
#5; // sig_cpx
[0] { // Attributes
} // Attributes
} // Member
} // methods
. . .
It can be seen that these methods do not have any attributes at all.
--- a.java ---
public abstract class a {
public static native void foo_native();
public abstract void foo_abstract();
}
--- end of a.java ---
======================================================================
- relates to
-
JDK-6765597 Debug steps are sometimes misleading
-
- Resolved
-
-
JDK-4026902 add support for line numbers from more than one file
-
- Closed
-