PlatformIO Community

Debugging using macOS lldb instead of gdb

Hi, I am new to platformio, so apologies in advanced if this question has previously been asked (I’ve scoured the net and couldn’t find anything).

Does anyone know how to get lldb working on platformio as apposed to gdb.

The usage of gdb should be engrained in the platformio-core code. Please file an issue at https://github.com/platformio/platformio-core/issues to get help from developers.

Since gdb does not work on M1 I would be interested in this too. Any progress?

P.S. Just used lldb as debugger and that worked a charm (unlike gdb on my old Intel which caused a hang). All I did was to add a config to launch.json like

    {
        "name": "(lldb) Starten",
        "type": "cppdbg",
        "request": "launch",
        "program": "<mypath>/PlatformIO/Projects/LLDB/.pio/build/native/program",
        "args": [],
        "stopAtEntry": false,
        "cwd": "${fileDirname}",
        "environment": [],
        "externalConsole": false,
        "MIMode": "lldb"
    },

where <mypath> is somewhere in my Documents folder.

P.P.S. Also it seemed to be a good idea to add something like

build_flags = 
  -g 

to the environment since although it debugged, some locations were weird and symbols not shown as debug info was not complete.