That's unfortunately a known bug with Xenomai 2: debugging with gdb
is difficult. In particular, it seems to work for me when there is only one real-time thread (that is: when you are not using Scope
or WriteFile
or Udp...
or OSC...
stuff).
For instance, I can build the basic
example and debug it with gdb
.
In order to remove optimizations and add debug symbols - so to make the program actually debuggable - you need to invoke make debug
after cleaning the project.
In the IDE you would go to the project explorer and hit "clean project", then go to the project settings, make parameters
and add debug
in there.
If you compile from the command line, I'd use
make -C /root/Bela PROJECT=projectname clean debug run
If the above does not work, another thing you could do is to call render(context, userData)
multiple times from within setup()
. This way you would do everything in the Linux domain (before starting a Xenomai task), so gdb
should have no problems. You would not get any input or output, but chances are it may point you to the source of your segfault just fine (assuming this does not depend on an external input).