GDB(在Android上)使用'where'解决当前位置时出现问题

时间:2011-08-31 20:36:19

标签: android gdb android-ndk

尝试使用gdb确定最后一行执行位置正在变成一场真正的噩梦。我使用的是where命令,我只能在堆栈跟踪中的第二个最后一次调用之前起作用,而不是实际的行。

我不知道为什么,但堆栈跟踪中的最后一次调用显示为??。

任何和所有帮助都会非常感谢让gdb实际输出它的位置!

(gdb) where
#0  0xafd0c7b8 in __futex_syscall3 () from /root/xxx/yyy/zzz/android/SviCore/obj/local/armeabi/libc.so
#1  0xafd1138c in pthread_mutex_lock () from /root/xxx/yyy/zzz/android/SviCore/obj/local/armeabi/libc.so
warning: (Internal error: pc 0x81892c3b in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x81892c3b in read in psymtab, but not in symtab.)

#2  0x81892c3c in boost::mutex::lock (this=0xfffffe00) at external/boost/include/boost/thread/pthread/mutex.hpp:52
warning: (Internal error: pc 0x81892d01 in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x81892d01 in read in psymtab, but not in symtab.)

#3  0x81892d02 in boost::unique_lock<boost::mutex>::lock (this=0xbec9032c) at external/boost/include/boost/thread/locks.hpp:412
warning: (Internal error: pc 0x81893279 in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x81893279 in read in psymtab, but not in symtab.)

#4  0x8189327a in ReadLock1 (this=<value optimized out>, mutex=@0x162acc) at external/boost/include/boost/thread/locks.hpp:290
#5  0x8188e0ec in SVI::DownloadManager::resumeAll (this=0x12fc00) at src/cm/DownloadManager.cpp:285
#6  0x81884e00 in Java_com_svi_core_DownloadManager_resumeAll (env=0xae28, obj=0x405181d8) at /root/xxx/yyy/zzz/android/SviCore/jni/DownloadManager.cpp:265
#7  0x80217ef8 in ?? ()

1 个答案:

答案 0 :(得分:2)

this=<value optimized out>

看起来您正在使用已启用的优化进行构建。禁用它们(gcc的-O0选项)你应该得到更好的调用堆栈。

同时将gdb升级到更新版本以消除这些警告warning: (Internal error: pc 0x81892c3b in read in psymtab, but not in symtab.)