dap-mode
dap-mode copied to clipboard
[BUG] Cannot find mono.linux-x86_64 on Nixos
Hi,
I'm trying to setup cpp debug on Nixos. dap-cpptools
is loaded and I did M-x dap-cpptools-setup
.
But I get in the stderr buffer.
/home/ztlevi/.config/emacs/.local/etc/dap-extension/vscode/cpptools/extension/debugAdapters/OpenDebugAD7: line 39: /home/ztlevi/.config/emacs/.local/etc/dap-extension/vscode/cpptools/extension/debugAdapters/mono.linux-x86_64: No such file or directory
I have lldb, gdb, and mono installed in the system.
cpptools/extension/debugAdapters on develop [⇡]
✖ which gdb
/etc/profiles/per-user/ztlevi/bin/gdb
cpptools/extension/debugAdapters on develop [⇡]
➜ which lldb
/etc/profiles/per-user/ztlevi/bin/lldb
cpptools/extension/debugAdapters on develop [⇡]
➜ mono --version
Mono JIT compiler version 6.12.0.122 (tarball Tue Nov 23 07:05:07 UTC 2021)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
Interpreter: yes
LLVM: supported, not enabled.
Suspend: hybrid
GC: sgen (concurrent by default)
The error looks weird because the file does exist. I even try to change the ownership to 755 but still not working.
cpptools/extension/debugAdapters on develop [⇡]
➜ pwd
/home/ztlevi/.config/emacs/.local/etc/dap-extension/vscode/cpptools/extension/debugAdapters
cpptools/extension/debugAdapters on develop [⇡]
➜ ll
Permissions Size User Group Date Modified Name
drwxr-xr-x - ztlevi users 2 Jan 16:50 bin
drwxr-xr-x - ztlevi users 2 Jan 16:50 framework
.rwxr-xr-x 4.3M ztlevi users 15 Jul 2020 mono.linux-x86_64
.rwxr-xr-x 1.1k ztlevi users 2 Jan 16:57 OpenDebugAD7
The debug template I use is this. I also tried MIMode
as gdb but no luck.
{
"name": "Sample1 Unittest Debug",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/tests/sample1_unittest",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "lldb",
// For emacs dap-mode https://github.com/emacs-lsp/dap-mode/blob/eda32995c3208bb41879b9302afb0f32d3b7adf0/docs/page/features.md#compiling-the-project-before-debugging
"dap-compilation": "cmake --build build --config Debug --target all -j 14 --",
// For vscode tasks
"preLaunchTask": "cmake build"
},
I think the error can be easily reproduced. Please take a look and see if you have any clue.
Thank you!
Hi there, I'm having the same issue and can confirm that ldd mono.linux-x86_64
shows that everything is OK with the shared libraries
ldd mono.linux-x86_64
linux-vdso.so.1 (0x00007fff4c5d7000)
libm.so.6 => /nix/store/rir9pf0kz1mb84x5bd3yr0fx415yy423-glibc-2.33-123/lib/libm.so.6 (0x00007f2ef1c83000)
librt.so.1 => /nix/store/rir9pf0kz1mb84x5bd3yr0fx415yy423-glibc-2.33-123/lib/librt.so.1 (0x00007f2ef1c78000)
libdl.so.2 => /nix/store/rir9pf0kz1mb84x5bd3yr0fx415yy423-glibc-2.33-123/lib/libdl.so.2 (0x00007f2ef1c73000)
libpthread.so.0 => /nix/store/rir9pf0kz1mb84x5bd3yr0fx415yy423-glibc-2.33-123/lib/libpthread.so.0 (0x00007f2ef1c53000)
libgcc_s.so.1 => /nix/store/rir9pf0kz1mb84x5bd3yr0fx415yy423-glibc-2.33-123/lib/libgcc_s.so.1 (0x00007f2ef1c39000)
libc.so.6 => /nix/store/rir9pf0kz1mb84x5bd3yr0fx415yy423-glibc-2.33-123/lib/libc.so.6 (0x00007f2ef1a64000)
/lib64/ld-linux-x86-64.so.2 => /nix/store/rir9pf0kz1mb84x5bd3yr0fx415yy423-glibc-2.33-123/lib64/ld-linux-x86-64.so.2 (0x00007f2ef1dc6000)