Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ keywords:
sidebar_position: 1
---

import Experimental from '@site/src/components/Notes/_experimental.mdx';

<Experimental />

#### Pre-requisites

In order to use the REPL debugger, first you need to install recent enough versions of Nargo.
Expand Down Expand Up @@ -161,7 +165,7 @@ Finished execution

Upon quitting the debugger after a solved circuit, the resulting circuit witness gets saved, equivalent to what would happen if we had run the same circuit with `nargo execute`.

We just went through the basics of debugging using Noir REPL debugger. For a comprehensive reference, check out [the reference page](../../reference/debugger/debugger_repl.md).
We just went through the basics of debugging using Noir REPL debugger. For a comprehensive reference, check out [the reference page](../../reference/debugger/debugger_repl.mdx).

## Debugging a test function

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ keywords:
sidebar_position: 0
---

import Experimental from '@site/src/components/Notes/_experimental.mdx';

<Experimental />

This guide will show you how to use VS Code with the vscode-noir extension to debug a Noir project.

#### Pre-requisites
Expand Down Expand Up @@ -73,4 +77,4 @@ We just need to click to the right of the line number 18. Once the breakpoint ap

Now we are debugging the `keccak256` function, notice the _Call Stack pane_ at the lower right. This lets us inspect the current call stack of our process.

That covers most of the current debugger functionalities. Check out [the reference](../../reference/debugger/debugger_vscode.md) for more details on how to configure the debugger.
That covers most of the current debugger functionalities. Check out [the reference](../../reference/debugger/debugger_vscode.mdx) for more details on how to configure the debugger.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ sidebar_position: 2

# Debugger Known Limitations

There are currently some limits to what the debugger can observe.
import Experimental from '@site/src/components/Notes/_experimental.mdx';

<Experimental />

There are currently some limits to what the debugger can observe.

## Mutable references

Expand All @@ -32,7 +36,7 @@ The update on `x` will not be observed by the debugger. That means, when running
When inspecting variables, any variable of type `Function` or `MutableReference` will render its value as `<<function>>` or `<<mutable ref>>`.

## Debugger instrumentation affects resulting ACIR

In order to make the state of local variables observable, the debugger compiles Noir circuits interleaving foreign calls that track any mutations to them. While this works (except in the cases described above) and doesn't introduce any behavior changes, it does as a side effect produce bigger bytecode. In particular, when running the command `opcodes` on the REPL debugger, you will notice Unconstrained VM blocks that look like this:

```
Expand All @@ -49,9 +53,9 @@ In order to make the state of local variables observable, the debugger compiles
5.7 | Stop
5.8 | ForeignCall { function: "__debug_var_assign", destinations: [], inputs: [RegisterIndex(RegisterIndex(2)), RegisterIndex(RegisterIndex(3))] }
...
```
If you are interested in debugging/inspecting compiled ACIR without these synthetic changes, you can invoke the REPL debugger with the `--skip-instrumentation` flag or launch the VS Code debugger with the `skipConfiguration` property set to true in its launch configuration. You can find more details about those in the [Debugger REPL reference](debugger_repl.md) and the [VS Code Debugger reference](debugger_vscode.md).
```

If you are interested in debugging/inspecting compiled ACIR without these synthetic changes, you can invoke the REPL debugger with the `--skip-instrumentation` flag or launch the VS Code debugger with the `skipConfiguration` property set to true in its launch configuration. You can find more details about those in the [Debugger REPL reference](debugger_repl.mdx) and the [VS Code Debugger reference](debugger_vscode.mdx).

:::note
Skipping debugger instrumentation means you won't be able to inspect values of local variables.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ keywords:
sidebar_position: 1
---

import Experimental from '@site/src/components/Notes/_experimental.mdx';

<Experimental />

## Running the REPL debugger

`nargo debug [OPTIONS] [WITNESS_NAME]`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ keywords:
sidebar_position: 0
---

# VS Code Noir Debugger Reference
import Experimental from '@site/src/components/Notes/_experimental.mdx';

<Experimental />

The Noir debugger enabled by the vscode-noir extension ships with default settings such that the most common scenario should run without any additional configuration steps.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ keywords: [Nargo, VSCode, Visual Studio Code, REPL, Debugger]
sidebar_position: 2
---

# Noir Debugger
import Experimental from '@site/src/components/Notes/_experimental.mdx';

<Experimental />

There are currently two ways of debugging Noir programs:

Expand All @@ -17,6 +19,6 @@ In order to use either version of the debugger, you will need to install recent
- Noir & Nargo ≥0.28.0
- Noir's VS Code extension ≥0.0.11

We cover the VS Code Noir debugger more in depth in [its VS Code debugger how-to guide](../how_to/debugger/debugging_with_vs_code.md) and [the reference](../reference/debugger/debugger_vscode.md).
We cover the VS Code Noir debugger more in depth in [its VS Code debugger how-to guide](../how_to/debugger/debugging_with_vs_code.mdx) and [the reference](../reference/debugger/debugger_vscode.mdx).

The REPL debugger is discussed at length in [the REPL debugger how-to guide](../how_to/debugger/debugging_with_the_repl.md) and [the reference](../reference/debugger/debugger_repl.md).
The REPL debugger is discussed at length in [the REPL debugger how-to guide](../how_to/debugger/debugging_with_the_repl.mdx) and [the reference](../reference/debugger/debugger_repl.mdx).
Loading