You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Instantly share code, notes, and snippets.
👓
Addy
zethon
👓
I am a software engineer. I mostly work in C++, but I like to use C#, Python and other languages.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Getting VSCode's CMakeTools on Win10 to Launch a WSL2 Process as Root
When you set "miDebuggerPath": "/usr/bin/sudo" and "miDebuggerArgs": "/usr/bin/gdb", CMake Tools (or the Microsoft C++ debug adapter) then appends extra GDB flags like --interpreter=mi – but those end up being passed to sudo rather than gdb. Sudo complains about unrecognized options (anything starting with a dash), and so it fails.
You need a way for sudo itself to ignore those GDB options, so that they pass through to gdb. There are two main workarounds:
1) Use a Small “Wrapper” Script
One of the simplest solutions is to create a one-line shell script that runs gdb under sudo, and then reference that script as your debugger path. This way, the extra flags appended by VS Code or CMake Tools go to gdb correctly.