Hello everyone!
I'm currently working on a bigger project and would like to have following options during the development phase:
- Debugging
- Use on-the-fly code analysis
- Use static code analysis

For now I am developing remotely via ssh in VS Code. I've tried to debug using gdb with VS Codes "Native Debug" extension - without success. (side note: Also, when running gdb locally on Bela I get an Error: unable to initialise audio)

Before I dig deeper into it I'd like to ask what options do I generally have and what are the Pros and Cons of it?

The options I am currently aware of:
- ssh Remote developing and remote debugging (build, run & debug on Bela with remote access)
- Cross compiling it (develop, build, run & debug on my Ubuntu machine)
- Use a docker container

I'm pretty new to all of the mentioned options and would like to have some opinions to avoid a time intensive deep dive into all of them.

Thanks in advance!

    Max_ Also, when running gdb locally on Bela I get an Error: unable to initialise audio)

    Running gdb locally on the board should work just fine. What else does the error message say? It may be that you have another Bela program (or the same program in a different process) already running and only one process can run at a time. In order to make debugging more effective, I tend to also modify the Makefile replacing -O3 with -O0. Note that make won't rebuild any files purely as a consequence of this change, so you need to manually touch/rebuild the files you want to step through while debugging. Conversely, when you go back to -O3 you will want to make sure you rebuild all files that had been built with -O0. I normally take advantage of this process to only rebuild files I want to debug, without affecting the performance of the rest of the project and/or core files.

    Max_ - ssh Remote developing and remote debugging (build, run & debug on Bela with remote access)

    you can also start gdbserver on Bela and connect it from your favourite IDE. I have done this from Eclipse ages ago but most IDEs should allow this as a possibility. You will need to install gdbserver on Bela for this to work, which may require internet access on the board at least while installing.

    Max_ - Cross compiling it (develop, build, run & debug on my Ubuntu machine)

    As you have a Ubuntu machine, cross-compiling shouldn't be too hard, as cross compilers are readily available. You may want to consider using xcBela, which is the only one I have tried. Docker is also an option but perhaps it's better suited for macos/Windows where sometimes it's hard to get a cross compiler. I never used the Docker option and only briefly the xcbela one, so I may not be best placed to comment on the specifics of each.

    Max_ - Use on-the-fly code analysis

    What is this? A syntax-checker? If you have cross compilation enabled in VSCode, this should come for free?

    Max_ - Use static code analysis

    Never used this in any context, so I cannot be of much help.