Fix Entry trace handling for implicit constructors

Update binaries
This commit is contained in:
Martin Robertson 2010-04-23 12:24:52 +01:00
parent d75189b61a
commit e0e948bf68
6 changed files with 9 additions and 10 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -19,7 +19,7 @@ public class TraceExample
while(true)
{
Thread.sleep(1000);
InnerTest.foo();
InnerTestClass.foo();
workMethod("foobar");
}
}
@ -44,7 +44,7 @@ public class TraceExample
System.setProperty("a",Arrays.toString(intArg));
}
private static class InnerTest
private static class InnerTestClass
{
private static void foo()
{

View File

@ -8,7 +8,6 @@ import java.util.Map;
import java.util.Set;
import org.intrace.output.AgentHelper;
import org.objectweb.asm.Attribute;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
@ -114,13 +113,6 @@ public class InstrumentedClassWriter extends ClassWriter
}
}
// MCHR: Need to preserve Synthetic attribute
@Override
public void visitAttribute(Attribute attr)
{
super.visitAttribute(attr);
}
/**
* Initial entry point - generate ENTRY call.
*/
@ -287,6 +279,13 @@ public class InstrumentedClassWriter extends ClassWriter
if (xiOpCode == Opcodes.RETURN)
{
// Ensure that cTor entry call gets written even if the cTor is
// implicit and therefore has only a single line number.
if (ctorEntryState == CTorEntryState.SEEN_SPECIAL)
{
addEntryCalls();
ctorEntryState = CTorEntryState.ENTRY_WRITTEN;
}
generateCallToAgentHelper(InstrumentationType.EXIT, lineNumber);
}
super.visitInsn(xiOpCode);