Chinaunix首页 | 论坛 | 博客
  • 博客访问: 97937
  • 博文数量: 21
  • 博客积分: 451
  • 博客等级: 一等列兵
  • 技术积分: 215
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-03 20:46
个人简介

记录技术旅程

文章分类

全部博文(21)

文章存档

2014年(3)

2011年(18)

我的朋友

分类: C/C++

2011-08-22 11:46:17

1. On the device, launch a new command:
  1. gdbserver :5039 /system/bin/executable
or attach to an existing process:
  1. gdbserver :5039 --attach pid
2. On your workstation, forward port 5039 to the device with adb:
  1. adb forward tcp:5039 tcp:5039
3. Start a latest version of gdb that lives in the "prebuilt" area of the source tree: 
  1. prebuild/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gdb out/target/product/generic/symbols/system/bin/executable
4. If you can't find either special version of gdb, run find prebuilt -name arm-eabi-gdb in your source tree to find and run the latest version.

5. In gdb, Tell gdb where to find the shared libraries that will get loaded:
  1. set solib-absolute-prefix /absolute-source-path/out/target/product/generic/symbols
  2. set solib-search-path /absolute-source-path/out/target/product/generic/symbols/system/lib
6. Connect to the device by issuing the gdb command:
  1. target remote :5039
The :5039 tells gdb to connect to the localhost port 5039, which is bridged to the device by adb.

You may need to inspire gdb to load some symbols by typing:
  1. shared

阅读(1416) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~