안드로이드 개발 질문/답변
(글 수 45,052)
JNI function을 테스트하기 위해 ndk-gdb를 사용하려고 하는데 에뮬레이터가 아닌 상용단말에서 안되는 경우가 있더군요.
내 경우 HTC Desire에서 동작하지 않았는데요.
이유를 찾아보니 shell 명령중에 run-as가 정상동작하지 않도록 해놓았다네요.
이런 젝일...
갤럭시S도 그렇다는데 되는 디바이스가 있을지 모르겠습니다...
넥서스시리즈는 될까요???
혹시 이글 읽고 다른 디바이스에서 되는 분 있으면 댓글 좀...
원문 출처: http://groups.google.com/group/android-ndk/tree/browse_frm/month/2011-03/1ce4f2052e3378db?rnum=41&_done=%2Fgroup%2Fandroid-ndk%2Fbrowse_frm%2Fmonth%2F2011-03%3F
It's a known Samsung-specific issue: native debugging doesn't work because
they made platform customizations without updating the run-as source
appropriately. The problem is that "run-as" is looking for for
/data/system/packages.list, which doesn't exist on the Samsung builds,
because they use /dbdata instead of /data
<script src="http://samse.tistory.com/plugin/CallBack_bootstrapper?&src=http://s1.daumcdn.net/cfs.tistory/v/0/blog/plugins/CallBack/callback&id=263&callbackId=samsetistorycom2634364&destDocId=callbacknestsamsetistorycom2634364&host=http://samse.tistory.com&float=left&random=580"></script>
내 경우 HTC Desire에서 동작하지 않았는데요.
이유를 찾아보니 shell 명령중에 run-as가 정상동작하지 않도록 해놓았다네요.
이런 젝일...
갤럭시S도 그렇다는데 되는 디바이스가 있을지 모르겠습니다...
넥서스시리즈는 될까요???
혹시 이글 읽고 다른 디바이스에서 되는 분 있으면 댓글 좀...
원문 출처: http://groups.google.com/group/android-ndk/tree/browse_frm/month/2011-03/1ce4f2052e3378db?rnum=41&_done=%2Fgroup%2Fandroid-ndk%2Fbrowse_frm%2Fmonth%2F2011-03%3F
It's a known Samsung-specific issue: native debugging doesn't work because
they made platform customizations without updating the run-as source
appropriately. The problem is that "run-as" is looking for for
/data/system/packages.list, which doesn't exist on the Samsung builds,
because they use /dbdata instead of /data
One solution is to root your system, then create a symlink from
/data/system/ to /dbdata/system/. There is a previous post on the
android-ndk forum about this.
The same issue happens on Galaxy S builds, btw.




디바이스에서는 안될걸요.... 애초에 gdbserver 자체가 루트권한이 없으면 안되는걸로 압니다.
ndk-gdb는 gdbserver랑 통신하는거라고 보시면 됩니다.
에뮬은 될건데요.... 잘 안되는 경우가 있다고 하시니.... 이래저래 디버깅은 힘들군요...
제가 쓰는 방법은 우선 덤프메시지 나올때 이 메시지에서 주소를 찾아서
gdb를 통해서 조회하는 방법을 씁니다.
breakpoint 이런건 그냥 안하구요 로그에 찍습니다. 가장 확실한 디버깅은 로깅하는거죠....