Debugger - BBpezsgo/Interpreter GitHub Wiki

Caution

Debugging mode only works on Windows because it uses the Win32 API.

You can use the --debug argument to start the interpreter in debugging mode.

Bytecode

Layout

The debugger window consists of several panels.

Console

This is the standard input and output of the executing program.

Code

Here you can see the bytecodes. The next instruction to be executed is highlighted in red.

If --no-debug-info argument is not specified, there will be some comments in gray.

Breakpoints

You can set a breakpoint by clicking on a line number and clear it by clicking again. Breakpoints are highlighted in red on the line numbers.

Note

There can only be one breakpoint at a time.

Stack

On the top-right you can see the stack. Memory address can be preceded by a marker:

  • Blue ► : This shows the current base pointer
  • Gray ► : This shows the previous base pointers
  • Red ○ : This shows the address from which it will read data (also indicates when the item pops up)
  • Red ● : This shows the address where data is being written

If --no-debug-info argument is not specified, there will be some comments in gray.

HEAP

On the middle-right you can see the HEAP. Memory address can be preceded by a marker:

  • Red ○ : This shows the address from which it will read data
  • Red ● : This shows the address where data is being written

Call Stack

On the bottom-right you can see the call stack. The call stack is constructed by tracing back on the base pointers. The numbers are code pointers.

If --no-debug-info argument is not specified, instead of numbers you can see function declarations.

Hotkeys

Note

The execution count is a number that indicates how many instructions are executed when the TAB, SPACE or ENTER key is pressed.

  • TAB or SPACE : It executes the instructions until the code pointer is one more than where it is. This is something like "step over". It also pauses or resumes the execution.

  • ENTER : It executes the next instruction. This is something like "step in".

  • + : It adds one to the current executing count.

  • - : It subtracts one from the current executing count.

  • * : It sets the current executing count to the maximum possible value. It also pauses the execution.

  • / : It resets the current executing count. It also pauses the execution.

Brainfuck

Layout

The window is consisting of different rows.

Code

The top-most row shows the code. The next instruction is highlighted in gray.

Memory

Below the code, you can see the memory. The memory is a multi-row display, where one row consists of 4 lines.

  1. line: This shows the ASCII character equivalent of the memory value below.
  2. line: This shows the actual memory value.
  3. line: This shows the memory pointer (with a red arrow) and also highlighted in gray if the memory pointer was ever there.
  4. line: This shows the memory address. Only every 16th address is displayed. Blue background indicates the start of the HEAP, and green indicates a HEAP data address.

Original Code

Below the memory, you can see the reconstructed source code if the --no-debug-info argument is not specified. The statement highlighted in gray is corresponding to the current code pointer.

Output

This is the standard output of the executing program.

Hotkeys

If any key is pressed, the next instruction is executed.

⚠️ **GitHub.com Fallback** ⚠️