Effacer les filtres
Effacer les filtres

Matlab crashes while debugging mex file

4 vues (au cours des 30 derniers jours)
Michael
Michael le 2 Juil 2012
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.

Réponse acceptée

Walter Roberson
Walter Roberson le 2 Juil 2012
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.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB Compiler dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by