jakarta-bcel-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alessandra Bez <alexbe...@yahoo.it>
Subject Re: Source Line Numbers from Class files
Date Tue, 27 Jan 2004 09:23:38 GMT
The source code line number are stored in the InstructionList class in 
 int[] byte_positions. you can try:
Method[] methods=clazz.getMethods();
MethodGen mg = new MethodGen(methods[m ], class_name, cp);
InstructionList the = mg.getInstructionList(); 
int[ ] position=il.getInstructionPositions(); 
where m is the index of method.

"Nikhil C. Khedkar" <nikhilckhedkar@yahoo.com> wrote:
I am working on getting the source code line numbers
from class files using BCEL. 

ConstantPool constants =
ConstantPoolGen cp = new ConstantPoolGen(constants);

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

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.


Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!

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

Yahoo! Mail: 6MB di spazio gratuito, 30MB per i tuoi allegati, l'antivirus, il filtro Anti-spam
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message