Modifying Data and Code memory in Device Kernel using CUDA-GDB source code.

I was trying to look at the CUDA-GDB code to be able to write a program that could.

  1. Pause the execution of the application program.
  2. modify the data memory and the code memory inside the device kernel code.

There is no documentation available for the cuda-gdb source code and I don’t find much mention of anything in the comments too.

How can one learn how to do all this ?

Hi, Abhay

You cannot modify code memory other than to insert a “breakpoint” which you won’t see when reading the code memory. You will only see that execution has stopped. The CUDA Debugger API does not support arbitrary code modification or binary instrumentation, it is merely for run control and inspection, exactly what a debugger does. We do not plan to allow this kind of patching in the near future.

That said – data memory in different parts of the memory hierarchy can be modified via the standard api calls:
http://docs.nvidia.com/cuda/debugger-api/group__WRITE.html#group__WRITE