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 }}
Repository navigation
Support Apple Silicon ARM64 architecture natively for debugger #7035
This feature request is to have debugger binaries to run natively on Apple Silicon ARM64.
The feature request to have the language server binaries to run natively on Apple Silicon ARM64 is tracked by #6595
Note: the cpptools, cpptools-srv, and debugger binaries built for macOS x64 may work on Apple Silicon's x64 emulator, however this may use more resources than having binaries run natively as ARM64 on Apple Silicon.
Just some extra info here. VSCode (stable channel) has been released for ARM64-based Macs. Attempting to start debuggers on ARM64 Macs with "targetArchitecture": "arm64" will yield this error:
ERROR: Unable to start debugging. Unexpected LLDB output from command "-exec-run". process exited with status -1 (attach failed ((os/kern) invalid argument))
Reacted by Stefan Kizim, Liam O'Neil, AdrianLicu, Zacharie SHOKEIR, Igor Skochinsky, RamonBa, Tristan C, Sameer, Javier Gutierrez, ilexiv and 24 more
Lihp8270
The feature to support native debugging on Apple Silicon ARM64 has not been done yet. You can run the current debugger binaries built for Apple Intel x64 using the Rosetta emulator. Note that the debugger for Apple Intel x64 can only debug x86_64 binaries.
Any updates on this. I've been having issues running the debugger the debugger for C++
Reacted by Enver Romon, Kamil Kisiel, Benjamin Hoffman, Bihan Sen, Anıl Zeybek, Dongze Li, Jakub Siekiera, Mark Engle, Michael Denis, Jonas Sander and 3 more
Does anyone know if this has been fixed? Quite new to vs code, would you recommend downloading the intel version and running through rosetta to use the debugger?
Does anyone know if this has been fixed? Quite new to vs code, would you recommend downloading the intel version and running through rosetta to use the debugger?
No, get the M1 version of Visual Studio Code - but the application you want to debug needs to be built for x86_64 and will be run via Rosetta.
Reacted by Benjamin Hoffman, Nicolae Tudor, Jakub Siekiera, Chuqing (Breeca) Shi and Jonas Sander
Thanks for the hint! Building using Clang x86_64-apple-darwin and then debugging yields the same error. I think I'm way in over my head here, do I need to change anything else?
You need both the executable and the debugger to target x86_64.
I have: "targetArchitecture": "x86_64" in launch.json and "-DCMAKE_OSX_ARCHITECTURES=x86_64" in my build command (use --target=x86-64 if you just use clang).
Reacted by Benjamin Hoffman, Snowden Fu, Zack Wu and Prabhav Agrawal
Reacted by Austin Annestrand, Benjamin Hoffman, Pranav Singh, Nicolae Tudor, doveC, sahilmishra780, Dongze Li, Jakub Siekiera, Kishen Sharma, Kanghwan and 31 more
Reacted by Kishen Sharma, ejqs, Griffith, Pin Xiong, Suhas Rohit Pai, Zack Wu, Mattias Ljungström, Gajendra Pratap Singh, Patrick Miravalle II, RuGrantez and 1 more
Reacted by Kishen Sharma, Griffith, Pin Xiong, Zack Wu, uri, Christophe Haddad, Gajendra Pratap Singh, Patrick Miravalle II, Jan Kristian Bjerke and RobMin
Reacted by Kishen Sharma, Griffith, Pin Xiong, Suhas Rohit Pai, Mattias Ljungström, Gajendra Pratap Singh, Patrick Miravalle II, RobMin and kaynert
You need both the executable and the debugger to target x86_64.
I have: "targetArchitecture": "x86_64" in launch.json and "-DCMAKE_OSX_ARCHITECTURES=x86_64" in my build command (use --target=x86-64 if you just use clang).
I'm new to all of this so bare with me please. When you say place -DCMAKE_OSX_ARCHITECTURES=x86_64 in your build command? What do you mean by build command? Is it the tasks.json? More info would be greatly appreciated.
I just migrated from Windows to Mac, but getting an IDE for C++ has proven to be a headache, now I'm contemplating going back to VS Community on Windows.
I just migrated from Windows to Mac, but getting an IDE for C++ has proven to be a headache, now I'm contemplating going back to VS Community on Windows.
Currently the best C++ IDE on a Mac with M1 is Xcode of Apple, while wait vscode ...
stelatoris, I have a normal library and test executable. When I started using my M1, I could not debug it unless I specified for cmake to only build the x86_x64 version. To do that, go into Settings -> Cmake: Configure Args:
Otherwise, cmake will build one binary with both x86_x64 and arm_x64 slices, and the debugger will try to run the arm_x64 slice.
I just migrated from Windows to Mac, but getting an IDE for C++ has proven to be a headache, now I'm contemplating going back to VS Community on Windows.
Currently the best C++ IDE on a Mac with M1 is Xcode of Apple, while wait vscode ...
I tried Xcode, but it does not seem to highlight anything for C++ syntax like Intelisense or VS Community. Do I need to install some plugins? I'm new to programming, for about 5 months now. So I'm not building anything heavy, just simple multi file programs while I go through Stroustrups PPP book.
What about CLion? The demo I tried seems to be close enough to VS Community feel.
I believe I have found a better workaround until this gets fixed. I used -DCMAKE_OSX_ARCHITECTURES=x86_64;arm64. This makes CMake generate a Universal build which contains both an Intel-compatible and an Apple Silicon native executable.
Apparently, when this build is ran without a debugger (with ⇧ fn F5), the native ARM executable gets chosen. At the same time, when running with a debugger (with ⌃ fn F5) the Intel one runs and it can be successfully debugged.
Reacted by Andre Weissflog, Jérémy Lalonde, Kanav Mittal, Артём Оконечников, Jakob Rath and David Brown
Why after one and half years of M1 MacBook release, this basic feature is still unsupported? Are there any terrible challenges? Why CodeLLDB can do it?
Reacted by Akif AYDIN, Kuo-Hao Huang, Aidan Gibson, The1111mp and ngn999
Native debugging support for M1 macOS has been added in 1.9.3.
Reacted by Sunbreak, Joseph Monaco, The1111mp, ngn999, Jason Millard, Xinyu Zeng, Zhibin Huang, Will Jones, Mattias Ljungström, Gabin Lefranc and 9 more
Reacted by Abe Fettig, Mattias Ljungström and Khalil Estell
Reacted by The1111mp, Jacob Weber, Jakob Rath, Mattias Ljungström, Curtis Wensley, Mike, Khalil Estell, Amadej Papež, Geoffrey Lovelace and Bartek Pacia
Reacted by The1111mp, Gabin Lefranc, Matt Stephenson, giuliocorradini, Khalil Estell, Amadej Papež and Jonathan Helgert
Reacted by The1111mp, Mattias Ljungström, Mike, Khalil Estell, Amadej Papež, SH, Korf, Sascha Alexander and Nathan Glenn
Colen Garoutte-Carson (@Colengms) I am actually having this same issue. Running cpptools version 1.13.8 on an Intel mac. Getting the exact same error as the OP stated
Warning: Debuggee TargetArchitecture not detected, assuming x86_64.
ERROR: Unable to start debugging. Unexpected LLDB output from command "-exec-run". process exited with status -1 (attach failed (Not allowed to attach to process. Look in the console messages (Console.app), near the debugserver entries, when the attach failed. The subsystem that denied the attach permission will likely have logged an informative message about why it was denied.))
The program '/Path/to/Project/GameDev/dapper-dasher/main' has exited with code 42 (0x0000002a)
Activity
XIAZY commentedon Mar 18, 2021
Just some extra info here. VSCode (stable channel) has been released for ARM64-based Macs. Attempting to start debuggers on ARM64 Macs with
"targetArchitecture": "arm64"will yield this error:Lihp8270 commentedon Apr 13, 2021
I'm also experiencing the same issue on the latest update on VSCode running natively on M1.
michelleangela commentedon Apr 13, 2021
Lihp8270
The feature to support native debugging on Apple Silicon ARM64 has not been done yet. You can run the current debugger binaries built for Apple Intel x64 using the Rosetta emulator. Note that the debugger for Apple Intel x64 can only debug x86_64 binaries.
jmarti44 commentedon May 6, 2021
Any updates on this. I've been having issues running the debugger the debugger for C++
benjirer commentedon May 12, 2021
Does anyone know if this has been fixed? Quite new to vs code, would you recommend downloading the intel version and running through rosetta to use the debugger?
cloph commentedon May 12, 2021
No, get the M1 version of Visual Studio Code - but the application you want to debug needs to be built for x86_64 and will be run via Rosetta.
benjirer commentedon May 12, 2021
Thanks for the hint! Building using Clang x86_64-apple-darwin and then debugging yields the same error. I think I'm way in over my head here, do I need to change anything else?
nicudo commentedon May 14, 2021
You need both the executable and the debugger to target x86_64.
I have: "targetArchitecture": "x86_64" in launch.json and "-DCMAKE_OSX_ARCHITECTURES=x86_64" in my build command (use --target=x86-64 if you just use clang).
kinkard commentedon May 15, 2021
Benjamin Hoffman (@benjirer) As alternative, you may try another debug extension for C++ - https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb which is able to debug native M1 binaries.
To switch to CodeLLDB debug extension you need to update your launch.json and set
"type": "lldb"and all should work fine.stelatoris commentedon May 24, 2021
I'm new to all of this so bare with me please. When you say place -DCMAKE_OSX_ARCHITECTURES=x86_64 in your build command? What do you mean by build command? Is it the tasks.json? More info would be greatly appreciated.
I just migrated from Windows to Mac, but getting an IDE for C++ has proven to be a headache, now I'm contemplating going back to VS Community on Windows.
theFabriZ commentedon May 24, 2021
Currently the best C++ IDE on a Mac with M1 is Xcode of Apple, while wait vscode ...
jsm174 commentedon May 24, 2021
stelatoris, I have a normal library and test executable. When I started using my M1, I could not debug it unless I specified for cmake to only build the x86_x64 version. To do that, go into Settings -> Cmake: Configure Args:
Otherwise, cmake will build one binary with both x86_x64 and arm_x64 slices, and the debugger will try to run the arm_x64 slice.
stelatoris commentedon May 24, 2021
I tried Xcode, but it does not seem to highlight anything for C++ syntax like Intelisense or VS Community. Do I need to install some plugins? I'm new to programming, for about 5 months now. So I'm not building anything heavy, just simple multi file programs while I go through Stroustrups PPP book.
What about CLion? The demo I tried seems to be close enough to VS Community feel.
14 remaining items
lademinoye commentedon Dec 5, 2021
Ditto!
floooh commentedon Dec 6, 2021
+1
ilg-ul commentedon Dec 10, 2021
+1
1111mp commentedon Dec 20, 2021
+1
janekb04 commentedon Dec 26, 2021
I believe I have found a better workaround until this gets fixed. I used
-DCMAKE_OSX_ARCHITECTURES=x86_64;arm64. This makes CMake generate a Universal build which contains both an Intel-compatible and an Apple Silicon native executable.Apparently, when this build is ran without a debugger (with ⇧ fn F5), the native ARM executable gets chosen. At the same time, when running with a debugger (with ⌃ fn F5) the Intel one runs and it can be successfully debugged.
AvivPeledTalon commentedon Dec 28, 2021
This would help a lot! +1
kammce commentedon Feb 10, 2022
Just hit this issue. +1
FischLu commentedon Feb 18, 2022
Why after one and half years of M1 MacBook release, this basic feature is still unsupported? Are there any terrible challenges? Why CodeLLDB can do it?
sean-mcmanus commentedon Feb 18, 2022
FischLu Build lab issues. We're working on it.
1111mp commentedon Mar 6, 2022
Good things are worth the wait.Colengms commentedon Mar 10, 2022
Native debugging support for M1 macOS has been added in 1.9.3.
blue42 commentedon Dec 21, 2022
Colen Garoutte-Carson (@Colengms) I am actually having this same issue. Running cpptools version 1.13.8 on an Intel mac. Getting the exact same error as the OP stated
launch.json
I did not have any issues two days ago, and now I am getting this error. I haven't changed anything.