2012-04-03 3 views
10

Android 용 장비를 컴파일하고로드하고 실행하는 프로젝트가 있습니다. 내가 gdb 서버를 호출하면 잘 동작한다. 내가 중단 점을 통해 실행하도록 GDB 클라이언트를 호출 할 때 다음 메시지가 나타납니다 때 : 이것은 내 현재의 Android.mk 파일은 경우에 몇 가지 추가 설정이 누락 될 수 있습니다,Android NDK 동적 링크 찾기 : 라이브러리를 디버그 할 수 없습니다.

Error while mapping shared library sections: 
/system/bin/linker: No such file or directory. 

libandroid.so: No such file or directory. 
liblog.so: No such file or directory. 
libEGL.so: No such file or directory. 
libOpenSLES.so: No such file or directory. 
libGLESv2.so: No such file or directory. 
libGLESv2_POWERVR_SGX540_120.so: No such file or directory. 
... 
warning: Unable to find dynamic linker breakpoint function. 
GDB will be unable to debug shared library initializers 
and track explicitly loaded dynamic code 
warning: shared library handler failed to enable breakpoint 

입니다 :

LOCAL_PATH := $(call my-dir) 
include $(CLEAR_VARS) 

LS_CPP=$(subst $(1)/,,$(wildcard $(1)/*.cpp)) 
APP_MODULES := callbacks 
APP_PLATFORM := android-14 
APP_OPTIM:= debug 

LOCAL_CFLAGS := -DRAPIDXML_NO_EXCEPTIONS 
LOCAL_CFLAGS += -g 
LOCAL_CFLAGS += -ggdb 
LOCAL_CFLAGS += -O1 

LOCAL_MODULE:=app3D 
LOCAL_SRC_FILES := $(call LS_CPP,$(LOCAL_PATH)) 
LOCAL_LDLIBS := -landroid -llog -lEGL -lOpenSLES -lGLESv2 
LOCAL_STATIC_LIBRARIES := android_native_app_glue png 
LOCAL_STATIC_LIBRARIES += /jni 

include $(BUILD_SHARED_LIBRARY) 

$(call import-module,android/native_app_glue) 
$(call import-module,libpng) 

그런 이상한 오류가 발생한 이유와 그 오류를 제거하는 방법에 대한 제안이 있으십니까?

모든 의견과 힌트를 진심으로 감사드립니다.

+1

Dude, 우리는 NDK에서 디버거를 가지고 있습니다.) 강제로하지 마십시오 .. GDB가 동적 인 lib에 붙지 않을 것이라고 생각합니다. 적어도 지금은 잘만되면 곧 .. – Tancho

답변

5

표준 gdb 대신 ndk-gdb을 사용하십시오. 프로젝트 루트 디렉토리에서 시작하십시오. ndk-gdb의 작업을보고 싶다면 --verbose 옵션을 사용하십시오. 또한 AndroidManifest.xml이 줄을 추가해야합니다

<application 
    android:icon="@drawable/ic_launcher" 
    android:label="@string/app_name" 
    android:theme="@style/AppTheme" 
    android:debuggable="true" > 

당신의 application.mk 당신이 '돈이 함께

APP_OPTIM := debug 

을 정의해야합니다 : 같은

android:debuggable="true" 

는 예를 들어, 내 보인다 -g을 컴파일러 플래그에 추가해야하므로 ndk-build가 자동으로 그렇게합니다.

+0

"엔진 없음"유형의 디버거 엔진을 만들 수 없습니다. –

관련 문제