Is it possible to debug C MEX S-function in C::B during the simulation model in MATLAB?
This is very hard. You can try to attach the debugger to the s-function thread if you figure out the handle of your S-function DLL. However, for GDB to use you'll need to compile your S-function using GCC (which is not supported under Windows, natively - hence possible).
I'd suggest you either use something like IceBox (
http://www.zeroc.com/download.html,
http://www.zeroc.com/doc/) to do some kind of "remote debugging" or do it the old "fashion" way by putting a lot of printf's into your code or debug into a file. That's how I do it as it is fast, reliable and can be turned of e.g. via hash defines for releases.