Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

v5gdb User Manual

Welcome to the v5gdb user manual! This guide will help you set up a debugger for your VEX V5 project.

Supported frameworks

Currently, v5gdb supports vexide (Rust) and PROS (C++) programs. The VEXcode framework is not supported at this time.

Getting Started

If you use the vexide framework (Rust), please read our installation and setup guide for Rust projects.

If you use the PROS framework (C++), please read our installation and setup guide for C++ (PROS) projects.

If you haven’t used a debugger before, follow Your first debugging session (C++) next. And once you’ve set up v5gdb in your project, you can optionally configure it to connect with VS Code.

If something isn’t working, see Troubleshooting.


Here are some common commands you may find helpful when using GDB in the terminal:

  • layout src will show you what code is currently running. After running the above command, focus cmd will let you use the up and down arrow keys to quickly select a previous command.
  • break opcontrol will set a breakpoint on a function named opcontrol, and break main.cpp:15 will put a breakpoint on line 15 of main.cpp.
  • delete removes all breakpoints.
  • step will step execution forward by a single line of code.
  • next will step execution forward by a single line of code, and “jump over” function calls.
  • monitor help will show the special commands specific to the V5 debugger.
  • cont will exit the debug console and continue execution as normal. The debug console session will resume if a breakpoint is hit.
  • quit will quit the debugger.
  • info locals will show you the values of all the variables in the current function.
  • info args will show you the values of all the parameters passed to the current function.
  • info frame tells you what function is currently running and what file/line number you’re on.
  • backtrace tells you what function called the current function, and what function called that one, and so on.
  • print can be used to print out certain variables or call functions, like this:
    • Print a variable or expression: print kp * error
    • Call a function (C++): print calculate_number(30, 100, 4)
    • Call a function (Rust): print my_crate::calculate_number(30, 100, 4)
  • finish will skip to the end of the current function.

Advanced topics

Reading these wiki pages is optional, and most users won’t need them.

  • Command-line interface: all v5gdb command-line flags and options.
  • Transports: how v5gdb talks to your computer, and how to use a different connection than USB.

Support

If you have questions about v5gdb, please don’t hesitate to let us know in our Discord server. We are happy to help with any issues!