如何使用arm-eabi-gdb调试android c/c++程序

以前尝试过用gdb调试android,但是收获不多,看到高人写的,先收藏着~~~~~~~~~~

 

原文地址:http://blog.csdn.net/sanlinux/archive/2010/07/10/5725557.aspx

 

1.获取gdbserver

prebuilt/android-arm/gdbserver

2.获取arm-eabi-gdb

prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin

3.启动emulator(即qemu虚拟机,调式linux内核时用到)

$adb remount && adb push gdbserver /system/bin

adb shell

#gdbserver 10.0.2.2:1234 /system/bin/ping

 

$telnet localhost 5554

Trying ::1...

telnet: connect to address ::1: Connection refused

Trying 127.0.0.1...

Connected to localhost.

Escape character is '^]'.

Android Console: type 'help' for a list of commands

OK

]

KO: unknown command, try 'help'

**cmd**redir add tcp:1234:1234

OK

exit

Connection closed by foreign host.

$cd out/target/product/generic/symbols/system/bin && arm-eabi-gdb ping

 

(gdb) r

Starting program:  

Don't know how to run.  Try "help target".

(gdb) target remote localhost:1234

Remote debugging using localhost:1234

0xb0000100 in ?? ()

(gdb) l

1779 usage();

1780 if (argc > 5)

1781 usage();

1782 } else {

1783 if (argc > 10)

1784 usage();

1785 options |= F_SOURCEROUTE;

1786 }

1787 }

1788 while (argc > 0) {

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值