mirror of https://github.com/goccy/go-json.git
Add type infromation to the debug information
This commit is contained in:
parent
44bc17ce8c
commit
5093e5bd78
|
@ -65,6 +65,7 @@ func compileToGetCodeSetSlowPath(typeptr uintptr) (*OpcodeSet, error) {
|
|||
code = copyOpcode(code)
|
||||
codeLength := code.TotalLength()
|
||||
codeSet := &OpcodeSet{
|
||||
Type: copiedType,
|
||||
Code: code,
|
||||
CodeLength: codeLength,
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ func CompileToGetCodeSet(typeptr uintptr) (*OpcodeSet, error) {
|
|||
code = copyOpcode(code)
|
||||
codeLength := code.TotalLength()
|
||||
codeSet := &OpcodeSet{
|
||||
Type: copiedType,
|
||||
Code: code,
|
||||
CodeLength: codeLength,
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ func CompileToGetCodeSet(typeptr uintptr) (*OpcodeSet, error) {
|
|||
code = copyOpcode(code)
|
||||
codeLength := code.TotalLength()
|
||||
codeSet := &OpcodeSet{
|
||||
Type: copiedType,
|
||||
Code: code,
|
||||
CodeLength: codeLength,
|
||||
}
|
||||
|
|
|
@ -130,6 +130,7 @@ func (t OpType) IsMultipleOpField() bool {
|
|||
}
|
||||
|
||||
type OpcodeSet struct {
|
||||
Type *runtime.Type
|
||||
Code *Opcode
|
||||
CodeLength int
|
||||
}
|
||||
|
|
|
@ -45,6 +45,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet, opt
|
|||
defer func() {
|
||||
if err := recover(); err != nil {
|
||||
fmt.Println("=============[DEBUG]===============")
|
||||
fmt.Println("* [TYPE]")
|
||||
fmt.Println(codeSet.Type)
|
||||
fmt.Printf("\n")
|
||||
fmt.Println("* [ALL OPCODE]")
|
||||
fmt.Println(codeSet.Code.Dump())
|
||||
fmt.Printf("\n")
|
||||
|
|
Loading…
Reference in New Issue