Arguments to DAP

I am trying to debug my cpp program that requires to be run on dGPU (for OpenCL). When I debug with gdb i would just call gdb with my dGPU render-offload prefix prime-run gdb myProgramBinary. When i run in gdb it runs as expected on dGPU

Is there a way to do this with nvim-dap? I am using vscode-cpptools with Gdb-MI.

What I have tried so far is pre-pending prime-run in cpp-tools adapter settings

dap.adapters.prime = {
-- stuff
command = "/usr/bin/prime-run " .. actualDAPCommand

which fails to launch. I have also tried prepending the prime-run in the configurations through program = function() "/usr/bin/prime-run " .. whateverBinaryFetchingMethod also with no luck.

Is there a way to declare this?

I’d ask this in the nvim-dap discussions. The author is helpful and you’ll likely get better help there.

@dundargoc Thanks. i did just that and it was solved

For those interested here it is

1 Like