How to get the IDE debugger to use the OpenJDK source code instead of the decompiled class files?
Anil
1dropaflame at gmail.com
Sat Jul 13 16:51:51 UTC 2024
Yay! that worked. Thanks.
Is it possible to add a section to that docs page about using an IDE
debugger?
It was not obvious that one should use
...\OpenJDK\jdk\build\windows-x86_64-server-release\images\jdk instead
of ...\OpenJDK\jdk\build\windows-x86_64-server-release\jdk
to connect the jdk source files to the debugger.
On Fri, Jul 12, 2024 at 8:15 PM Chen Liang <liangchenblue at gmail.com> wrote:
> Hi Anil,
> If you want to use your local JDK, first build with "make images" and then
> add the JDK in this directory:
> <JDK git repo>/build/<config name>/images/jdk
> "config name" should be chosen by you or configure, looks like
> "windows-x86-64-server-release"
> Note there's an exploded jdk at /jdk instead of /images/jdk; the one not
> in images is exploded and does not have sources.
>
> Regards
>
> On Fri, Jul 12, 2024 at 7:55 PM Anil <1dropaflame at gmail.com> wrote:
>
>> I am trying to learn the Streams package of the JDK, and successfully
>> built the jdk.
>> I set the IDE (IntelliJ Community Edition) to use the JDK.
>> I put some dummy output statements in a stream method, peek(), and built
>> the JDK again.
>> I was stepping through a toy Java program that uses it, but I see that
>> when it gets to the core/base libraries, it does not use the Java code, but
>> rather, the decompiled code.
>> How to get the IDE to use the Java code?
>> Here is the code I changed in java.util.stream.ReferencePipeline.java
>>
>> public final Stream<P_OUT> peek(Consumer<? super P_OUT> action) {
>> Objects.requireNonNull(action);
>> System.out.println("=========anil 3 ================");
>> return new StatelessOp<>(this, StreamShape.REFERENCE,
>> 0) {
>> @Override
>> Sink<P_OUT> opWrapSink(int flags, Sink<P_OUT> sink) {
>> return new Sink.ChainedReference<>(sink) {
>> @Override
>> public void accept(P_OUT u) {
>> System.out.println("=========anil 0 ================");
>> action.accept(u);
>> System.out.println("=========anil 1 ================");
>> downstream.accept(u);
>> System.out.println("=========anil 2 ================");
>> }
>> };
>> }
>> };
>> }
>>
>> thanks,
>> Anil
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/build-dev/attachments/20240713/7ffbeb65/attachment-0001.htm>
More information about the build-dev
mailing list