使用dart :: ffi从Dart包中调试C ++代码 [英] Debug C++ code from Dart package using dart::ffi

查看:381
本文介绍了使用dart :: ffi从Dart包中调试C ++代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发使用C ++的软件包,以便使用 dart :: ffi ,我想知道是否有比记录消息更好的方法来调试C ++代码(逐步观察,变量监视等等)。我已经在Android Studio和VS Code中都尝试过,都没有成功。

I am developing a package in C++ to be used in a Flutter app (and therefore in Dart), using dart::ffi and I was wondering if there was a better way to debug (step by step, variable watch, that sort of things) the C++ code, other than logging messages. I've tried both in Android Studio and VS Code, with no success.

推荐答案

Android Studio(或VS Code)没有在Flutter模式下(尚未)支持本机(C / C ++)代码调试。但是,有一种解决方法!在项目树中,右键单击 android文件夹,然后选择Flutter->在Android Studio中打开Android模块。该项目将切换到完全支持c / c ++调试的Android开发模式。现在,只需搜索 cpp文件夹,在其中的任何文件中设置断点并运行该应用程序即可(当然仍处于Android开发模式)!

Android Studio (or VS Code) doesn't support native (C/C++) code debugging while in Flutter mode (yet). However, there is a workaround! In the project tree, right-click the 'android' folder and select Flutter -> Open Android module in Android Studio. The project will switch to Android development mode where c/c++ debugging is fully supported. Now just search for the 'cpp' folder, set breakpoints in any of the files there and run the app (while still in the Android development mode of course)!

这篇关于使用dart :: ffi从Dart包中调试C ++代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆