如何使用arm-eabi-gdb调试android c/c++程序
答案:1 悬赏:80 手机版
解决时间 2021-03-30 20:45
- 提问者网友:最爱你的唇
- 2021-03-30 02:08
如何使用arm-eabi-gdb调试android c/c++程序
最佳答案
- 五星知识达人网友:鱼忧
- 2021-03-30 02:41
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) {
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) {
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯