Debug C++ code from Dart package using dart::ffi

独自空忆成欢 提交于 2020-06-29 03:58:07

问题


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.


回答1:


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)!



来源:https://stackoverflow.com/questions/62351258/debug-c-code-from-dart-package-using-dartffi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!