Hi,
I did the same you mentioned. In my product that written with pure C++ I
developed a code that parses Java bytecode, decomposes it into a syntax
tree. The syntax tree is modified to add new methods/constructors. And
then
from this syntax tree I generate a new Java bytecode. The products that
include this algorithm are avalable at
http://www.simtel.net/product.php[id]94368[SiteID]simtel.net
and
http://www.simtel.net/product.php[id]93174[SiteID]simtel.net
"Moritz Hammer" <newsgroup001@[EMAIL PROTECTED]
> wrote in message
news:etod6b$7f1$1@[EMAIL PROTECTED]
> Hello,
>
> I am trying to use JVMTI to instrument the bytecode of all cl***** up to
> java.lang.Object. I need this so I can have a plain constructor (with
some
> special signature) that does not do anything besides calling a
superclass
> constructor that also does nothing (I want to simulate the effect of
> the actual constructor later). Right now, that does not sound too
> complicated to me: add another <init> method in the constant pool and a
> method block later. However, before I start, I wanted to ask people who
> know whether it can really be done: adding another constructor to
> java.lang.Object (or, at least, any direct subclass). Any pitfalls I am
> currently heading to? Is there any framework I can use (I do not want
> to permanently instrument all Java cl*****, so unless I am mistaken, I
> need to do it with JVMTI and implement it in C to get a grasp on
> java.lang.Object).
>
> Any hints are greatly appreciated,
> Moritz


|