簡體   English   中英

Windows上的Ubuntu上的Visual Studio代碼和Bash(WSL)GCC / GDB集成

[英]Visual Studio Code and Bash on Ubuntu on Windows (WSL) GCC/GDB integration

目前,Visual Studio Code不支持在Windows內部進行調試。 如何設置vscode在Windows上使用bash中的gcc / gdb?

這是解決方案:

隨着Windows 10 Creators Update的發布,您現在可以使用Visual Studio Code和Microsoft C / C ++擴展來調試Ubuntu項目上的Windows子系統Linux(WSL)Bash。

https://github.com/Microsoft/vscode-cpptools/blob/master/Documentation/Debugger/gdb/Windows%20Subsystem%20for%20Linux.md

不容易,它可能無法正常工作。 首先,您必須在端口2020上運行sshd。

為此,請編輯

/etc/ssh/sshd_config

並設置選項:

Port 2020 ListenAddress 0.0.0.0 UsePrivilegeSeparation no PasswordAuthentication yes

然后,在WSL控制台內運行sudo service ssh start

然后,使用您的WSL用戶名和密碼將VS Code連接到127.0.0.1:2020

我不確定它的效果如何,但這就是你能做到的。

資料來源: https//github.com/Microsoft/BashOnWindows/issues/300

計划提供更好的支持和整合。 如果你很好奇,請看看2016年BlackHat的演講中的Alex Ionescu的幻燈片(在他的github上,轉到repo“lxss”並查看PDF)。 他描述了一個附加到lxsessionmanager Windows服務的未記錄的COM接口和一個WSL中未記錄的設備/dev/lxss ,它實際上是Win32 < - > WSL IPC的總線。 他展示了一個概念驗證服務器和客戶端,它通過總線從WSL Linux實例中啟動了一個Windows應用程序。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM