inspecting hotspot code using gdb

Ted Neward ted at tedneward.com
Wed Oct 24 02:25:14 PDT 2007


At the risk of stating the obvious… Are you using the debug or fastdebug
builds? Are you sure the java launcher you’re firing up is the right one?

 

I can’t imagine how else you’d debug Hotspot under gdb *except* to fire up
the launcher… Here’s a thought: fire up gdb against the launcher, and set a
breakpoint on JNI_CreateJVM() or another JNI method used in the launcher,
preferably as early as possible. When you hit that breakpoint, *then* set
the breakpoint for ciEnv::register_method(). (The fact that the Hotspot
DLLs/.sos are loaded dynamically—rather than at load time—may be throwing
gdb off when you try to set that breakpoint prior to execution. I know it
does for WinDbg when trying to debug Rotor…)

 

Ted Neward

Java, .NET, XML Services

Consulting, Teaching, Speaking, Writing

HYPERLINK "http://www.tedneward.com"http://www.tedneward.com

 

From: hotspot-dev-bounces at openjdk.java.net
[mailto:hotspot-dev-bounces at openjdk.java.net] On Behalf Of Ben Cheng
Sent: Thursday, October 18, 2007 5:48 PM
To: hotspot-dev at openjdk.java.net
Subject: inspecting hotspot code using gdb

 

Hello,

I tried to set a breakpoint in a Hotspot function, say
"ciEnv::register_method", under gdb, but gdb couldn't seem to find the
symbols. I am using my locally built libjvm.so so symbols should be there,
so I am thinking that feeding the java launcher to gdb is the wrong thing to
do here. 

Can someone explain the procedures to debug hotspot under gdb?

Thanks,
-Ben

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.488 / Virus Database: 269.15.0/1077 - Release Date: 10/18/2007
9:54 AM


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.488 / Virus Database: 269.15.3/1082 - Release Date: 10/20/2007
2:59 PM
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-dev/attachments/20071024/3a7803ab/attachment.html 


More information about the hotspot-dev mailing list