From 816402816ef21aa3ec3584bc77e52a95bb1642bf Mon Sep 17 00:00:00 2001 From: romanman Date: Mon, 25 Aug 2014 00:57:58 +0300 Subject: [PATCH] VM: tracing fix + get back the log for memory/stack/storage on vm trace level. --- .../src/main/java/org/ethereum/vm/Program.java | 12 ++++++------ ethereumj-core/src/main/java/org/ethereum/vm/VM.java | 3 +++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ethereumj-core/src/main/java/org/ethereum/vm/Program.java b/ethereumj-core/src/main/java/org/ethereum/vm/Program.java index beded606..f895a3d2 100644 --- a/ethereumj-core/src/main/java/org/ethereum/vm/Program.java +++ b/ethereumj-core/src/main/java/org/ethereum/vm/Program.java @@ -565,7 +565,7 @@ public class Program { public void fullTrace() { - if (logger.isDebugEnabled() || listener != null) { + if (logger.isTraceEnabled() || listener != null) { StringBuilder stackData = new StringBuilder(); for (int i = 0; i < stack.size(); ++i) { @@ -616,11 +616,11 @@ public class Program { if (pc >= ops.length) opsString.append(" >>"); if (opsString.length() > 0) opsString.insert(0, "\n "); - logger.debug(" -- OPS -- {}", opsString); - logger.debug(" -- STACK -- {}", stackData); - logger.debug(" -- MEMORY -- {}", memoryData); - logger.debug(" -- STORAGE -- {}\n", storageData); - logger.debug("\n Spent Gas: [ {} ]/[ {} ]\n Left Gas: [ {} ]\n", + logger.trace(" -- OPS -- {}", opsString); + logger.trace(" -- STACK -- {}", stackData); + logger.trace(" -- MEMORY -- {}", memoryData); + logger.trace(" -- STORAGE -- {}\n", storageData); + logger.trace("\n Spent Gas: [ {} ]/[ {} ]\n Left Gas: [ {} ]\n", result.getGasUsed(), invokeData.getGas().longValue(), getGas().longValue()); diff --git a/ethereumj-core/src/main/java/org/ethereum/vm/VM.java b/ethereumj-core/src/main/java/org/ethereum/vm/VM.java index 55b02226..8f6bb23b 100644 --- a/ethereumj-core/src/main/java/org/ethereum/vm/VM.java +++ b/ethereumj-core/src/main/java/org/ethereum/vm/VM.java @@ -826,6 +826,9 @@ public class VM { logger.info(logString, stepBefore, String.format("%-12s", op.name()), program.getGas().longValue(), program.invokeData.getCallDeep(), hint); + program.fullTrace(); + + // program.fullTrace(); } catch (RuntimeException e) { if(e instanceof OutOfGasException)