jakarta-bcel-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Toby Reyelts <t...@reyelts.com>
Subject Re: Help inserting instructions - simple question
Date Sun, 18 Jan 2004 04:26:32 GMT

I think BCEL assumes you have a very good understanding of the VM spec. 
If you don't, you probably shouldn't be writing bytecode (or using 
BCEL). Working with that assumption, the documentation is mostly "ok", 
though there are places that could use clarification.

God bless,
-Toby

Al wrote:

>Just thought I should give this some closure. Following Eriks instructions
>and looking up the jvm spec I realised that
>InstructionsFactory.createNewArray doesnt do the whole job. It expects the
>length of the array to be on the stack. Simple really. Seriously though lads
>... BCEL is desperately in need of some proper documentation if its ever
>going to achieve its potential. Am I alone in feeling that this should be
>one of, if not the, priority for its maintainers/developers (easy to say I
>know when youre not one of them!)?
>
>Best of luck,
>
>Alan
>
>----- Original Message ----- 
>From: "Erik Corry" <erik@arbat.com>
>To: "BCEL Users List" <bcel-user@jakarta.apache.org>
>Sent: Wednesday, January 14, 2004 9:00 PM
>Subject: Re: Help inserting instructions - simple question
>
>
>  
>
>>On Wed, Jan 14, 2004 at 08:33:48PM -0000, Al wrote:
>>    
>>
>>>Will somone please take a quick look at the example below. I am trying
>>>      
>>>
>to modify each method in a class s.t. the first thing it does is allocate a
>new byte[] (for the moment Im happy to just create it and let it go, ... I
>mean I dont need to bind it to anything). I dont understand what more I am
>supposed to do to insert instructions in a method. This code will result in
>an error like -
>  
>
>>>Exception in thread "main" java.lang.VerifyError: (class:
>>>      
>>>
>tests/test1/Test, method: main signature: ([Ljava/lang/String;)V) Unable to
>pop operand off an empty stack
>  
>
>>Probably the best thing is to run either
>>
>>java org.apache.bcel.util.Class2HTML mymodifiedclassfile.class
>>
>>or
>>
>>java org.apache.bcel.verifier.Verifier mymodifiedclassfile.class
>>
>>and look at the output until you can see where you are getting a stack
>>underflow.
>>
>>-- 
>>Erik Corry         I'd be a Libertarian, if they weren't all a
>>erik@arbat.com     bunch of tax-dodging professional whiners.   - B.
>>    
>>
>Breathed.
>  
>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: bcel-user-help@jakarta.apache.org
>>
>>
>>
>>    
>>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: bcel-user-help@jakarta.apache.org
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-user-help@jakarta.apache.org


Mime
View raw message