diff options
author | obscuren <geffobscura@gmail.com> | 2015-04-05 04:16:29 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-04-05 04:16:29 +0800 |
commit | 5dc5e669864153949899b7a7c37737be65b80ba1 (patch) | |
tree | 2a6f27c8693c319f5e8013b268bfa88fbd54f2d9 /cmd | |
parent | d651ff968a468abebcaf929964d4e9edd3d9ba97 (diff) | |
download | dexon-5dc5e669864153949899b7a7c37737be65b80ba1.tar dexon-5dc5e669864153949899b7a7c37737be65b80ba1.tar.gz dexon-5dc5e669864153949899b7a7c37737be65b80ba1.tar.bz2 dexon-5dc5e669864153949899b7a7c37737be65b80ba1.tar.lz dexon-5dc5e669864153949899b7a7c37737be65b80ba1.tar.xz dexon-5dc5e669864153949899b7a7c37737be65b80ba1.tar.zst dexon-5dc5e669864153949899b7a7c37737be65b80ba1.zip |
set backtrace during runtime
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/geth/admin.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/cmd/geth/admin.go b/cmd/geth/admin.go index 639d5283e..f2887c6db 100644 --- a/cmd/geth/admin.go +++ b/cmd/geth/admin.go @@ -36,6 +36,18 @@ func (js *jsre) adminBindings() { admin.Set("export", js.exportChain) admin.Set("dumpBlock", js.dumpBlock) admin.Set("verbosity", js.verbosity) + admin.Set("backtrace", js.backtrace) +} + +func (js *jsre) backtrace(call otto.FunctionCall) otto.Value { + tracestr, err := call.Argument(0).ToString() + if err != nil { + fmt.Println(err) + return otto.UndefinedValue() + } + glog.GetTraceLocation().Set(tracestr) + + return otto.UndefinedValue() } func (js *jsre) verbosity(call otto.FunctionCall) otto.Value { |