调试混合JNI代码的方法
Way to debug mixed JNI code?
我一直在寻找一种简单的方法来调试我的JNI代码,你知道,能够自由地跳转到本机代码和返回到java代码。
我找到的解决方案有点过时或有一些限制。有些需要特定的ndk版本,有些需要特定的Eclipse版本。这里我的目标是Android 1.6;2.2,我使用Eclipse 3.6 Helios,和NDK r5b。对于这种混合调试是否有一个通用的解决方案?Thx .
引用自$NDK/docs/NDK-GDB.html
:
重要:本机调试只能在所有条件满足的情况下工作:
1. Your application is built with the 'ndk-build' script: Building with the legacy "make APP=<name>" method is not supported by ndk-gdb. 2. Your application is debuggable: In other words, your AndroidManifest.xml has an <application> element that sets the android:debuggable attribute to "true" 3. You are running your application on Android 2.2 (or higher): ndk-gdb will not work if you try to run your application on previous versions of the system. That does not mean that your application should target the Android 2.2. API level, just that the debugging session should happen on a 2.2+ device or emulator system image.
所以,你不能使用1.6的设备。
如何设置环境来调试jni代码:我使用了这个配方,它适用于我。
相关文章:
- 使用不同的CRT将新的C++代码与旧的(二进制)组件隔离开来的最佳方法是什么
- 当无法使用模板和宏时,生成类型变体C++代码的最简单方法是什么?
- 有没有一种代码密度较低的方法来使用非默认构造函数初始化数组?
- 如何重写全局方法名称以在调用原始方法之前将我的代码推到前面
- 在nodejs中使用本机代码的最佳方法是什么?
- 函数从唯一代码调用正确的子类方法
- 如何启用使用另一个类的静态方法的模板函数的自动推导,从而消除冗长的调用方代码
- 有没有更好的方法来编写这个c++代码
- 终端进程终止,退出代码为:1有什么方法可以修复它吗
- 有没有一种预处理器的方法可以从调试符号中删除代码段
- C++:销毁此代码的最佳方法是什么?
- 在.cpp文件中定义方法而不是在 C++ 的 .h 文件中定义方法时,如何提高代码的性能?
- 为什么在我的代码中没有调用 g 模拟方法
- 设计许多单例代码结构的更好方法
- 两种专用方法中的相同代码
- Android 无法从本机代码调用 Java 方法 JNI
- 我的类中有方法的指针数组,但我不能调用我的方法.代码如下
- 如何在子类中获得相同的方法代码而不重复代码
- 如何只执行一次方法代码,尽管每帧调用一次
- 模板化的方法代码在哪里分配?