This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
AJP/DiSLProject2022/src-profiler/ex4/Instrumentation.java
2023-01-09 08:01:15 +01:00

14 lines
473 B
Java

package ex4;
import ch.usi.dag.disl.annotation.Before;
import ch.usi.dag.disl.dynamiccontext.DynamicContext;
import ch.usi.dag.disl.marker.BytecodeMarker;
public class Instrumentation {
@Before(marker = BytecodeMarker.class, args = "athrow", scope = "ex4.MainThread.*")
static void beforeThrowing(final DynamicContext dc) {
final Throwable throwableThrown = dc.getStackValue(0, Throwable.class);
Profiler.countException(throwableThrown);
}
}