You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bcel-user@jakarta.apache.org by Laran Evans <la...@gmail.com> on 2009/07/24 18:04:19 UTC

Matching line numbers from debug-compiled code to original source

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?

Thanks.

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