emacs-lsp / dap-mode

Emacs :heart: Debug Adapter Protocol
https://emacs-lsp.github.io/dap-mode
GNU General Public License v3.0
1.29k stars 180 forks source link

Passing Debug Arguments with .netcoredbg #574

Open larrasket opened 2 years ago

larrasket commented 2 years ago

There is no documentation about which flag to use in specifying the debugging arguments with .NetCoredDbg & weather to use :args or arguments :. I tried a bunch of configuration though, none worked, my program is still being launched without any arguments. Here is my last simple try:

(dap-register-debug-template
  "NetCoreDbg::Launch"
  (list :type "coreclr"
        :arguments "--file /home/ghd/me/temp/files/psdata/in/data.txt"
        :request "launch"
        :mode "launch"
        :name "testing::pleasework"))
s-kostyaev commented 2 years ago

Try to use args and add -- or even -- -- before real arguments https://github.com/Samsung/netcoredbg/issues/68#issuecomment-1008963684

s-kostyaev commented 2 years ago

and looks like args should be vector - https://code.visualstudio.com/docs/editor/variables-reference#_environment-variables not string

Xioulious commented 12 months ago

I'm running into this same problem, I need to start the debug on a different profile from what it defaults to. I tried the following in a .dir-locals.el file, but it doesnt seem to work:

((nil . ((eval . (dap-register-debug-template 
                                "NetCoreDbg::Launch-local"
                                  (list :type "coreclr"
                                        :args '("--launch-profile=https")
                                        :request "launch"
                                        :preLaunchTask "build"
                                        :mode "launch"
                                        :name "NetCoreDbg::Launch"
                                        :dap-compilation "dotnet build"
                                        ))))))

I've checked your links, but even with those I can't get to the right combination to get it to work. The debug will start with those settings, but it will ignore the argument given and thus start on the wrong profile still.