|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.erights.e.develop.trace.TraceCaller
Untamed: This class finds the user method that posted a trace message and provides accessors to useful information.
DANGER: it is HIGHLY dependent on the particular way the implementation prints stack traces. The installation tests ($ROOT/Install) help you check if your VM does things differently. If you change this code, please update the tests (=Tests/TestTraceCaller.java).
For reference, here's the current expected format. (There's more about this in the code.)
java.lang.Exception at Trace.debugm(Trace.java:217) at Test.go(Test.java:25) at Test.main(Test.java:20)
Stack frames from jit-ed code (compiled on the fly) look like: at Trace.debugm(Compiled Code) or at Trace.debugm(TraceBuffer.java, Compiled Code)
Some VMs use <> pairs instead of parentheses. Some seem to use tabs (?)
If the implementation runs into an odd format, it should leave accessors it's not sure of with their initial values.
Field Summary | |
String |
fileName
Enabled: The file that method is in. |
String |
lineNumber
Enabled: The line number the trace call is on. |
String |
methodName
Enabled: The name of the method running in the targeted frame. |
private String |
targetMethod
|
Constructor Summary | |
TraceCaller(Exception exception)
Enabled: Collect an earlier frame's data based on data in the Exception. |
|
TraceCaller(String dump)
Enabled: String dump is a stack dump as retrieved with getStackDump. |
Method Summary | |
private void |
advance(String stackDump,
org.erights.e.develop.trace.TraceCaller.Line line)
Destructively move the line forward to the next line. |
private org.erights.e.develop.trace.TraceCaller.Line |
findTargetLineBounds(String stackDump)
|
private String |
getStackDump(Exception exception)
|
private org.erights.e.develop.trace.TraceCaller.Line |
lineFromPoint(String stackDump,
int middle)
|
private void |
parse(String dump)
|
private void |
parseLine(String stackDump,
org.erights.e.develop.trace.TraceCaller.Line line)
|
private void |
quitIf(boolean b)
|
String |
toString()
Suppressed: |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public String methodName
public String fileName
public String lineNumber
private final String targetMethod
Constructor Detail |
public TraceCaller(Exception exception)
Leaves fields set to their to original "?" values if it can't parse the stack.
public TraceCaller(String dump)
Method Detail |
private String getStackDump(Exception exception)
private void parse(String dump)
private org.erights.e.develop.trace.TraceCaller.Line findTargetLineBounds(String stackDump) throws Exception
Exception
private org.erights.e.develop.trace.TraceCaller.Line lineFromPoint(String stackDump, int middle) throws Exception
Exception
private void advance(String stackDump, org.erights.e.develop.trace.TraceCaller.Line line) throws Exception
Exception
private void parseLine(String stackDump, org.erights.e.develop.trace.TraceCaller.Line line) throws Exception
Exception
private void quitIf(boolean b) throws Exception
Exception
public String toString()
toString
in class Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |