Skip to content

Latest commit

 

History

History
79 lines (46 loc) · 2.93 KB

FEATURES.md

File metadata and controls

79 lines (46 loc) · 2.93 KB

Features

This document describes features that the AVM debugger supports.

Screenshots and the exact features are based on the VS Code client.

View transaction groups being debugged

Every execution starts with a top level transaction group.

A transaction group being debugged

Step into program executions

Both LogicSig and application programs associated with transactions can be stepped into. Source maps are used to show the original source code.

A program being debugged

Step into inner transactions

If an application spawns an inner transaction, the debugger can step into it as well.

An inner transaction group being debugged

Additionally, the entire call stack can be seen, showing the depth of the inner transaction or inner application being executed. Each frame of the call stack can be inspected to view the higher level state.

Call stack

Step-by-step debugging

The debugger supports step into, over, out, and back. Yes, you can step back!

Breakpoint support

Breakpoints can be set in program source files. The debugger will pause when code corresponding to a breakpoint is about to be executed. Since multiple opcodes can be in a single line of source code, breakpoints can be set on specific columns.

Breakpoints in program code

Error reporting

Execution errors will be reported by the debugger. Since any error stops the execution of a transaction group, the debugger will not allow you to advance after an error. You can however step backwards to inspect what happened prior to the error.

Note: There are a special class of errors which do not stop the execution of a transaction group. These are errors or rejections that occur in a clear state program. The debugger will still show these errors, and it will allow you to continue execution over them.

An error in the debugger

Inspect program state

The debugger allows you to inspect the state of the program being debugged. This includes the PC (program counter), stack, and scratch space.

Inspecting program state

Byte arrays can be displayed in a variety of formats, including base64, hex, and UTF-8.

Inspecting byte arrays in program state

Additionally, specific values can be added to the watch list.

Since values relative to the top of the stack are often important, negative indexing is supported to look up values relative to the top of the stack.

Watched values

Inspect application state

The debugger also allows you to inspect and watch any available application state from the execution. Such state includes application boxes, global, and local state.

Inspecting application state variables