Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2006

Tip: Looking for answers? Try searching our database.

How to set a breakpoint in <clinit> using JVMTI

Thread view: 
darthmind@gmail.com - 25 Apr 2006 19:26 GMT
Does anyone know how to get a Method or Constructor object for <clinit>
(which we know
isn't either), to be able use it in JVMTI's SetBreakpoint() in order to
set a breakpoint in
<clinit>? Or how to otherwise obtain a jmethodID for <clinit>?

tia
Chris Uppal - 26 Apr 2006 11:14 GMT
> Does anyone know how to get a Method or Constructor object for <clinit>
> (which we know
> isn't either), to be able use it in JVMTI's SetBreakpoint() in order to
> set a breakpoint in
> <clinit>? Or how to otherwise obtain a jmethodID for <clinit>?

As far as the JVM is concerned, <clinit> is just another static method (albeit
one with special rules about how and when it must[n't] be called).  So I
imagine that you can get a handle on the method in just the same was as you
would for any other static method.  I haven't tried it with JVMTI, but in JNI
calling
   GetStaticMethodID(jclass, '<clinit>', '()V').
returns an apparently valid method ID.

   -- chris
darthmind@gmail.com - 26 Apr 2006 13:41 GMT
<clinit> is a special method. And, no, Class.getMethods() and the like
explicitly exclude <clinit>. The problem with GetStaticMethodID() is
that it initializes an uninitialized class, which is not desired in
this case.

Anyone else have any other thoughts?


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.