jakarta-bcel-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "wassim masri" <q...@hotmail.com>
Subject Determining the scope of local variables (without the DEBUG option turned off)
Date Sat, 31 Jan 2004 17:43:59 GMT
I am trying to get the scope of the local variables in a method (given the 

I initially thought that I can just call MethodGen.getLocalVariables(), get 
the local variables table, locate my variable given its index then get the 
scope from the LocalVariable object  (using getStartPC and getLength).

It turned out that if the target byte code is not compiled with the DEBUG 
option turned on, MethodGen.getLocalVariables() only returns entries 
corresponding to the arguments of a method and ignores the local variables 
declared inside the method

For example, in the method foo( ) below, the returned table will have a 
single entry as opposed to 3:

public static void foo (int x )
	int y, z;

Any ideas?


Check out the coupons and bargains on MSN Offers! 

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

View raw message