MCPcopy Create free account
hub / github.com/antlr/codebuff / trace

Method trace

output/java/1.4.14/Interpreter.java:1347–1367  ·  view source on GitHub ↗
(InstanceScope scope, int ip)

Source from the content-addressed store, hash-verified

1345 }
1346
1347 protected void trace(InstanceScope scope, int ip) {
1348 final ST self = scope.st;
1349 StringBuilder tr = new StringBuilder();
1350 BytecodeDisassembler dis = new BytecodeDisassembler(self.impl);
1351 StringBuilder buf = new StringBuilder();
1352 dis.disassembleInstruction(buf, ip);
1353 String name = self.impl.name+":";
1354 if ( Misc.referenceEquals(self.impl.name, ST.UNKNOWN_NAME) ) name = "";
1355 tr.append(String.format("%-40s", name+buf));
1356 tr.append("\tstack=[");
1357 for (int i = 0; i<= sp; i++) {
1358 Object o = operands[i];
1359 printForTrace(tr, scope, o);
1360 }
1361 tr.append(" ], calls=");
1362 tr.append(getEnclosingInstanceStackString(scope));
1363 tr.append(", sp="+sp+", nw="+nwline);
1364 String s = tr.toString();
1365 if ( debug ) executeTrace.add(s);
1366 if ( trace ) System.out.println(s);
1367 }
1368
1369 protected void printForTrace(StringBuilder tr, InstanceScope scope, Object o) {
1370 if ( o instanceof ST) {

Callers 1

_execMethod · 0.95

Calls 8

referenceEqualsMethod · 0.95
printForTraceMethod · 0.95
toStringMethod · 0.65
addMethod · 0.65
appendMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected