-
Feature Request
-
Resolution: Done
-
Major
-
None
-
None
-
None
For some use cases it is desirable to trigger conditionally on the state of the call stack. For example, to trigger only when MyClass.interestingMethod is called from OtherClass.someMethod. Whilst it is possible to achieve this by instrumenting all calling points of interest, it is in some scenarios preferable to instrument the called point and then 'filter' on the calling class/method. To facilitate this, the default helper should expose functions useful to IF clauses e.g.
boolean calledFrom(String regexpForCallingClassAndMethod)
boolean calledIndirectlyFrom(int stackFramesToOffset, String regexpForCallingClassAndMethod)
boolean calledIndirectlyFrom(int minStackFramesOffset, int maxStackFramesOffset, String regexpForCallingClassAndMethod)