프로그래밍/Rust

Rust 개발환경 구축

Subi Lee 2022. 3. 11.
반응형

https://docs.microsoft.com/ko-kr/windows/dev-environment/rust/setup

 

Windows에서 Rust에 대한 개발 환경 설정

Windows에서 Rust로 앱을 개발하는 데 관심이 있는 초급자를 위한 개발 환경을 설정합니다.

docs.microsoft.com

 

먼저 이 글을 참고해서 진행했다.


  •  참고
    • CodeLLDB 확장 및 디버거에서 처음으로 앱을 실행하면 "시작 구성이 제공되지 않아 디버깅을 시작할 수 없습니다"라는 내용의 대화 상자가 표시됩니다. 확인을 클릭하면 "이 작업 영역에서 Cargo.toml 파일이 발견되었습니다. 이 파일의 대상에 대한 시작 구성을 생성하시겠습니까?"라는 내용의 두 번째 대화 상자가 표시됩니다. 를 클릭합니다. 그런 다음, launch.json 파일을 닫고 디버깅을 다시 시작합니다.
  • 보시다시피 디버거가 2번 줄에서 멈춥니다. F5 키를 눌러 계속 진행하면 앱이 완료될 때까지 실행됩니다. 터미널 창에는 우리가 예상한 대로 "Hello, world!" 메시지가 출력됩니다.

 

해당 부분에서 브레이크포인트가 걸리지 않는다.

살짝 검색해 보니 CodeLLDB를 쓸때는 sourceMap을 launch.json에 추가해줘야 할 것 같다.

https://blog.dbrgn.ch/2020/12/20/rust-vscode-lldb-breakpoints-not-working/

 

Breakpoints Not Working With VS Code + Rust + LLDB - blog.dbrgn.ch

(Note: This blogpost does not include any instructions on how to actually set up a launch config for debugging Rust code. There are plenty of tutorials for that already.) When you debug a Rust binary in VS Code with LLDB, and the breakpoints don't seem to

blog.dbrgn.ch

근데 저 빌어먹을 original-path부분을 도통 알 수가 없다.

다른 방법을 검색해본 결과 LLDB대신 C/C++을 사용하기로 함

https://www.forrestthewoods.com/blog/how-to-debug-rust-with-visual-studio-code/

 

How to Debug Rust with Visual Studio Code

Visual Studio Code is my Rust editor of choice. Unfortunately it can't quite debug Rust out of the box. Configuring the debugger isn't hard. But there are a few steps. I've gone through them several times now. I'm writing this guide to save future me from

www.forrestthewoods.com

CodeLLDB extension 제거하고 C/C++을 설치 후 launch.json 다시 설정해서 해결

몇년전에도 쓰려다가 윈도우에서는 제대로 되는게 없어서 안썼는데....

아직도 귀찮네....

반응형

댓글