移动设备中导入gdb调试工具

(1)概述

ADB调试桥安装(方式一),ADB调试桥安装好了后一般的移动设备内都不含有gdb工具,

要想使用gdb工具可以借助adb的push参数进行上传。

gdb分为gdb客户端和服务端,文件可以从点击android-gdb-6.8下载。

下载后为文件夹android-gdb-6.8,包含文件gdb和gdbserver。

(2)使用

  • 借助刷机精灵的工具-> Adb命令行进入

移动设备中导入gdb调试工具

  • 点击Adb命令行进入如下页面

移动设备中导入gdb调试工具

  • 将保存在D盘根目录下的adb和adbserver上传到设备的/system/bin目录下
C:\Program Files (x86)\Shuame\4.0.7.207>adb push D:\gdb /system/bin
KB/s ( bytes in .451s) C:\Program Files (x86)\Shuame\4.0.7.207>adb push D:\gdbserver /system/bin
KB/s ( bytes in .092s)
  • 查看文件是否已上传到指定目录
C:\Program Files (x86)\Shuame\4.0.7.207>adb shell
shell@G808_3G:/ $ su
su
root@G808_3G:/ # cd /system/bin
cd /system/bin
root@G808_3G:/system/bin # ll gdb*
ll gdb*
-rw-rw-rw- shell shell -- : gdb
-rw-rw-rw- shell shell -- : gdbserver
  • 确认gdb命令是否可用,提示权限拒绝...
root@G808_3G:/system/bin # ./gdb
./gdb
k_shell/:: ./gdb: can't execute: Permission denied
  • 添加可执行权限
root@G808_3G:/system/bin # chmod  gdb
chmod gdb
root@G808_3G:/system/bin # chmod gdbserver
chmod gdbserver
root@G808_3G:/system/bin # ll gdb*
ll gdb*
-rwxrwxrwx shell shell -- : gdb
-rwxrwxrwx shell shell -- : gdbserver
  • 添加了执行权限后,gdb已可用
root@G808_3G:/system/bin # ./gdb
./gdb dlopen failed on 'libthread_db.so.1' - libthread_db.so.: cannot open shared object file: No such file or directory
GDB will not be able to debug pthreads. GNU gdb 6.8
Copyright (C) Free Software Foundation, Inc.
License GPLv3+: GNU GPL version or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-none-linux-gnueabi".
(gdb)
上一篇:GPS部标监控平台的功能设计(一)-功能列表


下一篇:Faster rcnn代码理解(2)