jakarta-bcel-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laran Evans <laran.ev...@gmail.com>
Subject Matching line numbers from debug-compiled code to original source
Date Fri, 24 Jul 2009 16:04:19 GMT
I've been reading through the documentation (mostly the BCEL JavaDocs)
to find out how to do this.

I'm compiling code with debugging info enabled. So, the line number
info is in there.

What I need to do is take the compiled .class file, and do something like this:

for each method in myClass:
- Code code  = method.getCode();
- String instructions = Utility.codeToString(code.getCode(),
code.getConstantPool(), 0, -1, false)
- Figure out the line number in the source code for each (or at least
some) instruction.

How would I do this?

I've been looking at LineNumberTable but haven't figured out how to
put the pieces together.

So, how would I do this?


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

View raw message