Generate line numbers for static delegates

Fixes debugger's "step into" for multi-file package
This commit is contained in:
Alexander Udalov
2012-10-17 15:28:28 +04:00
parent 4c710346af
commit ce2b915645
4 changed files with 44 additions and 0 deletions
@@ -343,6 +343,12 @@ public class FunctionCodegen extends GenerationStateAware {
InstructionAdapter iv = new InstructionAdapter(mv);
Type[] argTypes = asmMethod.getArgumentTypes();
// The first line of some namespace file is written to the line number attribute of a static delegate to allow to 'step into' it
// This is similar to what javac does with bridge methods
Label label = new Label();
iv.visitLabel(label);
iv.visitLineNumber(1, label);
int k = 0;
for (Type argType : argTypes) {
iv.load(k, argType);