solitude.debugger module¶
-
class
solitude.debugger.EvmTrace(rpc: solitude.common.rpc_client.RPCClient, contracts: solitude.common.contract_objectlist.ContractObjectList)[source]¶ Bases:
objectAccess debug information from the ETH server
-
__init__(rpc: solitude.common.rpc_client.RPCClient, contracts: solitude.common.contract_objectlist.ContractObjectList)[source]¶ Create an EvmTrace instance
Parameters: - rpc – RPC client connected to the ETH server
- contracts – a collection of contracts (see ContractObjectList)
-
trace_iter(txhash: bytes) → Iterator[Tuple[solitude.debugger.evm_trace.TraceStep, solitude.debugger.evm_trace.CallStackEvent]][source]¶ Iterate contract execution steps (instructions)
Parameters: txhash – transaction hash to inspect, as byte array Returns: generator of tuples of (TraceStep, CallStackEvent)
-
-
class
solitude.debugger.TraceStep¶ Bases:
tupleDebugger step (instruction) information
-
code¶ a SourceMapping object containing the source code and line information
-
contractname¶ contract name
-
depth¶ call stack depth
-
error¶ Error message
-
fileno¶ index which identifies the source unit
-
gas¶ Gas cost of the instruction
-
index¶ incrementing index of the step
-
jumptype¶ type of jump, ‘i’ for ‘jump into call’, ‘o’, for ‘jump out of call’, or empty (‘’)
-
length¶ length of the source code mapped to this instruction
-
memory¶ EVM memory as list of hex strings
-
op¶ opcode string
-
pc¶ program counter
-
stack¶ EVM stack as list of hex strings
-
start¶ index of the character in the source file where the source code mapped to this instruction starts
-
storage¶ EVM storage as dictionary of hex strings
-
-
class
solitude.debugger.SourceMapping¶ Bases:
tupleSource code and line information related to an instruction
-
line_index¶ line index where the relevant portion begins
-
line_pos¶ index of the column where the relevant portion begins (in line)
-
line_start¶ index of the character where the line starts in the file
-
lines¶ full source text split in lines
-
source¶ full source text
-
unitname¶ source unit name
-
-
class
solitude.debugger.CallStackElement¶ Bases:
tupleBasic stack frame information
-
prev¶ the TraceStep before entering a call
-
step¶ the TraceStep after entering a call
-
-
class
solitude.debugger.CallStackEvent¶ Bases:
tupleCall stack event information
-
data¶ Event data. If the event is of type ‘push’, a
CallStackElement
-
event¶ Type of event. Can be ‘push’, ‘pop’ or None
-
-
class
solitude.debugger.EvmDebugCore(client: solitude.client.eth_client.ETHClient, txhash: bytes, windowsize=50)[source]¶ Bases:
objectProvides common debugger-like access to the EVM’s debug information
-
INVALID_STEP= <solitude.debugger.evm_debug_core.Step object>¶
-
__init__(client: solitude.client.eth_client.ETHClient, txhash: bytes, windowsize=50)[source]¶ Create an EvmDebugCore.
Parameters: - client – an ETHClient connected to the ETH node
- txhash – transaction hash, as bytes
- windowsize – amount of previous and next steps buffered, for a total of previous (windowsize) + current (1) + next (windowsize).
-
get_callstack_depth() → int[source]¶ Get the call stack depth :return: number of frames in the call stack
-
get_frames() → List[solitude.debugger.evm_debug_core.Frame][source]¶ Get call stack frames :return: a list of
Frame
-
get_step(offset=0) → solitude.debugger.evm_debug_core.Step[source]¶ Get step, relative to current step.
Parameters: offset – step offset, relative to the current one. Can be in range (-windowsize, windowsize), according to the windowsize value provided in the constructor. Returns: a Step
-
-
class
solitude.debugger.Function(name: str, parameters: List[solitude.debugger.evm_debug_core.Value])[source]¶ Bases:
solitude._internal.oi_serializable.ISerializableObject containing a function call information
-
class
solitude.debugger.Frame(prev: solitude.debugger.evm_trace.TraceStep, cur: solitude.debugger.evm_trace.TraceStep)[source]¶ Bases:
solitude._internal.oi_serializable.ISerializableCall stack frame information
Variables: - locals – dictionary of local variable values
- return_values – list of values produced by return statements
- function – function call information
Step information is lost during serialization, and the three attributes above are kept
-
class
solitude.debugger.Step(step: Optional[solitude.debugger.evm_trace.TraceStep], event: Optional[solitude.debugger.evm_trace.CallStackEvent])[source]¶ Bases:
objectSingle instruction step information
Variables: - ast – AST nodes mapped to the instruction, as dictionary of (node type name -> node dict)
- values – values associated to this instruction (variable assignment, value produced by evaluation of statement, …)
-
__init__(step: Optional[solitude.debugger.evm_trace.TraceStep], event: Optional[solitude.debugger.evm_trace.CallStackEvent])[source]¶ Create a Step object
Parameters: - step – step information
- event – call stack event associated with the step
This object may be create empty, with null step and event data.
-
valid¶ Wether this object contains step information or is empty
Returns: True if not empty, otherwise False
-
class
solitude.debugger.Value(vtype: str, name: str, value, kind: str, origin=None)[source]¶ Bases:
solitude._internal.oi_serializable.ISerializableValue debug information
It represents a value associated to a named entity in the source code. Only supports numeric values.
-
class
solitude.debugger.InteractiveDebuggerOI(txhash, client, code_lines=(3, 6))[source]¶ Bases:
solitude._internal.oi_interface.ObjectInterface-
__init__(txhash, client, code_lines=(3, 6))[source]¶ Initialize self. See help(type(self)) for accurate signature.
-