Thank you @ivankravets I tried it. But if by “cppdbg extension” you mean the native debug extension for vscode, it is not working, I still have the same error.
Thank you for the tips @thomas.kilian.0815.
I modified my launch.json like this with my own main.o path:
{
"version": "0.2.0",
"configurations": [
{
"name": "(lldb) Starten",
"targetArchitecture": "arm64",
"type": "cppdbg",
"request": "launch",
"program": "/Users/guillaumecostes/Documents/PlatformIO/Projects/231218-164431-hello-world/.pio/build/native/src/main.o",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "lldb"
},
{
"type": "platformio-debug",
"request": "launch",
"name": "PIO Debug",
"executable": "/Users/guillaumecostes/Documents/PlatformIO/Projects/231218-164431-hello-world/.pio/build/native/program",
"projectEnvName": "native",
"toolchainBinDir": "/usr/bin",
"internalConsoleOptions": "openOnSessionStart",
"preLaunchTask": {
"type": "PlatformIO",
"task": "Pre-Debug"
}
},
{
"type": "platformio-debug",
"request": "launch",
"name": "PIO Debug (skip Pre-Debug)",
"executable": "/Users/guillaumecostes/Documents/PlatformIO/Projects/231218-164431-hello-world/.pio/build/native/program",
"projectEnvName": "native",
"toolchainBinDir": "/usr/bin",
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "platformio-debug",
"request": "launch",
"name": "PIO Debug (without uploading)",
"executable": "/Users/guillaumecostes/Documents/PlatformIO/Projects/231218-164431-hello-world/.pio/build/native/program",
"projectEnvName": "native",
"toolchainBinDir": "/usr/bin",
"internalConsoleOptions": "openOnSessionStart",
"loadMode": "manual"
}
]
}
It is kind of working since I do not get the previous error. And if i forget to make a build, It tells me that my path “…/main.o” does not exists. But after building, I do not have this error, so I think it can find the main.o file.
BUT now i got this error :
ERROR: Unable to start debugging. Unexpected LLDB output from command "-exec-run". Command 'exec-run'. Invalid process during debug session
The program '/Users/guillaumecostes/Documents/PlatformIO/Projects/231218-164431-hello-world/.pio/build/native/src/main.o' has exited with code 42 (0x0000002a).
I did some research. I found the exact same issue on a forum :
so I tried the solution and installed the CodeLLDB extension, then modified “type”: “cppdbg”, to “type”: “lldb”. I tried again to debug. This time, I got a popup message with “Permission denied” that proposes me to check the launch.json file. So I check, some field of the configuration are highlighted as “not allowed properties” so i removed those fields, but I still get the “Permission denied” popup.
A made some research about the permission denied with debugger, but nothing that could match my case.
So I don’t know what to do to make it work.