Debugin Hotspot VM in Netbeans - Ubuntu Linux 14

Mario Torre neugens at redhat.com
Thu Feb 18 10:44:31 UTC 2016


On Thu, Feb 18, 2016 at 11:23 AM, Martijn Verburg
<martijnverburg at gmail.com> wrote:
> Hi Marcelino,
>
> This one's beyond me I'm afraid (I have a wildly different setup on Mac OS
> X).  I see you have posted on the relevant Hotspot list as well, hopefully
> one of the more experienced contributors can help you there.

Right,

I have a few more pointers for you here, hoping they get you on the right track.

I posted some time ago a quick howto debug jni application (not hotspot per se):

https://neugens.wordpress.com/2015/02/26/debugging-the-jdk-with-gdb/

The following presentations all contain more useful information and
show in a way or another how to debug hotspot.

Volker has posted the slides for his presentation here:

http://www.progdoc.de/papers/JavaOne2014/javaone2014_con3138.html#%281%29
(he has a lot of very useful things here http://www.progdoc.de/papers.htm)

Then (unfortunately mp4 only for now) there is the awesome
presentation from Andrew Haley:

http://video.fosdem.org/2016/h1301/hunting-the-bug-from-hell.mp4

Overall, I suggest to attach to the java process remotely via both the
java debugger and gdb, and use the IDE just to go around the code and
drive the debugger.

Hope that helps.

Cheers,
Mario

> Cheers,
> Martijn
>
> On 17 February 2016 at 13:53, Marcelino Rodriguez cancio <
> marcelino.rodriguez-cancio at irisa.fr> wrote:
>
>> Hello all,
>>
>> I'm trying to debug the with OpenJDK9 Hotspot in Linux Ubuntu 14 using
>> Netbeans.
>>
>> My problem is that the gdb debugger, which I launch from the IDE, don't
>> stop in certain breakpoints, specifically in :
>> /9dev/hotspot/src/share/vm/opto/loopPredicate.cpp/loopPredicate.cpp:909
>>
>> I'm able to launch the compiler and stop in:
>> /9dev/jdk/src/java.base/share/native/libjli/java.cjava.c:1138, for example.
>>
>> I believe this happens because gdb does not attach to the VM thread, which
>> seems to me is a child thread, only the parent launched from the Java
>> executable (images/jdk/java).
>>
>> I'm total newby to gdb and I would like to debug from the IDE if possible.
>> Any hints, leads or advice on this?
>>
>>
>>
>>
>> My SETUP is as Follows:
>>
>> I can see that the code containing the breakpoint is executed looking at
>> the trace of the Hotspot (I'm using -XX:+TraceLoopPredicate ):
>> rc_predicate init <u range
>> lower bound check if: 475
>> rc_predicate (limit - stride) <u range
>> upper bound check if: 475
>> Loop Predication Performed: Loop: N467/N273 limit_check predicated counted
>> [int,int),+1 (-1 iters) has_sfpt rce
>> rc_predicate init <u range
>> lower bound check if: 200
>> rc_predicate (limit - stride) <u range
>> upper bound check if: 200
>> Loop Predication Performed: Loop: N198/N184 limit_check predicated counted
>> [int,int),+1 (-1 iters) has_sfpt rce
>> no main manifest attribute, in
>> /home/elmarce/PROJECTS/PHD/predicateloop/target/predicateloop-1.0-SNAPSHOT.jar
>>
>> I have described the way I compiled OpenJDK in here:
>> http://marcelinorc.com/2016/02/11/compiling-openjdk-9/
>>
>> And the way I created the Netbeans project in here:
>>
>> http://marcelinorc.com/2016/02/17/using-netbeans-to-hack-openjdk9-in-ubuntu/
>>
>> I have configurated the compilation with the flags:
>> --with-debug-level=slowdebug --with-target-bits=64 --disable-zip-debug-info
>>
>> I'm using as build result:
>> build/linux-x86_64-normal-server-slowdebug/jdk/bin/java
>>
>> And as Run Command: "${OUTPUT_PATH}" -XX:+TraceLoopPredicate -jar
>> /path/to/file/predicateloop-1.0-SNAPSHOT.jar
>>
>>
>>
>> I have read the post by Simonis:
>>
>> https://community.oracle.com/blogs/simonis/2008/01/24/hotspot-development-linux-netbeans-part-2#NB_Debug
>>
>> And then Watched the video:
>> https://www.youtube.com/watch?v=k7IX_diKCEo
>>
>>
>>
>> Thanks
>> Marcelino
>>


More information about the adoption-discuss mailing list