When using custom code in Simulink, how do I look at stack trace information from a custom code crash?
8 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2017-10-13
回答: MathWorks Support Team
2018-1-18
When using custom code in Simulink, how do I look at stack trace information from a custom code crash?
采纳的回答
MathWorks Support Team
2017-10-13
Use a MATLAB Function Block in your model containing the following code:
coder.updateBuildInfo('addCompileFlags', '/Zi');
coder.updateBuildInfo('addLinkFlags', '/DEBUG');
Change the compile and link flags to be the appropriate flags for your compiler to produce debugging symbols.
Upon simulation, debugging symbols (if created as a separate file) will be produced in the directory (where <model> is the name of your model):
<currentFolder>\slprj\_sfprj\<model>\_self\sfun\src\
From the stack trace that appears in the Details view of the MATLAB crash window, use a tool that can read debugging symbols to determine the function and line number of each frame in the stack trace.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Environment Customization 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!