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

相关推荐
冉冉同学3 分钟前
AI Agent 开始操作真实手机:移动端自动化的 3 个新考点
android·ai编程
帅得不敢出门35 分钟前
Android Framework关闭软件低电关机功能测试PMIC低电保护
android
恋猫de小郭1 小时前
Flutter + EmbeddingGemma 2,谷歌发布完全端侧的 AI Edge Foresight
android·前端·flutter
墨天梦2 小时前
B16_Material主题与可访问交互
android·kotlin·交互
弯_弯3 小时前
企业知识库 RAG 落地:从 Demo 到生产,四条工程链路与参数级自查
android·java·javascript
晚风叙码4 小时前
MySQL 表的约束详解:从空属性到外键
android·数据库·mysql·adb
alexhilton14 小时前
模块化Jetpack Compose架构
android·kotlin·android jetpack
厮年断弦17 小时前
AI 辅助开发实录:一周做完一个 Android 本地音乐播放器,这些坑替你踩了
android
hai_android17 小时前
InputStage 责任链核心执行流程
android·android studio·android jetpack
mmsx20 小时前
Android 测绘计算工程化:七四参数、高程拟合与单位系统
android·kotlin