我有一些使用我创建的 C 函数的 Matlab .m
文件。
在 Matlab 或 Visual-Studio 中进行调试时,是否有任何方法可以逐步运行 C 和 Matlab 代码,使 Matlab 和 C 变量都可用于调试?
最佳答案
这只解决了你问题的 MSVS 一半......
使用逐步调试的步骤Visual Studio are outlined here 。这只是一个以 .dll 为中心的异常(exception),该 .dll 由预先存在的应用程序托管。 Matlab 有资格作为主机应用程序,无论它是否也在 Debug模式下运行。
Start debugging from the calling app
The app that calls a DLL can be:
An app from a Visual Studio project in the same or a different solution from the DLL. An existing app that is already deployed and running on a test or production computer. Located on the web and accessed through a URL. A web app with a web page that embeds the DLL.
To debug a DLL from a calling app, you can:
Open the project for the calling app, and start debugging by selecting Debug > Start Debugging or pressing F5. or Attach to an app that is already deployed and running on a test or production computer. Use this method for DLLs on websites or in web
apps. For more information, see How to: Attach to a running process.
Before you start debugging the calling app, set a breakpoint in the DLL. See Using breakpoints. When the DLL breakpoint is hit, you can step through the code, observing the action at each line. For more information, see Navigate code in the debugger.
During debugging, you can use the Modules window to verify the DLLs and .exe files the app loads. To open the Modules window, while debugging, select Debug > Windows > Modules. For more information, see How to: Use the Modules window. Use the Immediate window
You can [also] use the Immediate window to evaluate DLL functions or methods at design time. The Immediate window plays the role of a calling app.
[and so on....]
关于c - 如何同时调试C和Matlab代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58171523/