aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/interpreter.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-12-21 19:56:11 +0800
committerGitHub <noreply@github.com>2017-12-21 19:56:11 +0800
commit5258785c81959109138ebeca613f12c277188abc (patch)
treeb3d21fc2f38927841f44541a3717b69f5a3c5ec1 /core/vm/interpreter.go
parent1a5425779b026587e36f5d21a6e50efe17cc6a9d (diff)
downloaddexon-5258785c81959109138ebeca613f12c277188abc.tar
dexon-5258785c81959109138ebeca613f12c277188abc.tar.gz
dexon-5258785c81959109138ebeca613f12c277188abc.tar.bz2
dexon-5258785c81959109138ebeca613f12c277188abc.tar.lz
dexon-5258785c81959109138ebeca613f12c277188abc.tar.xz
dexon-5258785c81959109138ebeca613f12c277188abc.tar.zst
dexon-5258785c81959109138ebeca613f12c277188abc.zip
cmd, core, eth/tracers: support fancier js tracing (#15516)
* cmd, core, eth/tracers: support fancier js tracing * eth, internal/web3ext: rework trace API, concurrency, chain tracing * eth/tracers: add three more JavaScript tracers * eth/tracers, vendor: swap ottovm to duktape for tracing * core, eth, internal: finalize call tracer and needed extras * eth, tests: prestate tracer, call test suite, rewinding * vendor: fix windows builds for tracer js engine * vendor: temporary duktape fix * eth/tracers: fix up 4byte and evmdis tracer * vendor: pull in latest duktape with my upstream fixes * eth: fix some review comments * eth: rename rewind to reexec to make it more obvious * core/vm: terminate tracing using defers
Diffstat (limited to 'core/vm/interpreter.go')
-rw-r--r--core/vm/interpreter.go17
1 files changed, 11 insertions, 6 deletions
diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go
index 455f970dd..482e67a3a 100644
--- a/core/vm/interpreter.go
+++ b/core/vm/interpreter.go
@@ -144,12 +144,17 @@ func (in *Interpreter) Run(contract *Contract, input []byte) (ret []byte, err er
)
contract.Input = input
- defer func() {
- if err != nil && !logged && in.cfg.Debug {
- in.cfg.Tracer.CaptureState(in.evm, pcCopy, op, gasCopy, cost, mem, stack, contract, in.evm.depth, err)
- }
- }()
-
+ if in.cfg.Debug {
+ defer func() {
+ if err != nil {
+ if !logged {
+ in.cfg.Tracer.CaptureState(in.evm, pcCopy, op, gasCopy, cost, mem, stack, contract, in.evm.depth, err)
+ } else {
+ in.cfg.Tracer.CaptureFault(in.evm, pcCopy, op, gasCopy, cost, mem, stack, contract, in.evm.depth, err)
+ }
+ }
+ }()
+ }
// The Interpreter main run loop (contextual). This loop runs until either an
// explicit STOP, RETURN or SELFDESTRUCT is executed, an error occurred during
// the execution of one of the operations or until the done flag is set by the