cmd, core, eth/tracers: support fancier js tracing (#15516)
* cmd, core, eth/tracers: support fancier js tracing
* eth, internal/web3ext: rework trace API, concurrency, chain tracing
* eth/tracers: add three more JavaScript tracers
* eth/tracers, vendor: swap ottovm to duktape for tracing
* core, eth, internal: finalize call tracer and needed extras
* eth, tests: prestate tracer, call test suite, rewinding
* vendor: fix windows builds for tracer js engine
* vendor: temporary duktape fix
* eth/tracers: fix up 4byte and evmdis tracer
* vendor: pull in latest duktape with my upstream fixes
* eth: fix some review comments
* eth: rename rewind to reexec to make it more obvious
* core/vm: terminate tracing using defers
2017-12-21 05:56:11 -06:00
|
|
|
package duktape
|
|
|
|
|
2019-05-27 08:36:06 -05:00
|
|
|
/*
|
|
|
|
#cgo !windows CFLAGS: -std=c99 -O3 -Wall -Wno-unused-value -fomit-frame-pointer -fstrict-aliasing
|
|
|
|
#cgo windows CFLAGS: -O3 -Wall -Wno-unused-value -fomit-frame-pointer -fstrict-aliasing
|
|
|
|
|
|
|
|
#include "duktape.h"
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
cmd, core, eth/tracers: support fancier js tracing (#15516)
* cmd, core, eth/tracers: support fancier js tracing
* eth, internal/web3ext: rework trace API, concurrency, chain tracing
* eth/tracers: add three more JavaScript tracers
* eth/tracers, vendor: swap ottovm to duktape for tracing
* core, eth, internal: finalize call tracer and needed extras
* eth, tests: prestate tracer, call test suite, rewinding
* vendor: fix windows builds for tracer js engine
* vendor: temporary duktape fix
* eth/tracers: fix up 4byte and evmdis tracer
* vendor: pull in latest duktape with my upstream fixes
* eth: fix some review comments
* eth: rename rewind to reexec to make it more obvious
* core/vm: terminate tracing using defers
2017-12-21 05:56:11 -06:00
|
|
|
const (
|
2019-05-27 08:36:06 -05:00
|
|
|
CompileEval uint = C.DUK_COMPILE_EVAL
|
|
|
|
CompileFunction uint = C.DUK_COMPILE_FUNCTION
|
|
|
|
CompileStrict uint = C.DUK_COMPILE_STRICT
|
|
|
|
CompileShebang uint = C.DUK_COMPILE_SHEBANG
|
|
|
|
CompileSafe uint = C.DUK_COMPILE_SAFE
|
|
|
|
CompileNoResult uint = C.DUK_COMPILE_NORESULT
|
|
|
|
CompileNoSource uint = C.DUK_COMPILE_NOSOURCE
|
|
|
|
CompileStrlen uint = C.DUK_COMPILE_STRLEN
|
|
|
|
CompileNoFileName uint = C.DUK_COMPILE_NOFILENAME
|
|
|
|
CompileFuncExpr uint = C.DUK_COMPILE_FUNCEXPR
|
cmd, core, eth/tracers: support fancier js tracing (#15516)
* cmd, core, eth/tracers: support fancier js tracing
* eth, internal/web3ext: rework trace API, concurrency, chain tracing
* eth/tracers: add three more JavaScript tracers
* eth/tracers, vendor: swap ottovm to duktape for tracing
* core, eth, internal: finalize call tracer and needed extras
* eth, tests: prestate tracer, call test suite, rewinding
* vendor: fix windows builds for tracer js engine
* vendor: temporary duktape fix
* eth/tracers: fix up 4byte and evmdis tracer
* vendor: pull in latest duktape with my upstream fixes
* eth: fix some review comments
* eth: rename rewind to reexec to make it more obvious
* core/vm: terminate tracing using defers
2017-12-21 05:56:11 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
2019-05-27 08:36:06 -05:00
|
|
|
TypeNone Type = C.DUK_TYPE_NONE
|
|
|
|
TypeUndefined Type = C.DUK_TYPE_UNDEFINED
|
|
|
|
TypeNull Type = C.DUK_TYPE_NULL
|
|
|
|
TypeBoolean Type = C.DUK_TYPE_BOOLEAN
|
|
|
|
TypeNumber Type = C.DUK_TYPE_NUMBER
|
|
|
|
TypeString Type = C.DUK_TYPE_STRING
|
|
|
|
TypeObject Type = C.DUK_TYPE_OBJECT
|
|
|
|
TypeBuffer Type = C.DUK_TYPE_BUFFER
|
|
|
|
TypePointer Type = C.DUK_TYPE_POINTER
|
|
|
|
TypeLightFunc Type = C.DUK_TYPE_LIGHTFUNC
|
cmd, core, eth/tracers: support fancier js tracing (#15516)
* cmd, core, eth/tracers: support fancier js tracing
* eth, internal/web3ext: rework trace API, concurrency, chain tracing
* eth/tracers: add three more JavaScript tracers
* eth/tracers, vendor: swap ottovm to duktape for tracing
* core, eth, internal: finalize call tracer and needed extras
* eth, tests: prestate tracer, call test suite, rewinding
* vendor: fix windows builds for tracer js engine
* vendor: temporary duktape fix
* eth/tracers: fix up 4byte and evmdis tracer
* vendor: pull in latest duktape with my upstream fixes
* eth: fix some review comments
* eth: rename rewind to reexec to make it more obvious
* core/vm: terminate tracing using defers
2017-12-21 05:56:11 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
2019-05-27 08:36:06 -05:00
|
|
|
TypeMaskNone uint = C.DUK_TYPE_MASK_NONE
|
|
|
|
TypeMaskUndefined uint = C.DUK_TYPE_MASK_UNDEFINED
|
|
|
|
TypeMaskNull uint = C.DUK_TYPE_MASK_NULL
|
|
|
|
TypeMaskBoolean uint = C.DUK_TYPE_MASK_BOOLEAN
|
|
|
|
TypeMaskNumber uint = C.DUK_TYPE_MASK_NUMBER
|
|
|
|
TypeMaskString uint = C.DUK_TYPE_MASK_STRING
|
|
|
|
TypeMaskObject uint = C.DUK_TYPE_MASK_OBJECT
|
|
|
|
TypeMaskBuffer uint = C.DUK_TYPE_MASK_BUFFER
|
|
|
|
TypeMaskPointer uint = C.DUK_TYPE_MASK_POINTER
|
|
|
|
TypeMaskLightFunc uint = C.DUK_TYPE_MASK_LIGHTFUNC
|
cmd, core, eth/tracers: support fancier js tracing (#15516)
* cmd, core, eth/tracers: support fancier js tracing
* eth, internal/web3ext: rework trace API, concurrency, chain tracing
* eth/tracers: add three more JavaScript tracers
* eth/tracers, vendor: swap ottovm to duktape for tracing
* core, eth, internal: finalize call tracer and needed extras
* eth, tests: prestate tracer, call test suite, rewinding
* vendor: fix windows builds for tracer js engine
* vendor: temporary duktape fix
* eth/tracers: fix up 4byte and evmdis tracer
* vendor: pull in latest duktape with my upstream fixes
* eth: fix some review comments
* eth: rename rewind to reexec to make it more obvious
* core/vm: terminate tracing using defers
2017-12-21 05:56:11 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
2019-05-27 08:36:06 -05:00
|
|
|
EnumIncludeNonenumerable uint = C.DUK_ENUM_INCLUDE_NONENUMERABLE
|
|
|
|
EnumIncludeHidden uint = C.DUK_ENUM_INCLUDE_HIDDEN
|
|
|
|
EnumIncludeSymbols uint = C.DUK_ENUM_INCLUDE_SYMBOLS
|
|
|
|
EnumExcludeStrings uint = C.DUK_ENUM_EXCLUDE_STRINGS
|
|
|
|
EnumOwnPropertiesOnly uint = C.DUK_ENUM_OWN_PROPERTIES_ONLY
|
|
|
|
EnumArrayIndicesOnly uint = C.DUK_ENUM_ARRAY_INDICES_ONLY
|
|
|
|
EnumSortArrayIndices uint = C.DUK_ENUM_SORT_ARRAY_INDICES
|
|
|
|
NoProxyBehavior uint = C.DUK_ENUM_NO_PROXY_BEHAVIOR
|
cmd, core, eth/tracers: support fancier js tracing (#15516)
* cmd, core, eth/tracers: support fancier js tracing
* eth, internal/web3ext: rework trace API, concurrency, chain tracing
* eth/tracers: add three more JavaScript tracers
* eth/tracers, vendor: swap ottovm to duktape for tracing
* core, eth, internal: finalize call tracer and needed extras
* eth, tests: prestate tracer, call test suite, rewinding
* vendor: fix windows builds for tracer js engine
* vendor: temporary duktape fix
* eth/tracers: fix up 4byte and evmdis tracer
* vendor: pull in latest duktape with my upstream fixes
* eth: fix some review comments
* eth: rename rewind to reexec to make it more obvious
* core/vm: terminate tracing using defers
2017-12-21 05:56:11 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
ErrUnimplemented int = 50 + iota
|
|
|
|
ErrUnsupported
|
|
|
|
|
2019-05-27 08:36:06 -05:00
|
|
|
ErrNone int = C.DUK_ERR_NONE
|
|
|
|
ErrError int = C.DUK_ERR_ERROR
|
|
|
|
ErrEval int = C.DUK_ERR_EVAL_ERROR
|
|
|
|
ErrRange int = C.DUK_ERR_RANGE_ERROR
|
|
|
|
ErrReference int = C.DUK_ERR_REFERENCE_ERROR
|
|
|
|
ErrSyntax int = C.DUK_ERR_SYNTAX_ERROR
|
|
|
|
ErrType int = C.DUK_ERR_TYPE_ERROR
|
|
|
|
ErrURI int = C.DUK_ERR_URI_ERROR
|
cmd, core, eth/tracers: support fancier js tracing (#15516)
* cmd, core, eth/tracers: support fancier js tracing
* eth, internal/web3ext: rework trace API, concurrency, chain tracing
* eth/tracers: add three more JavaScript tracers
* eth/tracers, vendor: swap ottovm to duktape for tracing
* core, eth, internal: finalize call tracer and needed extras
* eth, tests: prestate tracer, call test suite, rewinding
* vendor: fix windows builds for tracer js engine
* vendor: temporary duktape fix
* eth/tracers: fix up 4byte and evmdis tracer
* vendor: pull in latest duktape with my upstream fixes
* eth: fix some review comments
* eth: rename rewind to reexec to make it more obvious
* core/vm: terminate tracing using defers
2017-12-21 05:56:11 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
// Returned error values
|
|
|
|
ErrRetUnimplemented int = -(ErrUnimplemented + iota)
|
|
|
|
ErrRetUnsupported
|
|
|
|
ErrRetInternal
|
|
|
|
ErrRetAlloc
|
|
|
|
ErrRetAssertion
|
|
|
|
ErrRetAPI
|
|
|
|
ErrRetUncaughtError
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
2019-05-27 08:36:06 -05:00
|
|
|
ErrRetError int = -(ErrError)
|
|
|
|
ErrRetEval int = -(ErrEval)
|
|
|
|
ErrRetRange int = -(ErrRange)
|
|
|
|
ErrRetReference int = -(ErrReference)
|
|
|
|
ErrRetSyntax int = -(ErrSyntax)
|
|
|
|
ErrRetType int = -(ErrType)
|
|
|
|
ErrRetURI int = -(ErrURI)
|
cmd, core, eth/tracers: support fancier js tracing (#15516)
* cmd, core, eth/tracers: support fancier js tracing
* eth, internal/web3ext: rework trace API, concurrency, chain tracing
* eth/tracers: add three more JavaScript tracers
* eth/tracers, vendor: swap ottovm to duktape for tracing
* core, eth, internal: finalize call tracer and needed extras
* eth, tests: prestate tracer, call test suite, rewinding
* vendor: fix windows builds for tracer js engine
* vendor: temporary duktape fix
* eth/tracers: fix up 4byte and evmdis tracer
* vendor: pull in latest duktape with my upstream fixes
* eth: fix some review comments
* eth: rename rewind to reexec to make it more obvious
* core/vm: terminate tracing using defers
2017-12-21 05:56:11 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
2019-05-27 08:36:06 -05:00
|
|
|
ExecSuccess int = C.DUK_EXEC_SUCCESS
|
|
|
|
ExecError int = C.DUK_EXEC_ERROR
|
cmd, core, eth/tracers: support fancier js tracing (#15516)
* cmd, core, eth/tracers: support fancier js tracing
* eth, internal/web3ext: rework trace API, concurrency, chain tracing
* eth/tracers: add three more JavaScript tracers
* eth/tracers, vendor: swap ottovm to duktape for tracing
* core, eth, internal: finalize call tracer and needed extras
* eth, tests: prestate tracer, call test suite, rewinding
* vendor: fix windows builds for tracer js engine
* vendor: temporary duktape fix
* eth/tracers: fix up 4byte and evmdis tracer
* vendor: pull in latest duktape with my upstream fixes
* eth: fix some review comments
* eth: rename rewind to reexec to make it more obvious
* core/vm: terminate tracing using defers
2017-12-21 05:56:11 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
LogTrace int = iota
|
|
|
|
LogDebug
|
|
|
|
LogInfo
|
|
|
|
LogWarn
|
|
|
|
LogError
|
|
|
|
LogFatal
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
2019-05-27 08:36:06 -05:00
|
|
|
BufObjArrayBuffer int = C.DUK_BUFOBJ_ARRAYBUFFER
|
|
|
|
BufObjNodejsBuffer int = C.DUK_BUFOBJ_NODEJS_BUFFER
|
|
|
|
BufObjDataView int = C.DUK_BUFOBJ_DATAVIEW
|
|
|
|
BufobjInt8Array int = C.DUK_BUFOBJ_INT8ARRAY
|
|
|
|
BufobjUint8Array int = C.DUK_BUFOBJ_UINT8ARRAY
|
|
|
|
BufobjUint8ClampedArray int = C.DUK_BUFOBJ_UINT8CLAMPEDARRAY
|
|
|
|
BufObjInt16Array int = C.DUK_BUFOBJ_INT16ARRAY
|
|
|
|
BufObjUint16Array int = C.DUK_BUFOBJ_UINT16ARRAY
|
|
|
|
BufObjInt32Array int = C.DUK_BUFOBJ_INT32ARRAY
|
|
|
|
BufObjUint32Array int = C.DUK_BUFOBJ_UINT32ARRAY
|
|
|
|
BufObjFloat32Array int = C.DUK_BUFOBJ_FLOAT32ARRAY
|
|
|
|
BufObjFloat64Array int = C.DUK_BUFOBJ_FLOAT64ARRAY
|
cmd, core, eth/tracers: support fancier js tracing (#15516)
* cmd, core, eth/tracers: support fancier js tracing
* eth, internal/web3ext: rework trace API, concurrency, chain tracing
* eth/tracers: add three more JavaScript tracers
* eth/tracers, vendor: swap ottovm to duktape for tracing
* core, eth, internal: finalize call tracer and needed extras
* eth, tests: prestate tracer, call test suite, rewinding
* vendor: fix windows builds for tracer js engine
* vendor: temporary duktape fix
* eth/tracers: fix up 4byte and evmdis tracer
* vendor: pull in latest duktape with my upstream fixes
* eth: fix some review comments
* eth: rename rewind to reexec to make it more obvious
* core/vm: terminate tracing using defers
2017-12-21 05:56:11 -06:00
|
|
|
)
|