Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to attach matlab.exe process to visual studio 2013 for debugging mex files?

I am writing some mex files to run in my matlab program using visual studio 2013 compiler.
In order to be able to debug your mex files, you should follow these steps
Everything was right just some minutes ago and I was doing my project without any problem.
Today I have typed the code

mex -g mx_minimum_power.cpp cvm_em64t_debug.lib  

on command prompt many times and after getting the success message, I've attached matlab.exe to visual studio and through setting a break point, I've debugged my code.
But this time I suddenly ran into the following error and I don't know how to solve it.
enter image description here

enter image description here

When I right-clicked on the third option and clicked run as administrator, I encountered the following message:
enter image description here

Then if I choose configure remote debugging, I'll encounter:
enter image description here

Now I have the following processes that are shown to be running.

enter image description here

and again:
enter image description here

When I click on permissions or options for remote debugger:

enter image description here

like image 517
Sepideh Abadpour Avatar asked Sep 03 '16 22:09

Sepideh Abadpour


People also ask

How do I debug a MEX file in Matlab?

To debug your MEX functions, use the disp function to inspect the contents of your MEX function variables. You cannot use save to debug MEX function variables because code generation does not support it. Code generation does not support declaration of save as extrinsic.


1 Answers

After running visual studio remote debugging monitor and getting the following message:

enter image description here

One should click the Find button in this window in order to find the msvsmon.exe that is being run on the subnet

enter image description here

and then choose MATLAB.exe, in the Available Processes list.

enter image description here

like image 153
Sepideh Abadpour Avatar answered Oct 29 '22 02:10

Sepideh Abadpour