forked from mirror/go-json
Add debug code
This commit is contained in:
parent
141e3992af
commit
afef1e7140
|
@ -50,6 +50,16 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet, opt
|
|||
ctxptr := ctx.Ptr()
|
||||
code := codeSet.Code
|
||||
|
||||
defer func() {
|
||||
if err := recover(); err != nil {
|
||||
fmt.Println("error occurred", err)
|
||||
fmt.Println(codeSet.Code.Dump())
|
||||
fmt.Printf("code = %+v\n", code)
|
||||
fmt.Println("code.op = ", code.Op, "idx = ", code.DisplayIdx, "p = ", load(ctxptr, code.Idx))
|
||||
panic(err)
|
||||
}
|
||||
}()
|
||||
|
||||
for {
|
||||
switch code.Op {
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue