Start a Debugging Session

The standard GDB* or LLDB* commands are used to debug OpenCL(TM) programs:

gdb --args ./host_program

Breakpoints and stepping functionality are fully supported.

For more information about GDB* or LLDB* debuggers, see the See Also section below.

GDB* Debugging Session Example

  1. Start debugging a program:
    gdb --args ./host_program
  2. Set a breakpoint in a kernel:
    (gdb) break kernel.cl:5
         Make breakpoint pending on future shared library load? (y or [n]) y
         Breakpoint 1 (kernel.cl:5) pending.
  3. Run the host program. The execution stops once the debugger hits the breakpoint in the kernel:
       (gdb) run
         Thread 19 "debugger_test_t" hit Breakpoint 1, foo (c=9 '\t') kernel.cl:5
         5         d = d + 2;	 

See Also