linux-GDB远程调试:无法停止线程

我在目标上有一个gdbserver,就像gdbserver:2345 / bin / ls一样启动.接下来,我要从主机连接gdb,并尝试发出下一个命令:

(gdb) target remote 192.168.1.2:2345
Remote debugging using 192.168.1.2:2345
warning: Architecture rejected target-supplied description
[New Thread 686]
(gdb) Remote 'g' packet reply is too long: 00000000c10ed6be0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d00dd6be0000000030fe0d40100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
(gdb) i thr
  Id   Target Id         Frame 
* 1    Thread 686        (running)
(gdb) interrupt
(gdb) interrupt 1
(gdb) interrupt 2
(gdb) i thr
  Id   Target Id         Frame 
* 1    Thread 686        (running)
(gdb) bt
Target is executing.
(gdb) c
Continuing.
Cannot execute this command while the selected thread is running.

我认为这可能是gdb损坏的原因,这是奇怪的消息,尝试发送给Google.发现两个假设. Here’s a man 假定gdb(尽管目标上运行IMDB的IMHO应该发送抽象的与拱无关的命令)需要设置要调试的体系结构.但这不起作用:

(gdb) set architecture armv7-a
Undefined item: "armv7-a".
(gdb) set architecture armv7
Undefined item: "armv7".
(gdb) set architecture armv5te
Undefined item: "armv5te".

我没有找到可以列出支持的体系结构的任何命令. second assumption是gdbserver本身需要配置神话选项–with-expat.但是…配置:警告:无法识别的选项:–with-expat

我没有其他想法了.因此,有人知道吗:如何在目标上中断线程?(顺便说一句,可以将断点设置得很好,但这一点都没有帮助,因为似乎gdb躺在正在运行的线程上.运行中,被调试的ls立即消失了.)

解决方法:

虽然可以构建“ multiarch” gdb,但默认的Ubuntu GDB(称为gdb)被构建为支持单一架构-主机PC.尽管它确实连接到任何gdbserver,但是您不能使用它调试其他CPU.

您需要可以调试目标(ARM)并与目标上使用的ABI兼容的gdb.

您应该使用您的工具链就可以做到这一点,但是如果没有,从源代码构建起来就不难了.简要说明请参见sourceware.org/gdb/wiki/BuildingCrossGDBandGDBserver.

上一篇:HAProxy 算法


下一篇:Android:Eclipse MAT似乎没有显示我所有应用程序的对象