2011-04-08 6 views
2

저는 JNI 코드를 쉽게 디버깅 할 수있는 방법을 찾고자했습니다. 알다시피, 네이티브 코드로 자유롭게 뛰어 들어가서 자바 코드로 돌아갈 수 있습니다.혼합 된 JNI 코드를 디버깅하는 방법은 무엇입니까?

내가 찾은 해결책이 시대에 뒤쳐져 있거나 제한이 있습니다. 일부는 특정 ndk 버전이 필요하고 일부는 특정 Eclipse 버전이 필요합니다. 내 타겟은 안드로이드 1.6 & 2.2이고 Eclipse 3.6 Helios와 NDK r5b를 사용하고 있습니다. 이 혼합 된 디버깅을위한 일반적인 솔루션이 있습니까? 고마워. $NDK/docs/NDK-GDB.html에서

답변

1

Citate :

중요 : 기본 디버깅은 모든 다음 조건이 충족 경우 작업 할 수는 :

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 코드를 디버깅 할 환경을 설정하는 방법 : this recipe을 사용하면 저에게 적합합니다.

관련 문제