1"use strict";(globalThis.webpackChunkdocs=globalThis.webpackChunkdocs||[]).push([[1971],{96837(e,n,t){t.d(n,{Ay:()=>r});var i=t(74848),o=t(28453);function s(e){const n={a:"a",admonition:"admonition",p:"p",strong:"strong",...(0,o.R)(),...e.components};return(0,i.jsxs)(n.admonition,{title:"Experimental Feature",type:"caution",children:[(0,i.jsx)(n.p,{children:"This feature is experimental. The documentation may be incomplete or out of date, which means it could change in future versions, potentially causing unexpected behavior or not working as expected."}),(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Contributions Welcome:"})," If you notice any inaccuracies or potential improvements, please consider contributing. Visit our GitHub repository to make your contributions: ",(0,i.jsx)(n.a,{href:"https://github.com/noir-lang/noir",children:"Contribute Here"}),"."]})]})}function r(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(s,{...e})}):s(e)}t.d(n,["RM",0,[]])},61493(e,n,t){t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>c,default:()=>u,frontMatter:()=>d,metadata:()=>i,toc:()=>a});const i=JSON.parse('{"id":"tooling/debugger/debugger_repl","title":"REPL Debugger","description":"Noir Debugger REPL options and commands.","source":"@site/versioned_docs/version-v1.0.0-rc.2/tooling/debugger/debugger_repl.mdx","sourceDirName":"tooling/debugger","slug":"/tooling/debugger/debugger_repl","permalink":"/docs/tooling/debugger/debugger_repl","draft":false,"unlisted":false,"editUrl":"https://github.com/noir-lang/noir/edit/master/docs/versioned_docs/version-v1.0.0-rc.2/tooling/debugger/debugger_repl.mdx","tags":[],"version":"v1.0.0-rc.2","frontMatter":{"title":"REPL Debugger","description":"Noir Debugger REPL options and commands.","keywords":["Nargo","Noir CLI","Noir Debugger","REPL"]},"sidebar":"sidebar","previous":{"title":"VS Code Debugger","permalink":"/docs/tooling/debugger/debugger_vscode"},"next":{"title":"Known Limitations","permalink":"/docs/tooling/debugger/debugger_known_limitations"}}');var o=t(74848),s=t(28453),r=t(96837);const d={title:"REPL Debugger",description:"Noir Debugger REPL options and commands.",keywords:["Nargo","Noir CLI","Noir Debugger","REPL"]},c=void 0,l={},a=[...r.RM,{value:"Running the REPL debugger",id:"running-the-repl-debugger",level:2},{value:"Options",id:"options",level:3},{value:"REPL commands",id:"repl-commands",level:2},{value:"<code>help</code> (h)",id:"help-h",level:4},{value:"Stepping through programs",id:"stepping-through-programs",level:3},{value:"<code>next</code> (n)",id:"next-n",level:4},{value:"<code>over</code>
1",id:"over",level:4},{value:"<code>out</code>",id:"out",level:4},{value:"<code>step</code> (s)",id:"step-s",level:4},{value:"<code>into</code> (i)",id:"into-i",level:4},{value:"<code>continue</code> (c)",id:"continue-c",level:4},{value:"<code>restart</code> (res)",id:"restart-res",level:4},{value:"<code>opcodes</code> (o)",id:"opcodes-o",level:4},{value:"Breakpoints",id:"breakpoints",level:3},{value:"<code>break [Opcode]</code> (or shorthand <code>b [Opcode]</code>)",id:"break-opcode-or-shorthand-b-opcode",level:4},{value:"<code>break [line]</code> (or shorthand <code>b [line]</code>)",id:"break-line-or-shorthand-b-line",level:4},{value:"<code>delete [Opcode]</code> (or shorthand <code>d [Opcode]</code>)",id:"delete-opcode-or-shorthand-d-opcode",level:4},{value:"Variable inspection",id:"variable-inspection",level:3},{value:"vars",id:"vars",level:4},{value:"Stacktrace",id:"stacktrace",level:3},{value:"<code>stacktrace</code>",id:"stacktrace-1",level:4},{value:"Witness map",id:"witness-map",level:3},{value:"<code>witness</code> (w)",id:"witness-w",level:4},{value:"<code>witness [Witness Index]</code>",id:"witness-witness-index",level:4},{value:"<code>witness [Witness Index] [New value]</code>",id:"witness-witness-index-new-value",level:4},{value:"Unconstrained VM memory",id:"unconstrained-vm-memory",level:3},{value:"<code>memory</code>",id:"memory",level:4},{value:"<code>memset [Memory address] [New value]</code>",id:"memset-memory-address-new-value",level:4}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(r.Ay,{}),"\n",(0,o.jsx)(n.h2,{id:"running-the-repl-debugger",children:"Running the REPL debugger"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.code,{children:"nargo debug [OPTIONS] [WITNESS_NAME]"})}),"\n",(0,o.jsxs)(n.p,{children:["Runs the Noir REPL debugger. If a ",(0,o.jsx)(n.code,{children:"WITNESS_NAME"})," is provided the debugger writes the resulting execution witness to a ",(0,o.jsx)(n.code,{children:"WITNESS_NAME"})," file."]}),"\n",(0,o.jsx)(n.h3,{id:"options",children:"Options"}),"\n",(0,o.jsxs)(n.table,{children:[(0,o.jsx)(n.thead,{children:(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.th,{children:"Option"}),(0,o.jsx)(n.th,{children:"Description"})]})}),(0,o.jsxs)(n.tbody,{children:[(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"-p, --prover-name <PROVER_NAME>"})}),(0,o.jsx)(n.td,{children:"The name of the toml file which contains the inputs for the prover [default: Prover]"})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"--package <PACKAGE>"})}),(0,o.jsx)(n.td,{children:"The name of the package to debug"})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"--print-acir"})}),(0,o.jsx)(n.td,{children:"Display the ACIR for compiled circuit"})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"--test-name <TEST_NAME>"})}),(0,o.jsx)(n.td,{children:"The name (or substring) of the test function to debug"})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"--oracle-resolver <RESOLVER_URL>"})}),(0,o.jsx)(n.td,{children:"JSON RPC url to solve oracle calls"})]}),(0,o.jsxs)(n.tr,{children:[(0,o.jsx)(n.td,{children:(0,o.jsx)(n.code,{children:"-h, --help"})}),(0,o.jsx)(n.td,{children:"Print help"})]})]})]}),"\n",(0,o.jsx)(n.p,{children:"None of these options are required."}),"\n",(0,o.jsx)(n.admonition,{type:"note",children:(0,o.jsx)(n.p,{children:"Since the debugger starts by compiling the target package, all Noir compiler options are also available."})}),"\n",(0,o.jsx)(n.admonition,{type:"note",children:(0,o.jsxs)(n.p,{children:["If the ",(0,o.jsx)(n.code,{children:"--test-name"})," option is provided the debugger will debug the matching function instead of the package ",(0,o.jsx)(n.code,{children:"main"})," function.\nThis argument must only match one function. If the given name matches with more than one test function the debugger will not start."]})}),"\n",(0,o.jsx)(n.admonition,{type:"note",children:(0,o.jsxs)(n.p,{children:["For debugging aztec-contract tests that interact with the TXE (",(0,o.jsx)(n.a,{href:"https://docs.azte
1c.network/developers/guides/smart_contracts/testing",children:"see further details here"}),"), a JSON RPC server URL must be provided by setting the ",(0,o.jsx)(n.code,{children:"--oracle-resolver"})," option"]})}),"\n",(0,o.jsx)(n.h2,{id:"repl-commands",children:"REPL commands"}),"\n",(0,o.jsx)(n.p,{children:"Once the debugger is running, it accepts the following commands."}),"\n",(0,o.jsxs)(n.h4,{id:"help-h",children:[(0,o.jsx)(n.code,{children:"help"})," (h)"]}),"\n",(0,o.jsx)(n.p,{children:"Displays the menu of available commands."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"> help\nAvailable commands:\n\n opcodes display ACIR opcodes\n into step into to the next opcode\n next step until a new source location is reached\n out step until a new source location is reached\n and the current stack frame is finished\n break LOCATION:OpcodeLocation add a breakpoint at an opcode location\n break line:i64 add a breakpoint at an opcode associated to the given source code line\n over step until a new source location is reached\n without diving into function calls\n restart restart the debugging session\n delete LOCATION:OpcodeLocation delete breakpoint at an opcode location\n witness show witness map\n witness index:u32 display a single witness from the witness map\n witness index:u32 value:String update a witness with the given value\n memset index:usize value:String update a memory cell with the given\n value\n continue continue execution until the end of the\n program\n vars show variable values available at this point\n in execution\n stacktrace display the current stack trace\n memory show memory (valid when executing unconstrained code) value\n step step to the next ACIR opcode\n\nOther commands:\n\n help Show this help message\n quit Quit repl\n\n"})}),"\n",(0,o.jsx)(n.h3,{id:"stepping-through-programs",children:"Stepping through programs"}),"\n",(0,o.jsxs)(n.h4,{id:"next-n",children:[(0,o.jsx)(n.code,{children:"next"})," (n)"]}),"\n",(0,o.jsxs)(n.p,{children:["Step until the next Noir source code location. While other commands, such as ",(0,o.jsx)(n.a,{href:"#into-i",children:(0,o.jsx)(n.code,{children:"into"})})," and ",(0,o.jsx)(n.a,{href:"#step-s",children:(0,o.jsx)(n.code,{children:"step"})}),", allow for finer grained control of the program's execution at the opcode level, ",(0,o.jsx)(n.code,{children:"next"})," is source code centric. For example:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"3 ...\n4 fn main(x: u32) {\n5 assert(entry_point(x) == 2);\n6 swap_entry_point(x, x + 1);\n7 -> assert(deep_entry_point(x) == 4);\n8 multiple_values_entry_point(x);\n9 }\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Using ",(0,o.jsx)(n.code,{children:"next"})," here would cause the debugger to jump to the definition of ",(0,o.jsx)(n.code,{children:"deep_entry_point"})," (if available)."]}),"\n",(0,o.jsxs)(n.p,{children:["If you want to step over ",(0,o.jsx)(n.code,{children:"deep_entry_point"})," and go straight to line 8, use ",(0,o.jsxs)(n.a,{href:"#over",children:["the ",(0,o.jsx)(n.code,{children:"over"})," command"]})," instead."]}),"\n",(0,o.jsx)(n.h4,{id:"over",children:(0,o.jsx)(n.code,{children:"over"})}),"\n",(0,o.jsx)(n.p,{children:"Step until the next source code location, without diving into function calls. For example:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"3 ...\n4 fn main(x: u32) {\n5 assert(entry_point(x) == 2);\n6 swap_entry_point(x, x + 1);\n7 -> assert(deep_entry_point(x) == 4);\n8 multiple_values_entry_point(x);\n9 }\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Using ",(0,o.jsx)(n.code,{children:"over"})," here would cause the debugger to execute until line 8 (",(0,o.jsx)(n.code,{children:"multiple_values_entry_point(x);"}),")."]}),"\n",(0,o.jsxs)(n.p,{children:["If you want to step into ",(0,o.jsx)(n.code,{children:"deep_entry_point"})," instead, use ",(0,o.jsxs)(n.a,{href:"#next-n",children:["the ",(0,o.jsx)(n.code,{children:"next"})," command"]}),"."]}),"\n",(0,o.jsx)(n.h4,{id:"out",children:(0,o.jsx)(n.code,{children:"out"})}),"\n",(0,o.jsx)(n.p,{children:"Step until the end of the current function call. For example:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:" 3 ...\n 4 fn main(x: u32) {\n 5 assert(entry_point(x) == 2);\n 6 swap_entry_point(x, x + 1);\n 7 -> assert(deep_entry_point(x) == 4);\n 8 multiple_values_entry_point(x);\n 9 }\n 10\n 11 unconstrained fn returns_multiple_values(x: u32) -> (u32, u32, u32, u32) {\n 12 ...\n ...\n 55\n 56 unconstrained fn deep_entry_point(x: u32) -> u32 {\n 57 -> level_1(x + 1)\n 58 }\n\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Running ",(0,o.jsx)(n.code,{children:"out"})," here will resume execution until line 8."]}),"\n",(0,o.jsxs)(n.h4,{id:"step-s",children:[(0,o.jsx)(n.code,{children:"step"})," (s)"]}),"\n",(0,o.jsx)(n.p,{children:"Skips to the next ACIR code. A compiled Noir program is a sequence of ACIR opcodes. However, an unconstrained VM opcode denotes the start of an unconstrained code block, to be executed by the unconstrained VM. For example (redacted for brevity):"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"0 BLACKBOX::RANGE [(_0, num_bits: 32)] [ ]\n1 -> BRILLIG inputs=[Single(Expression { mul_terms: [], linear_combinations: [(1, Witness(0))], q_c: 0 })] outputs=[Simple(Witness(1))]\n\t1.0 | Mov { destination: RegisterIndex(2), source: RegisterIndex(0) }\n\t1.1 | Const { destination: RegisterIndex(0), value: Value { inner: 0 } }\n\t1.2 | Const { destination: RegisterIndex(1), value: Value { inner: 0 } }\n\t1.3 | Mov { destination: RegisterIndex(2), source: RegisterIndex(2) }\n\t1.4 | Call { location: 7 }\n\t...\n\t1.43 | Return\n2 EXPR [ (1, _1) -2 ]\n"})}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.code,{children:"->"})," here shows the debugger paused at an ACIR opcode: ",(0,o.jsx)(n.code,{children:"BRILLIG"}),", at index 1, which denotes an unconstrained code block is about to start."]}),"\n",(0,o.jsxs)(n.p,{children:["Using the ",(0,o.jsx)(n.code,{children:"step"})," command at this point would result in the debugger stopping at ACIR opcode 2, ",(0,o.jsx)(n.code,{children:"EXPR"}),", skipping unconstrained computation steps."]}),"\n",(0,o.jsxs)(n.p,{children:["Use ",(0,o.jsxs)(n.a,{href:"#into-i",children:["the ",(0,o.jsx)(n.code,{children:"into"})," command"]})," instead if you want to follow unconstrained computation step by step."]}),"\n",(0,o.jsxs)(n.h4,{id:"into-i",children:[(0,o.jsx)(n.code,{children:"into"})," (i)"]}),"\n",(0,o.jsx)(n.p,{children:"Steps into the next opcode. A compiled Noir program is a sequence of ACIR opcodes. However, a BRILLIG opcode denotes the start of an unconstrained code block, to be executed by the unconstrained VM. For example (redacted for brevity):"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"0 BLACKBOX::RANGE [(_0, num_bits: 32)] [ ]\n1 -> BRILLIG inputs=[Single(Expression { mul_terms: [], linear_combinations: [(1, Witness(0))], q_c: 0 })] outputs=[Simple(Witness(1))]\n\t1.0 | Mov { destination: RegisterIndex(2), source: RegisterIndex(0) }\n\t1.1 | Const { destination: RegisterIndex(0), value: Value { inner: 0 } }\n\t1.2 | Const { destination: RegisterIndex(1), value: Value { inner: 0 } }\n\t1.3 | Mov { destination: RegisterIndex(2), source: RegisterIndex(2) }\n\t1.4 | Call { location: 7 }\n\t...\n\t1.43 | Return\n2 EXPR [ (1, _1) -2 ]\n"})}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.code,{children:"->"})," here shows the debugger paused at an ACIR opcode: ",(0,o.jsx)(n.code,{children:"BRILLIG"}),", at index 1, which denotes an unconstrained code block is about to start."]}),"\n",(0,o.jsxs)(n.p,{children:["Using the ",(0,o.jsx)(n.code,{children:"into"})," command at this point would result in the debugger stopping at opcode 1.0, ",(0,o.jsx)(n.code,{children:"Mov ..."}),", allowing the debugger user to follow unconstrained computation step by step."]}),"\n",(0,o.jsxs)(n.p,{children:["Use ",(0,o.jsxs)(n.a,{href:"#step-s",children:["the ",(0,o.jsx)(n.code,{children:"step"})," command"]})," instead if you want to skip to the next ACIR code directly."]}),"\n",(0,o.jsxs)(n.h4,{id:"continue-c",children:[(0,o.jsx)(n.code,{children:"continue"})," (c)"]}),"\n",(0,o.jsx)(n.p,{children:"Continues execution until the next breakpoint, or the end of the program."}),"\n",(0,o.jsxs)(n.h4,{id:"restart-res",children:[(0,o.jsx)(n.code,{children:"restart"})," (res)"]}),"\n",(0,o.jsx)(n.p,{children:"Interrupts execution, and restarts a new debugging session from scratch."}),"\n",(0,o.jsxs)(n.h4,{id:"opcodes-o",children:[(0,o.jsx)(n.code,{children:"opcodes"})," (o)"]}),"\n",(0,o.jsx)(n.p,{children:"Display the program's ACIR opcode sequence. For example:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"0 BLACKBOX::RANGE [(_0, num_bits: 32)] [ ]\n1 -> BRILLIG inputs=[Single(Expression { mul_terms: [], linear_combinations: [(1, Witness(0))], q_c: 0 })] outputs=[Simple(Witness(1))]\n\t1.0 | Mov { destination: RegisterIndex(2), source: RegisterIndex(0) }\n\t1.1 | Const { destination: RegisterIndex(0), value: Value { inner: 0 } }\n\t1.2 | Const { destination: RegisterIndex(1), value: Value { inner: 0 } }\n\t1.3 | Mov { destination: RegisterIndex(2), source: RegisterIndex(2) }\n\t1.4 | Call { location: 7 }\n\t...\n\t1.43 | Return\n2 EXPR [ (1, _1) -2 ]\n"})}),"\n",(0,o.jsx)(n.h3,{id:"breakpoints",children:"Breakpoints"}),"\n",(0,o.jsxs)(n.h4,{id:"break-opcode-or-shorthand-b-opcode",children:[(0,o.jsx)(n.code,{children:"break [Opcode]"})," (or shorthand ",(0,o.jsx)(n.code,{children:"b [Opcode]"}),")"]}),"\n",(0,o.jsxs)(n.p,{children:["Sets a breakpoint on the specified opcode index. To get a list of the program opcode numbers, see ",(0,o.jsxs)(n.a,{href:"#opcodes-o",children:["the ",(0,o.jsx)(n.code,{children:"opcode"})," command"]}),". For example:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"0 BLACKBOX::RANGE [(_0, num_bits: 32)] [ ]\n1 -> BRILLIG inputs=[Single(Expression { mul_terms: [], linear_combinations: [(1, Witness(0))], q_c: 0 })] outputs=[Simple(Witness(1))]\n\t1.0 | Mov { destination: RegisterIndex(2), source: RegisterIndex(0) }\n\t1.1 | Const { destination: RegisterIndex(0), value: Value { inner: 0 } }\n\t1.2 | Const { destination: RegisterIndex(1), value: Value { inner: 0 } }\n\t1.3 | Mov { destination: RegisterIndex(2), source: RegisterIndex(2) }\n\t1.4 | Call { location: 7 }\n\t...\n\t1.43 | Return\n2 EXPR [ (1, _1) -2 ]\n"})}),"\n",(0,o.jsxs)(n.p,{children:["In this example, issuing a ",(0,o.jsx)(n.code,{children:"break 1.2"}
1)," command adds break on opcode 1.2, as denoted by the ",(0,o.jsx)(n.code,{children:"*"})," character:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"0 BLACKBOX::RANGE [(_0, num_bits: 32)] [ ]\n1 -> BRILLIG inputs=[Single(Expression { mul_terms: [], linear_combinations: [(1, Witness(0))], q_c: 0 })] outputs=[Simple(Witness(1))]\n\t1.0 | Mov { destination: RegisterIndex(2), source: RegisterIndex(0) }\n\t1.1 | Const { destination: RegisterIndex(0), value: Value { inner: 0 } }\n\t1.2 | * Const { destination: RegisterIndex(1), value: Value { inner: 0 } }\n\t1.3 | Mov { destination: RegisterIndex(2), source: RegisterIndex(2) }\n\t1.4 | Call { location: 7 }\n\t...\n\t1.43 | Return\n2 EXPR [ (1, _1) -2 ]\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Running ",(0,o.jsxs)(n.a,{href:"#continue-c",children:["the ",(0,o.jsx)(n.code,{children:"continue"})," command"]})," at this point would cause the debugger to execute the program until opcode 1.2."]}),"\n",(0,o.jsxs)(n.h4,{id:"break-line-or-shorthand-b-line",children:[(0,o.jsx)(n.code,{children:"break [line]"})," (or shorthand ",(0,o.jsx)(n.code,{children:"b [line]"}),")"]}),"\n",(0,o.jsxs)(n.p,{children:["Similar to ",(0,o.jsx)(n.code,{children:"break [opcode]"}),", but instead of selecting the opcode by index selects the opcode location by matching the source code location"]}),"\n",(0,o.jsxs)(n.h4,{id:"delete-opcode-or-shorthand-d-opcode",children:[(0,o.jsx)(n.code,{children:"delete [Opcode]"})," (or shorthand ",(0,o.jsx)(n.code,{children:"d [Opcode]"}),")"]}),"\n",(0,o.jsxs)(n.p,{children:["Deletes a breakpoint at an opcode location. Usage is analogous to ",(0,o.jsxs)(n.a,{href:"#",children:["the ",(0,o.jsx)(n.code,{children:"break"})," command"]}),"."]}),"\n",(0,o.jsx)(n.h3,{id:"variable-inspection",children:"Variable inspection"}),"\n",(0,o.jsx)(n.h4,{id:"vars",children:"vars"}),"\n",(0,o.jsx)(n.p,{children:"Show variable values available at this point in execution."}),"\n",(0,o.jsxs)(n.admonition,{type:"note",children:[(0,o.jsx)(n.p,{children:"The ability to inspect variable values from the debugger depends on compilation to be run in a special debug instrumentation mode. This instrumentation weaves variable tracing code with the original source code."}),(0,o.jsx)(n.p,{children:"So variable value inspection comes at the expense of making the resulting ACIR bytecode bigger and harder to understand and optimize."}),(0,o.jsxs)(n.p,{children:["If you find this compromise unacceptable, you can run the debugger with the flag ",(0,o.jsx)(n.code,{children:"--skip-debug-instrumentation"}),". This will compile your circuit without any additional debug information, so the resulting ACIR bytecode will be identical to the one produced by standard Noir compilation. However, if you opt for this, the ",(0,o.jsx)(n.code,{children:"vars"})," command will not be available while debugging."]})]}),"\n",(0,o.jsx)(n.h3,{id:"stacktrace",children:"Stacktrace"}),"\n",(0,o.jsx)(n.h4,{id:"stacktrace-1",children:(0,o.jsx)(n.code,{children:"stacktrace"})}),"\n",(0,o.jsx)(n.p,{children:"Displays the current stack trace."}),"\n",(0,o.jsx)(n.h3,{id:"witness-map",children:"Witness map"}),"\n",(0,o.jsxs)(n.h4,{id:"witness-w",children:[(0,o.jsx)(n.code,{children:"witness"})," (w)"]}),"\n",(0,o.jsx)(n.p,{children:"Show witness map. For example:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"_0 = 0\n_1 = 2\n_2 = 1\n"})}),"\n",(0,o.jsx)(n.h4,{id:"witness-witness-index",children:(0,o.jsx)(n.code,{children:"witness [Witness Index]"})}),"\n",(0,o.jsx)(n.p,{children:"Display a single witness from the witness map. For example:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"> witness 1\n_1 = 2\n"})}),"\n",(0,o.jsx)(n.h4,{id:"witness-witness-index-new-value",children:(0,o.jsx)(n.code,{children:"witness [Witness Index] [New value]"})}),"\n",(0,o.jsx)(n.p,{children:"Overwrite the given index with a new value. For example:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"> witness 1 3\n_1 = 3\n"})}),"\n",(0,o.jsx)(n.h3,{id:"unconstrained-vm-memory",children:"Unconstrained VM memory"}),"\n",(0,o.jsx)(n.h4,{id:"memory",children:(0,o.jsx)(n.code,{children:"memory"})}),"\n",(0,o.jsx)(n.p,{children:"Show unconstrained VM memory state. For example:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"> memory\nAt opcode 1.13: Store { destination_pointer: RegisterIndex(0), source: RegisterIndex(3) }\n...\n> registers\n0 = 0\n1 = 10\n2 = 0\n3 = 1\n4 = 1\n5 = 2\xb3\xb2\n6 = 1\n> into\nAt opcode 1.14: Const { destination: RegisterIndex(5), value: Value { inner: 1 } }\n...\n> memory\n0 = 1\n>\n"})}),"\n",(0,o.jsxs)(n.p,{children:["In the example above: we start with clean memory, then step through a ",(0,o.jsx)(n.code,{children:"Store"})," opcode which stores the value of register 3 (1) into the memory address stored in register 0 (0). Thus now ",(0,o.jsx)(n.code,{children:"memory"})," shows memory address 0 contains value 1."]}),"\n",(0,o.jsx)(n.admonition,{type:"note",children:(0,o.jsx)(n.p,{children:"This command is only functional while the debugger is executing unconstrained code."})}),"\n",(0,o.jsx)(n.h4,{id:"memset-memory-address-new-value",children:(0,o.jsx)(n.code,{children:"memset [Memory address] [New value]"})}),"\n",(0,o.jsx)(n.p,{children:"Update a memory cell with the given value. For example:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"> memory\n0 = 1\n> memset 0 2\n> memory\n0 = 2\n> memset 1 4\n> memory\n0 = 2\n1 = 4\n>\n"})}),"\n",(0,o.jsx)(n.admonition,{type:"note",children:(0,o.jsx)(n.p,{children:"This command is only functional while the debugger is executing unconstrained code."})})]})}function u(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(h,{...e})}):h(e)}},28453(e,n,t){t.d(n,{R:()=>r,x:()=>d});var i=t(96540);const o={},s=i.createContext(o);function r(e){const n=i.useContext(s);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:r(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.