1

Hi I have written a mex file and I would like to debug it using visual studio 2010. I followed steps mentioned in Mathwork website :

http://www.mathworks.com/help/matlab/matlab_external/debugging-on-microsoft-windows-platforms.html

I have also read following posts:

how to debug MATLAB .mex32/.mex64 files with Visual Studio 2010

I should mention that I can compile mex with -g code successfully but when I insert the breakpoint it says: the breakpoint cannot be currently hit. No symbols have been loaded for this document.

Then when I run the mex code from Matlab, it does not create any break point and it does not do the debugging.

According to the following : Fixing "The breakpoint will not currently be hit. No symbols have been loaded for this document." When I go to debug--> windows--> module--> next to matlab says cannot find or open the PDB file. I do not understand what he means when he says

" In normal projects, the assembly and its .pdb file should always have been copied by the IDE into the same folder as your .exe. The bin\Debug folder of your project. Make sure you remove one from the GAC if you've been playing with it."

my Matlab is located in C:\Program Files\MATLAB\R2012a and the mex and pdb file is in C:\Documents\Matlab file but I copied the pdb file (I do not know it is necessary or not) to Matlab workspace. The Matlab current folder that code is running is also C:\Documents\Matlab. Can anyone please help me to solve this problem.

Can anyone please hel me to solve this problem?

Community
  • 1
  • 1
justin
  • 173
  • 2
  • 3
  • 11
  • this seems to be what my system is like every time I deal with MEX files; however, when I run the program, it hits mex breakpoints with no issues. Have you tried restarting Matlab and attaching process in Visual Studio again? It does the trick for me sometimes, especially, if the mex file caused some memory violation. – AlexanderF Jul 04 '16 at 00:58
  • Yes I tried to do that 10 times restarting Matlab and VS 2010 and attaching process again in Matlab but still it does not work.Any suggestion? – justin Jul 04 '16 at 02:26
  • Is the code you are debugging part of compilation or is it linked as an external library? – Navan Jul 05 '16 at 15:20

0 Answers0