RFR: JDK-8266877: Missing local debug information when debugging JEP-330
ปพนพัชร์ บรรพจันทร์
github.com+54611912+apa2527 at openjdk.java.net
Tue May 11 03:55:55 UTC 2021
On Sun, 9 May 2021 15:51:29 GMT, Jaroslav Tulach <github.com+26887752+JaroslavTulach at openjdk.org> wrote:
> I am polishing support for [JEP-330](https://openjdk.java.net/jeps/330) in NetBeans ([PR-2938](https://github.com/apache/netbeans/pull/2938)) and I have problems with debugging. Local variables aren't visible as the compiler doesn't pass `-g` option when compiling the main class. I'd like to see
>
> ![obrazek](https://user-images.githubusercontent.com/26887752/117578440-a876e000-b0ee-11eb-85b6-3c998f71879f.png)
>
> however, that requires one to pass `-g` option to the compiler somehow. As far as I can say there is no such way and hence I decided to create this pull request. If I invoke:
>
> $ java -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=y x.java
>
> it detects JDWP is on and adds `-g` to the compiler arguments. Is this an acceptable improvement? The alternative is to avoid using JEP-330 when debugging and rather generate `.class` by invoking `javac` and then run it as usual, but I'd rather rely on JEP-330 and avoid creation of the `.class` file.
Marked as reviewed by APA2527 at github.com (no known OpenJDK username).
-------------
PR: https://git.openjdk.java.net/jdk/pull/3939
More information about the compiler-dev
mailing list