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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
