c - 如何同时调试C和Matlab代码?

标签 c matlab debugging

我有一些使用我创建的 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/

相关文章:

c - 枚举周围的方括号是什么意思? [枚举值]

c++ - 为什么我需要运行我的 makefile 两次来编译我的代码

matlab - 计算唯一元素对之间的差异 - MATLAB

java - 防止 Eclipse 在调试时移动到代码行

c - Up-Down 控件比好友高

C:简单代码未按预期工作(PIC micro)

matlab - 返回特定属性的默认 get 方法 - MATLAB

matlab - 如何在 MATLAB 中将矩阵乘以标量值

c# - 为什么我的 C# 调试器会跳过断点?

java - 在 Eclipse 中,如何在显示窗口中显示调试器代码执行的异常消息?