jakarta-bcel-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikhil C. Khedkar" <nikhilckhed...@yahoo.com>
Subject Source Line Numbers from Class files
Date Tue, 27 Jan 2004 07:09:24 GMT
Hi,
  I am working on getting the source code line numbers
from class files using BCEL. 

ConstantPool constants  =
java_class.getConstantPool();
ConstantPoolGen cp = new ConstantPoolGen(constants);

MethodGen methodGen = new MethodGen(method,
java_class.getClassName(), cp);
Instruction [] instructions =
methodGen.getInstructionList().getInstructions();
LineNumberGen[] aLineNumberGen =
methodGen.getLineNumbers();

I intend to use getSourceLine() API of LineNumberGen
class. But the array aLineNumberGen is returned of 0
length. Is there any setting of the compiler that will
save the line numbers in the class files, because of
which it is not working right now.

Thanks,
   Nikhil

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

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


Mime
View raw message