News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

C MEX S-function debug

Started by 7000kg, August 24, 2010, 01:56:15 PM

Previous topic - Next topic

7000kg

Hello,

Is it possible to debug C MEX S-function in C::B during the simulation model in MATLAB?

Thanks.

MortenMacFly

Quote from: 7000kg on August 24, 2010, 01:56:15 PM
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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]