Unable to debug C-MEX source files under Matlab R2017b and Visual Studio Community 2017

조회 수: 1 (최근 30일)
Hi, I am recently writing C-MEX files but I find I am unable to debug the code. I use Matlab R2017b and Visual Studio Community 2017, and follow the debug instructions in here (specify '-g' option when compiling, attach MATLAB process to Visual Studio, and set breakpoints), but when I run the mex file, it just went through all the breakpoints and produce the result, not pausing at any of the breakpoints.
I wish to know how to solve this problem? Did I miss some steps?
Microsoft Visual C++ (2017) is the only compiler I have installed. And here is the installed components. Did I miss some components?

답변 (1개)

Ran Chen
Ran Chen 2018년 8월 9일
Hello,
I understand that you are unable to reach the breakpoint in Visual Studio. Unfortunately, I cannot reproduce the issue on my end. MATLAB R2017b supports debugging with the Visual Studio Community 2017, and it seems that you have all the proper tools installed.
The process you run the code using command in MATLAB should work the same as you click the run button in the Visual Studio in debug mode. Please make sure of the following:
1. Please make sure you are compiling the MEX file using the ‘-g’ flag.
2. Please make sure you are attaching the correct MATLAB process that is used to execute the MEX file.
3. Please check whether breakpoints are set in lines which are reachable at runtime.
If you still experiencing the issue, you may consider getting more information from the Visual Studio support team.

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by