jakarta-bcel-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Koduru, Rajendra Kumar Reddy" <rajendra.kumar.reddy.kod...@sap.com>
Subject RE: Problem with instrumentation in constructors
Date Thu, 17 Feb 2005 18:24:19 GMT
Hi Andrew,
  
    yep, the call to setPositions() returned the correct
instructionHandle (ih), However 
    while applying this instruction Handle to iList.insert(ih,newList),
the instructions were not instrumented..might be there is
incompatibility between
 the instructionHandle and this list..as this instructionHandle is
obtained from a different instructionList (dummyList).
   However, the problem is solved..was just trying to know about that..

Thank you
Reddy





>-----Original Message-----
>From: Andrew Huntwork [mailto:ash@huntwork.net] 
>Sent: Donnerstag, 17. Februar 2005 17:42
>To: BCEL Users List
>Subject: Re: Problem with instrumentation in constructors
>
>
>oh, i guess the numbers you're looking at are the offsets of the 
>instructions, and that copy does not copy offsets.  had you used 
>InstructionList.setPositions() after InstructionList.copy, you would 
>have seen 1 instead of -1.  It's usually not important that these 
>numbers are correct except when you're actually writing the .class.
>
>As for why your instructions weren't showing up, i think it's because 
>ih->next() is not in iList, but i don't now for sure.  really, 
>with the 
>InstructionList.copy in there, things were just buggy, so 
>anything could 
>have happened.
>
>Koduru, Rajendra Kumar Reddy wrote:
>> Hi Andrew,
>> 
>> 
>>>>	superList = iList.copy(); I used
>>>>	iList itself in this method..
>>>
>>>oh yeah, good point.
>>>
>>>
>>>
>>>>	the former was returning instruction handle -1 and the later +1,
>>>>with a basic super() being first call.
>>>
>>>I don't understand your current problem.  Are you saying that the 
>>>InstructionHandle you're returning is not correct?  Is off by 
>>>one?  what 
>>>do you mean by "was not able to insert"?
>> 
>> 
>> 	
>> 	when I used superList = iList.copy(); 
>> 
>> 	the isntruction handle returned was ih =  -1
>> 
>> 	and when I called iList.insert(ih.next(), newList);
>> 	
>> 	I could not see my instrumented instructions in the bytecode
>> instruction set.
>> 
>> 	But, when I used the iList itself for iteration. ih = 1
>> 
>> 	iList.insert(ih.next(),newList);	
>> 
>> 	I could see my instrumented instructions in desired place.
>> 
>> 	I was wondering why it is so??
>> 
>> 
>> 
>> 
>>>>	and was not able to insert with former..so choosed the
>>>>later..however am not sure of reason for this..could you 
>>>
>>>please clarify
>>>
>>>>me, why is this happening..is this due to copy()
>>>>method???????????????????????
>>>>
>>>>public InstructionHandle getIListSuper(InstructionList iList){
>>>>     
>>>>     int invkSpec = 0;
>>>> 
>>>>     InstructionHandle seperator = null;
>>>>    
>>>>     InstructionList superList = iList.copy(); // deep copy
>>>>[COMMENTED OUT IN CURRENT METHOD]
>>>>     
>>>>     for ( Iterator i = superList.iterator (); i.hasNext (); ) {
>>>>[ USED iList in place of superList in this statement]
>>>>       seperator = ( InstructionHandle ) i.next ();
>>>> 
>>>>       if(seperator.getInstruction() instanceof NEW )
>>>>           invkSpec++;
>>>> 
>>>>       if(seperator.getInstruction() instanceof INVOKESPECIAL )
>>>>         invkSpec--;
>>>> 
>>>>       if(invkSpec < 0 )
>>>>         break;
>>>>     }
>>>>     
>>>>     if(invkSpec < 0) {
>>>>     return seperator
>>>>     }
>>>>   
>>>> 	  return null;
>>>>     }
>>>>
>>>>
>>>>Thank you
>>>>Reddy
>>>
>>>---------------------------------------------------------------------
>>>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
>
>

---------------------------------------------------------------------
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