aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-04-05 04:16:29 +0800
committerobscuren <geffobscura@gmail.com>2015-04-05 04:16:29 +0800
commit5dc5e669864153949899b7a7c37737be65b80ba1 (patch)
tree2a6f27c8693c319f5e8013b268bfa88fbd54f2d9 /cmd
parentd651ff968a468abebcaf929964d4e9edd3d9ba97 (diff)
downloadgo-tangerine-5dc5e669864153949899b7a7c37737be65b80ba1.tar.gz
go-tangerine-5dc5e669864153949899b7a7c37737be65b80ba1.tar.zst
go-tangerine-5dc5e669864153949899b7a7c37737be65b80ba1.zip
set backtrace during runtime
Diffstat (limited to 'cmd')
-rw-r--r--cmd/geth/admin.go12
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 {