VM: tracing fix

+ get back the log for memory/stack/storage
   on vm trace level.
This commit is contained in:
romanman 2014-08-25 00:57:58 +03:00
parent 5b48086ceb
commit 816402816e
2 changed files with 9 additions and 6 deletions

View File

@ -565,7 +565,7 @@ public class Program {
public void fullTrace() { public void fullTrace() {
if (logger.isDebugEnabled() || listener != null) { if (logger.isTraceEnabled() || listener != null) {
StringBuilder stackData = new StringBuilder(); StringBuilder stackData = new StringBuilder();
for (int i = 0; i < stack.size(); ++i) { for (int i = 0; i < stack.size(); ++i) {
@ -616,11 +616,11 @@ public class Program {
if (pc >= ops.length) opsString.append(" >>"); if (pc >= ops.length) opsString.append(" >>");
if (opsString.length() > 0) opsString.insert(0, "\n "); if (opsString.length() > 0) opsString.insert(0, "\n ");
logger.debug(" -- OPS -- {}", opsString); logger.trace(" -- OPS -- {}", opsString);
logger.debug(" -- STACK -- {}", stackData); logger.trace(" -- STACK -- {}", stackData);
logger.debug(" -- MEMORY -- {}", memoryData); logger.trace(" -- MEMORY -- {}", memoryData);
logger.debug(" -- STORAGE -- {}\n", storageData); logger.trace(" -- STORAGE -- {}\n", storageData);
logger.debug("\n Spent Gas: [ {} ]/[ {} ]\n Left Gas: [ {} ]\n", logger.trace("\n Spent Gas: [ {} ]/[ {} ]\n Left Gas: [ {} ]\n",
result.getGasUsed(), result.getGasUsed(),
invokeData.getGas().longValue(), invokeData.getGas().longValue(),
getGas().longValue()); getGas().longValue());

View File

@ -826,6 +826,9 @@ public class VM {
logger.info(logString, stepBefore, String.format("%-12s", op.name()), program.getGas().longValue(), logger.info(logString, stepBefore, String.format("%-12s", op.name()), program.getGas().longValue(),
program.invokeData.getCallDeep(), hint); program.invokeData.getCallDeep(), hint);
program.fullTrace();
// program.fullTrace(); // program.fullTrace();
} catch (RuntimeException e) { } catch (RuntimeException e) {
if(e instanceof OutOfGasException) if(e instanceof OutOfGasException)