【发布时间】:2021-03-12 21:49:04
【问题描述】:
我正在尝试远程调试我的 aarch64 硬件上的进程。为什么三元组以 x86_64 开头?我希望aarch64
(lldb) platform select remote-android
Platform: remote-android
Connected: no
(lldb) platform connect connect://localhost:5039
Platform: remote-android
Triple: x86_64-unknown-linux-android
OS Version: 30 (5.4.47-07670-gd50c0c10c465)
Hostname: localhost
Connected: yes
WorkingDir: /
Kernel: #136 SMP PREEMPT Thu Nov 26 11:09:46 EST 2020
我的 Android 硬件是 aarch64。我将 lldb-server 推送到目标
adb push prebuilts/clang/host/linux-x86/clang-r383902b/runtimes_ndk_cxx/aarch64/lldb-server /data/local/tmp/lldb-server
运行它:
adb shell /data/local/tmp/lldb-server platform --listen "*:5039" --server
并与 lldb 连接(来自prebuilts/clang/host/linux-x86/clang-r383902b/bin/lldb)
我能够附加到目标上的进程,甚至列出进程(再次显示 x86_64 三元组让我感到困惑),但我无法添加任何符号文件或target create。这些命令会产生拱形错误,这就是导致我回到平台命令中的三元组的原因。 (旁注,我确实使用-Wl,--build-id=sha1 -g -glldb 构建)
当我在网上看到教程时,它们是三胞胎报告臂。
注意事项:
- 一切都在 shell 中完成(无 IDE),
- 未在 Docker 中运行,
- 我的硬件现在已经植根,甚至处于许可模式
- 这里的一切都基于 AOSP 11
- clang 标签:
clang-r383902b
【问题讨论】:
-
这似乎是由于 clang 的版本 :( 我也看到几年前也发生过类似的事情 (see here)。当我直接从 master 那里拉出来并得到 clang 标签
clang-r399163b时,我的问题就消失了
标签: android-source remote-debugging lldb