MEX Debugging with VS code

조회 수: 14 (최근 30일)
aelray
aelray 2018년 9월 6일
댓글: aelray 2018년 9월 12일
Hi,
I'm trying to use VS Code to debug mex-files. I used the tutorial described here. However, my breakpoints seem to be simply skipped. Does somebody has similar experiences or perhaps even a solution to the problem?
For compilation I used MATLAB R2016b (tried also 2018a with no effect) and mingw64 with gcc version 7.3.0. The used gdb version is 8.0.1.
Any help would be appreciated, thank you!
  댓글 수: 3
mbvoyager
mbvoyager 2018년 9월 11일
Did you try to set the breakpoint at the line of the mexFunction? This is described as convenient here.
aelray
aelray 2018년 9월 12일
I tried rebuilding and I also put a breakpoint on the line of mexFunction, both had no effect.

댓글을 달려면 로그인하십시오.

답변 (1개)

Lipi Vora
Lipi Vora 2018년 9월 10일
Hi,
I followed the steps mentioned in the tutorial for an example MEX file found in my case in, “C:\Program Files\MATLAB\R2018a\extern\examples\mex\arrayProduct.c” MATLAB folder. I am able to hit breakpoints in the “arrayProduct” function in VS Code. I would recommend you try the steps with a sample MEX file to eliminate issues that might be arising specific to your source code.
Also, could you attach an image of the lines where you have issued a breakpoint? At times these breakpoints might have a warning symbol attached to it which might pre-indicate that the breakpoint would not be hit.
  댓글 수: 2
mbvoyager
mbvoyager 2018년 9월 11일
편집: mbvoyager 2018년 9월 11일
What compiler version did you use? Is it possible that you provide a source?
aelray
aelray 2018년 9월 12일
Tried the example from “C:\Program Files\MATLAB\R2018a\extern\examples\mex\arrayProduct.c” and was still unable to hit the breakpoint.
g++ -v leads to gcc version 7.3.0 (Rev1, Built by MSYS2 project).
Screenshot of the example from the tutorial:

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

태그

제품


릴리스

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by