I have a complex MATLAB program that I'm trying to interface and debug with some fairly complex C/C++ code. So I have multiple mex-files created to call different C/C++ functions from an external library. I need some help in setting the breakpoints when I run MATLAB within a debuggger.
I'm currently using ddd which is just a frontend to gdb. The examples in the MATLAB documentation only deal with the simple example of debugging a single mex-file. How do I specify a breakpoint for a specific mex-file?
If I type 'break mexFunction' as specified in the simple example in the documentation. I just get a breakpoint for the very first mexFunction that is called. And if I type break foo.c:mexFunction to stop at the entry point for a specific mex-file, I get the response "No source file named foo.c"
Are there any suggestions or methods to debug mex-files in this situation?
Best Answer