"在logcat中不完全回溯" [英] incomplete backtrace in logcat

查看:170
本文介绍了"在logcat中不完全回溯"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Andr​​oid应用程序崩溃(或击中断言),我从来没有回溯的超过四行。搜索类似的问题,我只发现这何处提到的一个或两个地方和股市的反应是:确保它的调试版本和你可能已经堆腐败。我已经看到了发生在许多地方准确的前瞻性框架和没有腐败的证据许多崩溃。

When my Android app crashes (or hits an assert), I never get more than four lines of backtrace. Searching for similar problems, I've only found one or two places where this is mentioned and the stock responses are: "make sure it's a debug build" and "you probably have stack corruption". I have seen many crashes occur in many places with accurate-looking frames and no evidence of corruption.

下面是按照调试版本断言失败从'亚行logcat采取了典型的摘录:

Here's a typical excerpt taken from `adb logcat' following an assert failure in a debug build:

I/DEBUG   (  187):     d28 3f824fc6ced25306  d29 3fabdfebb8fe14dc
I/DEBUG   (  187):     d30 fff0000000000000  d31 fffffffeffffffd2
I/DEBUG   (  187):     scr 88000010
I/DEBUG   (  187): 
I/DEBUG   (  187): backtrace:
I/DEBUG   (  187):     #00  pc 00018516  /system/lib/libc.so
I/DEBUG   (  187):     #01  pc 0000dc44  /system/lib/libc.so (abort+4)
I/DEBUG   (  187):     #02  pc 0000168d  /system/lib/liblog.so (__android_log_assert+88)
I/DEBUG   (  187):     #03  pc 00170bcc  /data/data/com.jsam.crag/lib/libmain.so (sim::TouchObserverController::HandleEvent(SDL_Event const&)+340)
I/DEBUG   (  187): 
I/DEBUG   (  187): stack:
I/DEBUG   (  187):          6f4be770  6f4be76c  [stack:17025]
I/DEBUG   (  187):          6f4be774  00000000  
I/DEBUG   (  187):          6f4be778  00000000  

如你所见,大部分可用回溯的是连我自己code。我在一个开发人员版本的HTC One发展与出的现成的操作系统,使用NDK的发布8e和建设对Android的10,虽然Android的-15是没有什么不同。我使用的工具链V4.7中,gnustl_static STL和我的C ++的标志是:

As you can see, most of the available backtrace isn't even in my own code. I'm developing on a developer edition HTC One with out-of-box OS, using release 8e of the NDK and building against android-10, although android-15 is no different. I'm using toolchain v4.7, the gnustl_static STL and my C++ flags are:

-std=c++11 -g -pthread -DPROFILE -D__STRICT_ANSI__ -DdSINGLE -Wall -Wextra -Wfatal-errors -fno-rtti -fno-exceptions

我将如何去获得更长的(preferably完成)回溯?

How would I go about getting longer (preferably complete) backtraces?

推荐答案

答案似乎是升级至Android 4.3。我的手机今天收到的更新(定制版HTC推出了以开发者版本的设备),并转储到系统日志中回溯现在露出了完整的堆栈。然而,正如@ user1034749建议,让用GDB交手是有许多额外的好处一个很好的选择。

The answer appears to be to upgrade to Android 4.3. My phone received an update today (the custom HTC version rolled out to developer edition devices) and the backtraces dumped to the system log now reveal a full stack. However, as @user1034749 suggests, getting to grips with GDB is a good alternative with many additional benefits.

这篇关于"在logcat中不完全回溯"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆