How to debug HotSpot
Staffan Larsen
staffan.larsen at oracle.com
Mon Sep 24 02:10:19 PDT 2012
Hi,
First thing you need to do is to unzip the libjvm.diz file in the build directory. This will create a libjvm.debuginfo file which contains symbols for the debugger. This should really be done automatically, either when building or by the hotspot launcher.
Then you can start your program with "hotspot -gdb MyClass". This will set a breakpoint in InitializeJVM where the libjvm.so is loaded. Type "fin" to step out of that method. Now libjvm.so is loaded and you can set breakpoints. For example "b os::sleep", then "cont".
I hope this helps,
/Staffan
On 22 sep 2012, at 16:13, 饭桶 <athrun911500 at 163.com> wrote:
> Hi all,
> I need you guys' help. I'm reading and learning details in Hotspot, especially garbage collector. But I'm trapped in debug and trace hotspot itselp.
>
> I have built hotspot in ubuntu 12.04 and entered gdb mode with "hotspot -gdb ....". But as libjvm.so is loaded at runtime, I can't step into that part in gdb. Is there any way to step into libjvm.so?
>
> Besides, here is how I build hotspot. Just check if there are some additional building parameters.
> LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk/ HOTSPOT_BUILD_JOBS=5 ARCH_DATA_MODEL=64 ALT_OUTPUTDIR=../../build/hotspot_debug make jvmg jvmg1 2>&1 | tee ../../build/hotspot_debug
>
> Thanks
> Arthur
More information about the hotspot-dev
mailing list