mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 02:40:45 +00:00
set backtrace during runtime
This commit is contained in:
parent
d651ff968a
commit
5dc5e66986
1 changed files with 12 additions and 0 deletions
|
|
@ -36,6 +36,18 @@ func (js *jsre) adminBindings() {
|
||||||
admin.Set("export", js.exportChain)
|
admin.Set("export", js.exportChain)
|
||||||
admin.Set("dumpBlock", js.dumpBlock)
|
admin.Set("dumpBlock", js.dumpBlock)
|
||||||
admin.Set("verbosity", js.verbosity)
|
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 {
|
func (js *jsre) verbosity(call otto.FunctionCall) otto.Value {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue