Samsung / netcoredbg

NetCoreDbg is a managed code debugger with MI interface for CoreCLR.
MIT License
780 stars 101 forks source link

Issues inside chroot (Failed command 'configurationDone' : 0x8007000c) (nvim-dap) #113

Open ghost opened 1 year ago

ghost commented 1 year ago

I'm don't really think this is an issue with netcoredbg, but when i'm running it with nvim-dap inside chroot i'm getting: Failed command 'configurationDone' : 0x8007000c

A look at the edbg log shows:

39550.740 I/NETCOREDBG(P4608, T4623): vscodeprotocol.cpp: operator(570) > exception '[json.exception.out_of_range.403] key 'env' not found' 39550.757 E/NETCOREDBG(P4608, T4627): manageddebugger.cpp: RunProcess(679) > m_dbgshim.RegisterForRuntimeStartup(m_processId, ManagedDebugger::StartupCallback, this, &m_unregisterToken) : 0x8007000c

I searched if someone else has similar issues found that another one also had issues with "key 'env' not found". What is this env-key and why does it seem to work if when I'm not inside chroot?

gbalykov commented 1 year ago

Please describe your environment in more detail (OS, etc.), how you build netcoredbg, how you launch it, etc.

ghost commented 1 year ago

I realised this probaby isn't the place to ask. Maybe I should've asked on some other place.

Anyway, I'm using Void LInux with the netcore binary. Latest version. I'm launching it with "netcoredbg --interpreter=vscode --log=file' with nvim-dap.

gbalykov commented 1 year ago

You can try to add empty env key just as in https://github.com/Samsung/netcoredbg/issues/57#issuecomment-817345183. Not sure, why it works without chroot though. Why do you need chroot in the first place?

ghost commented 1 year ago

I'm installing most of my stuff that I need for school in in a chroot environment. I tried to figure out how to add an empty 'env' key, but couldn't figure it out. First I thought I could set it inside my nvim-dap configuruatoin like this:

dap.configurations.cs = { { type = "coreclr", name = "launch - netcoredbg", request = "launch", env = "", program = function() return vim.fn.input('Path to dll', vim.fn.getcwd() .. '/bin/Debug/', 'file') end, }, }

But I couldn't. Don't even know that the "env"-key is.

gbalykov commented 1 year ago

My question about chroot was mostly whether you use same arch or not (i.e. qemu is also used), then I guess you use the same arch. Regarding env key, I'm not familiar with nvim-dap, but according to the comment that I mentioned, there's probably some config for neovim somewhere, and you can set env near stopAtEntry:

{"command": "launch", "arguments": {"cwd": "/Users/ben/.vim/bundle/vimspector/support/test/csharp", "request": "launch", "program": "/Users/ben/.vim/bundle/vimspector/support/test/csharp/bin/Debug/netcoreapp2.2/csharp.dll", "args": [], "stopAtEntry": true, "env": {}, "name": "test"}, "seq": 3, "type": "request"}Content-Length: 61\r\n