【问题标题】:lldb reports my remote aarch64 paltform as x86_64 (AOSP)lldb 将我的远程 aarch64 平台报告为 x86_64 (AOSP)
【发布时间】: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


【解决方案1】:

原因是我使用的 clang 版本,clang-r383902b。将我的本地清单设置为从 master 提取并使用 clang-r399163b 一切正常。

具体来说:

  1. 扩展本地清单中的 clang prebuid 项目

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <remote name="aosp" fetch="https://android.googlesource.com/" review="https://android-review.googlesource.com/" />
  <extend-project path="prebuilts/clang/host/linux-x86" name="platform/prebuilts/clang/host/linux-x86" groups="trusty" revision="refs/heads/master" clone-depth="1" remote="aosp" />
</manifest>
  1. 同步repo sync -d prebuilts/clang/host/linux-x86
  2. 重新推送CLANG_TAG=clang-r399163b adb push prebuilts/clang/host/linux-x86/${CLANG_TAG}/runtimes_ndk_cxx/aarch64/lldb-server /data/local/tmp/lldb-server(或任何最新标签)
  3. 重新运行 lldb-server

我尝试将最新的lldb-server 与现有的lldb 一起使用,它仍然有效。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-08-26
    • 2017-01-10
    • 1970-01-01
    • 1970-01-01
    • 2013-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多