You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bcel-user@jakarta.apache.org by aldib <al...@fuurou.org> on 2004/07/16 18:00:10 UTC

adding a listener to the call stack

Hi,
I’m new to BCEL and I was wondering if someone could help me with this.
I’m looking for a way of monitoring the call stack. I would like somehow to register some kind of listener with stack that gets notified whenever the stack is changed.
Does anybody know if it’s possible to use BCEL for this? Maybe instrumenting  the 
Classloader?

Thanks

Alessandro






Re: adding a listener to the call stack

Posted by db...@qis.net.
Quoting aldib <al...@fuurou.org>:

> Hi,
> I’m new to BCEL and I was wondering if someone could help me with this.
> I’m looking for a way of monitoring the call stack. I would like somehow to
> register some kind of listener with stack that gets notified whenever the
> stack is changed.
> Does anybody know if it’s possible to use BCEL for this? Maybe instrumenting 
> the 
> Classloader?
> 
> Thanks
> 
> Alessandro

You could perhaps inject a try finally block around the code over every method.
Then add a notify the listener as the first statement in the try, and notify
again in the last of the finally. :)

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


Re: adding a listener to the call stack

Posted by Andrew Huntwork <as...@huntwork.net>.
maybe you should use jdi (java debugging interface) instead of bcel.  i 
think you can cause it to send you events whenever a method is entered 
or exited.

aldib wrote:

> Hi,
> Im new to BCEL and I was wondering if someone could help me with this.
> Im looking for a way of monitoring the call stack. I would like somehow to register some kind of listener with stack that gets notified whenever the stack is changed.
> Does anybody know if its possible to use BCEL for this? Maybe instrumenting  the 
> Classloader?
> 
> Thanks
> 
> Alessandro
> 
> 
> 
> 
> 
> 

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