Android gdb调试

Android gdb调试

前置条件:

1.Linux环境,比如Ubutun

2.python工具:建议2,7, 安装命令 sudo apt-get install libpython2.7

3.Android完整codebase

4.开发板

操作步骤:

adb root

adb remount

adb shell

#4027为进程id

gdbserver :5050 --attach 4027 or gdbserver64 :5050 --attach 4027

另外开一个窗口

adb forward tcp:5050 tcp:5050

source build/envsetup.sh

lunch xxx

gdbclient.py --port 5050 -p 4027

设置监控的二进制文件

file /xxx/out/target/product/xx/symbols/system/bin/mediaserver

Set sysroot路径

set sysroot /xx/out/target/product/xx/symbols/

设置Android源码目录

set dir /xx/

设置gdb带符号表的so路径

set solib-absolute-prefix /xx/out/target/product/xx/symbols/

设置断点

break frameworks/av/xx.cpp:37

相关推荐
圆号本昊10 分钟前
Flutter Android Live2D 2026 实战:模型加载 + 集成渲染 + 显示全流程 + 10 个核心坑( OpenGL )
android·flutter·live2d
冬奇Lab1 小时前
ANR实战分析:一次audioserver死锁引发的系统级故障排查
android·性能优化·debug
冬奇Lab1 小时前
Android车机卡顿案例剖析:从Binder耗尽到单例缺失的深度排查
android·性能优化·debug
ZHANG13HAO2 小时前
调用脚本实现 App 自动升级(无需无感、允许进程中断)
android
圆号本昊3 小时前
【2025最新】Flutter 加载显示 Live2D 角色,实战与踩坑全链路分享
android·flutter
小曹要微笑3 小时前
MySQL的TRIM函数
android·数据库·mysql
mrsyf4 小时前
Android Studio Otter 2(2025.2.2版本)安装和Gradle配置
android·ide·android studio
DB虚空行者5 小时前
MySQL恢复之Binlog格式详解
android·数据库·mysql
liang_jy6 小时前
Android 事件分发机制(一)—— 全流程源码解析
android·面试·源码