Instruction schema
- Explore
- View source
- Playground
Loading ....
- YAML
- JSON
ethdebug/format/program/instruction
$schema: "https://json-schema.org/draft/2020-12/schema"
$id: "schema:ethdebug/format/program/instruction"
title: ethdebug/format/program/instruction
description: |
A schema for representing the information pertaining to a particular
instruction in machine code.
type: object
properties:
offset:
title: Instruction byte offset
description: |
The byte offset where the instruction begins within the bytecode.
For legacy contract bytecode (non-EOF), this value is equivalent to the
instruction's program counter. For EOF bytecode, this value **must** be
the offset from the start of the container, not the start of a particular
code section within that container.
$ref: "schema:ethdebug/format/data/value"
operation:
title: Machine operation information
type: object
properties:
mnemonic:
description: The mnemonic operation code (PUSH1, e.g.)
type: string
arguments:
description: The immediate arguments to the operation, if relevant.
type: array
minItems: 1
items:
description: |
An immediate value specified as argument to the opcode
$ref: "schema:ethdebug/format/data/value"
required:
- mnemonic
context:
description: |
The context known to exist following the execution of this instruction.
"Following execution" means the context's semantic facts (source
location, variables in scope, function invocation, etc.) hold from
this point forward. Pointers within the context reference the machine
state at this instruction's trace step, which is the state a debugger
observes when it encounters the instruction.
This field is **optional**. Omitting it is equivalent to specifying the
empty context value (`{}`).
$ref: "schema:ethdebug/format/program/context"
default: {}
required:
- offset
examples:
- offset: 0
operation:
mnemonic: "PUSH1"
arguments: ["0x60"]
context:
code:
source:
id: 5
range:
offset: 10
length: 30
ethdebug/format/program/instruction
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "schema:ethdebug/format/program/instruction",
"title": "ethdebug/format/program/instruction",
"description": "A schema for representing the information pertaining to a particular\ninstruction in machine code.\n",
"type": "object",
"properties": {
"offset": {
"title": "Instruction byte offset",
"description": "The byte offset where the instruction begins within the bytecode.\n\nFor legacy contract bytecode (non-EOF), this value is equivalent to the\ninstruction's program counter. For EOF bytecode, this value **must** be\nthe offset from the start of the container, not the start of a particular\ncode section within that container.\n",
"$ref": "schema:ethdebug/format/data/value"
},
"operation": {
"title": "Machine operation information",
"type": "object",
"properties": {
"mnemonic": {
"description": "The mnemonic operation code (PUSH1, e.g.)",
"type": "string"
},
"arguments": {
"description": "The immediate arguments to the operation, if relevant.",
"type": "array",
"minItems": 1,
"items": {
"description": "An immediate value specified as argument to the opcode\n",
"$ref": "schema:ethdebug/format/data/value"
}
}
},
"required": [
"mnemonic"
]
},
"context": {
"description": "The context known to exist following the execution of this instruction.\n\"Following execution\" means the context's semantic facts (source\nlocation, variables in scope, function invocation, etc.) hold from\nthis point forward. Pointers within the context reference the machine\nstate at this instruction's trace step, which is the state a debugger\nobserves when it encounters the instruction.\n\nThis field is **optional**. Omitting it is equivalent to specifying the\nempty context value (`{}`).\n",
"$ref": "schema:ethdebug/format/program/context",
"default": {}
}
},
"required": [
"offset"
],
"examples": [
{
"offset": 0,
"operation": {
"mnemonic": "PUSH1",
"arguments": [
"0x60"
]
},
"context": {
"code": {
"source": {
"id": 5
},
"range": {
"offset": 10,
"length": 30
}
}
}
}
]
}
Loading playground...