Joymaker
Joymaker

Reputation: 1418

How to debug C++ under VSCode under Windows on Apple hardware?

I live on a Macintosh. I want to be able to build and debug my code on Macintosh and Windows both. So I set up my Windows world in a parallels VM running Windows 11, on my Apple Silicon 1 Macintosh. (MacOS 14.2.1)

Obviously I started this undertaking without the right advice, because I have gotten repeatedly lost. I'm really looking for guidance on what would have been the straightforward path, so I can explain it to others.

After installing CMake and VScode and its CMake Tools and MSYS2, I found myself in this cascade of confusions and backtracks:

  1. Turns out gdb won't run on Apple silicon hardware, you need to use lldb. So I install llvm/clang to get lldb.

  2. Oh, but actually, you need this other thing called lldb-mi. And that has stopped shipping with llvm, so you're stuck building it from source or so it would appear.

  3. Download sources for lldb-mi. cd …/lldb-mi-main ; cmake .

    Can't find the "Unix Makefiles" generator.

  4. Get past that, CMake can't find the "gcc" compiler. Oh, actually, you have to open this other MSYS2 shell in this other environment that has it. MINGW64 vs UCRT64. Now where was that explained, as I installed my MSYS2? UCRT64 was presented as a good default.

  5. Having gotten past that, the CMake for lldb-mi needs a file llvm-config.cmake which doesn't exist on the system, even after having installed llvm. Now I am lost indeed!

Is the thing I'm trying to do, debug C++ under VS Code on a Windows VM on a Macintosh, really so unusual? Is my experience typical?

Upvotes: 0

Views: 60

Answers (0)

Related Questions