With mex files, you are potentially corrupting the internal state of MATLAB. There is no protection layer or emulation layer: you get direct access to pointers being used by MATLAB and if (perhaps due to bugs) your code doesn't play well with MATLAB, then MATLAB will crash.
Matlab crashes while debugging mex file
2 次查看(过去 30 天)
显示 更早的评论
I am writing C code and compiling to mex files. I compile with the -g option and debug with Visual Studio (I use the Tools -> Attach to Process option in VS). However, when there is an error in the code and I stop the run (with the Stop Debugging button) Matlab crashes. This also happens if I simply run a mex file with an error and Visual Studio is not attached to Matlab.
Is there a way to debug C code without Matlab crashing?
Thanks a lot,
Michael.
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!