jakarta-bcel-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Abel Wang" <ab...@nvisionsoftware.net>
Subject Re: getting target of BranchInstruction
Date Fri, 27 Sep 2002 14:49:28 GMT
Hi,

Thanks for the input, but I'm not trying to create/inject a try catch block.
What I'm trying to do is given a JavaClass object, I get the instruction
list of a particular method.  While scanning the InstructionList, I run into
the GOTO branch instruction.  What I want to be able to do is to figure out
what instruction that GOTO instruction will branch to.

Thanks,

--Abel

----- Original Message -----
From: "Juozas Baliuka" <baliuka@centras.lt>
To: "BCEL Users List" <bcel-user@jakarta.apache.org>
Sent: Thursday, September 26, 2002 11:20 PM
Subject: Re: getting target of BranchInstruction


>
> Hi,
> I use this :
> .........
> GOTO goto = new GOTO(null);
> ......................
> InstructionHandle handle = il.append(goto);
> ........
> InstructionHandle endIf = il.append( someInstruction );
> goto.setTarget(endIf);
> ........................
>
> use handles in "addExceptionHandler".
> I believe it will return valid target after  "setTarget", but I never need
> "getTarget" method.
>
> ----- Original Message -----
> From: "Abel Wang" <xandersparks@hotmail.com>
> To: <bcel-user@jakarta.apache.org>
> Sent: Friday, September 27, 2002 1:30 AM
> Subject: getting target of BranchInstruction
>
>
> > Hello BCel users,
> >
> > I'm trying to get the target instruction handle from the GOTO
instruction
> > off of a try catch block.  In Java, it looks something like this:
> >
> > try {
> >     <Whatever1>
> > }
> > catch(Exception e) {
> >
> >     <Whatever2>
> > }
> >
> > System.out.println("done");
> >
> > What I'm trying to do is given the GOTO instruction at the end of
> > <whatever1>, i want to get an index to the instruction which begins the
> > System.out.println("done") command.  I'm trying
> > BranchInstruction.getTarget() but it always returns null.  What is the
> > proper way for me to do this?
> >
> > Thanks,
> >
> > --Abel
> >
> >
> > _________________________________________________________________
> > Chat with friends online, try MSN Messenger: http://messenger.msn.com
> >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:bcel-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> <mailto:bcel-user-help@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
<mailto:bcel-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:bcel-user-help@jakarta.apache.org>
>
>


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


Mime
View raw message