gpt4 book ai didi

android - 如何在不发疯的情况下使用 ARM DS-5 在 eclipse 中调试 Android native 库?

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:45:46 30 4
gpt4 key购买 nike

我在这里召唤 Android NDK 调试忍者!

我已经尝试了很多关于调试 Android 原生代码的教程,所以我无法全部记住它们。现在我正在尝试让 ARM DS-5 工作。我已经让它与 Android NDK 示例一起使用,其中主要 Activity 加载库。滞后,但有效。

但是我的项目有点复杂。我的 Main Activity 有一个按钮,当我点击它时,SubActivity 会启动,并加载 native 库。当我只是尝试使用 DS-5 调试器时,当加载主 Activity 时,我想调试器会尝试连接到 lib,但失败了,说:

Execution stopped at: 0xAFD0C52C
Connected to unknown platform
0xAFD0C52C POP {r4,r7}
file "D:\workspace\Project\bin\app_process"
WARNING(IMG53): app_process has no line debug information
add-symbol-file "D:\workspace\Project\bin\libc.so"
Loading library symbols: libc.so
WARNING(IMG53): libc.so has no line debug information
Execution stopped at: 0xAFD0C748
In thread 2 (OS thread id 7606)
In __futex_syscall3 (no debug info)
add-symbol-file "D:\workspace\Project\obj\local\armeabi\libName.so"
Execution stopped at: 0xAFD0C748
In thread 3 (OS thread id 7607)
Execution stopped at: 0xAFD0BFFC
In thread 4 (OS thread id 7608)
In __rt_sigtimedwait (no debug info)
Execution stopped at: 0xAFD0B854
In thread 5 (OS thread id 7609)
In select (no debug info)
Execution stopped at: 0xAFD0C748
In thread 6 (OS thread id 7610)
In __futex_syscall3 (no debug info)
Execution stopped at: 0xAFD0B70C
In thread 7 (OS thread id 7611)
In __ioctl (no debug info)
Execution stopped at: 0xAFD0B70C
In thread 8 (OS thread id 7612)
Execution stopped at: 0xAFD0C52C
In thread 1 (OS thread id 7605)
In epoll_wait (no debug info)
0xAFD0C52C POP {r4,r7}
WARNING(CMD454): The shared library D:\workspace\Project\obj\local\armeabi\libName.so is currently not loaded by the application so the request has been pended
cd "D:\workspace"
Working directory "D:\workspace"
directory "D:\workspace\Project"
Source directories searched: D:\workspace\Project;$cdir;$cwd;$idir
break -d -p "D:\workspace\Project\jni\Name.cpp":525
WARNING(CMD452-COR167):
! Breakpoint 1 has been pended
! No compilation unit matching "D:/workspace/Project/jni/Name.cpp" was found
condition 1
break-script 1 ""
ignore 1 0
break-stop-on-threads 1
unsilence 1
Breakpoint 1 unsilenced

我认为它会在 Main Activity 启动时尝试连接到 native 库。但是库是稍后加载的!

我尝试了什么:

  • 在加载 native 库后,在 SubActivity 中设置 Java 断点,然后附加 DS-5 调试器。但是我从 Eclipse 中得到了各种错误说到超时,随便什么。
  • 在调试配置设置中我不能选择应触发 native 代码调试的 Activity ,有组合框,但已禁用:

问题本身:如果我的 lib 没有被主 Activity 加载,我如何让 DS-5 等待 lib 加载?

enter image description here

最佳答案

你真的需要在调试版本和发布版本之间有准确的行为吗?如果没有,在调试版本中也将库加载到主 Activity 中。

关于android - 如何在不发疯的情况下使用 ARM DS-5 在 eclipse 中调试 Android native 库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8865685/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com