LLDB在Android上使用LLDB-Server进行调试?

发布于 2025-02-05 19:18:05 字数 1113 浏览 2 评论 0原文

我目前没有PC。我有两个扎根设备ARM64带有debian rootfs的主机设备和要调试的设备,其中包含lldb-server二进制armv7。我正在尝试使用LLDB远程调试我的Android设备。我从àndroidndk24中取出lldb-server二进制文件,然后将其放入/data/local/tmp中。安装debian SID on 另一个术语apt安装lldb

然后,我使用带有Linux rootfs的主机对客户端设备(带有lldb-server)进行了热点。

我在服务器设备上运行的命令

./data/local/tmp/lldb-server platform --listen "*:2000"  --server

使用NetStat检查,LLDB-Server已绑定到

主机上的所有地址(0.0.0.0.0.0.0.0.0.2000)(客户端LLDB < /code>)Debian Sid终端I RAN中的设备:

apt install lldb
lldb
platform select remote-android
platform connect connect://192.168.201.132:2000

然后我得到错误失败连接端口

但是,使用gdbgdbserver一切正常。我尝试在Debian Buster上安装lldb,但结果相同,甚至运行了lldb-server bones上的二进制文件(设备带有debian sid),但结果相同。现在我被困在这里。我该如何解决?

帮助您将不胜感激。谢谢。

I currently dont have a pc. I have two rooted devices Arm64 host device with Debian rootfs and the device to be debugged which contains the lldb-server binary armv7. I am trying to remote debug my android device using lldb. I pulled the lldb-server binary from àndroid ndk24 and put it in /data/local/tmp. Installed Debian Sid on Another term and apt installed lldb.

I then wifi hotspoted the client device(one with lldb-server) using the host with the linux rootfs.

The commands i ran on server device

./data/local/tmp/lldb-server platform --listen "*:2000"  --server

Checked using netstat and the lldb-server had bound to all addresses(0.0.0.0:2000)

On host(client lldb) device in debian sid terminal i ran:

apt install lldb
lldb
platform select remote-android
platform connect connect://192.168.201.132:2000

Then i get error failed connect port.

However, using Gdb and gdbserver everything worked perfectly. I have tried installing lldb on debian buster but same result and even ran the lldb-server binary on the host(device with debian sid) but same result. Right now im stuck here. How do I solve this?

Help will be greatly appreciated. Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风苍溪 2025-02-12 19:18:05

我不知道为什么,但是lldb-server平台命令被打破(在我的情况下为MABE),应该使用lldb-server gdbserver这样:

on lldb--- Server GDBSERVER命令,该存根不允许其他IP的连接,除了它绑定的一个,因此这样做:

iptables -I INPUT -t nat -p tcp -d 192.168.43.1 --dport 2000 -j SNAT --to-source 192.168.43.1:50000
./data/local/tmp/lldb-server g 192.168.43.1:2000

ON lldb客户端

gdb-remote 192.168.43.1:2000

确实进行正常的远程调试。

编辑:

使用LLDB平台命令连接到Android设备时,使用LLDB客户端的机器应安装ADB。 ADB服务器应在端口5037上运行,并连接一个客户端。如果您有ADB,则可以使用

platform select remote-android

其他使用gdb-remote命令。

I dont know why, but lldb-server platform command is broken(mabe in my case) and should have used lldb-server gdbserver like this:

On lldb-server gdbserver command, the stub doesnt allow connections from other ips except the one it is bound to so do this:

iptables -I INPUT -t nat -p tcp -d 192.168.43.1 --dport 2000 -j SNAT --to-source 192.168.43.1:50000
./data/local/tmp/lldb-server g 192.168.43.1:2000

On lldb client do

gdb-remote 192.168.43.1:2000

Then do normal remote debugging.

EDIT:

When using the lldb platform command to connect to an android device, the machine with the lldb client should have adb installed. The adb server should be running on port 5037 and have one client connected. If you have adb then you can use

platform select remote-android

else use gdb-remote command.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文