[英]How to debug crashed android native library?
我正在為本機庫(C ++)運行junit測試,本機庫進程崩潰,logcat顯示:
I/ActivityManager( 161): Force stopping package xxxxx uid=10043
I/ActivityManager( 161): Start proc xxxxx for added application xxxx: pid=1656 uid=10043 gids={1015}
I/TestRunner( 1656): started: testAddressBook(xxxxx.AddressBookTest)
F//system/bin/app_process( 1656): stack corruption detected: aborted
I/ActivityManager( 161): Process xxxxx (pid 1656) has died.
其中xxxxx是進程名稱。
我嘗試遵循http://source.android.com/porting/debugging_native.html上的說明,但該說明令人困惑:
如果崩潰,請使用aproto連接並在設備上運行logcat
什么是prototo? 我找不到 也沒有“堆棧”工具。
任何建議表示贊賞!
-亨利
F//system/bin/app_process( 1656): stack corruption detected: aborted
聽起來您正在浪費本地變量。 這是一種非常流行的方法:
char localVar[16];
sprintf(localVar, "And this is why sprintf is the devil");
這並不是您所要的,但我希望它能有所幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.