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 Simplice Djoko <Si...@imag.fr> on 2005/01/26 17:17:32 UTC

Value of local variables - urgent

Hi everybody,
  i have a problem to get the value of local variable;
someone could help me please?
thanks for any help

-- 
Simplice Djoko.	Equipe cadp. VERIMAG. Grenoble. France.


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


Re: Value of local variables - urgent

Posted by David Hovemeyer <da...@cs.umd.edu>.
On Wed, Jan 26, 2005 at 05:17:32PM +0100, Simplice Djoko wrote:
> Hi everybody,
>  i have a problem to get the value of local variable;
> someone could help me please?

It would help if you described what you're trying to do in
more detail.

Do you want to get the value of a local variable when a method
is executed?  In that case, you can insert an instruction like
ALOAD, ILOAD, etc. to push the value onto the stack,
and then generate an INVOKESTATIC to pass it to a static method
or do something else with it.  A complicating factor is that
you need to know what type of value (reference, int, double, etc.)
is stored in the local, which requires dataflow analysis.
The BCEL verifier produces this information, and I have also
written some code that can get type information (which is
available as free software).

If you are trying to get the value statically (i.e., from just
analyzing the bytecode of the method), then as Dave Brosius
pointed out earlier, it is only possible to a limited extent.

-Dave

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