Skip to content

Running with a debugger

sean-dougherty edited this page Jan 31, 2015 · 2 revisions

This page explains how to use an interactive debugger via the run script.

Please be sure to check out pages specific to your environment:

Run with Debugger

The run script can be told to launch your program with gdb/lldb via the -g flag:

./run -g 0

This will start a command-line debugger (gdb on Linux/Cygwin, lldb on Mac). If a cuda-edu debugger plugin is available for your system, that plugin will be loaded. Note that if you run with a debugger plugin, cuda-edu will run in single-threaded mode.

Run debugger without plugin

To run without the debugger plugin, use the -p flag:

./run -gp 0

You may need to run without the debugger plugin for a couple reasons, including:

  • The plugin isn't interacting well with other tools or is crashing.
  • You need to debug in multi-threaded mode, perhaps to investigate a race condition in your code.

Run in single-threaded mode without plugin

If you want to run in single-threaded mode, which is the default when using a plugin, use the -s flag:

./run -gps 0
Clone this wiki locally