GDB远程调试:不能停止线程 [英] GDB remote debug: can't stop the thread

查看:1008
本文介绍了GDB远程调试:不能停止线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a gdbserver on a target, that I launch like gdbserver :2345 /bin/ls. Next I am connect a gdb from a host, and trying issue next commands:

(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。发现两个假设。 这是一个男人,假设 gdb (尽管IMHO目标上运行的应用程序应该发送一个抽象的arch独立命令的gdbserver )需要要调试的架构来设置。但是它不起作用:

I thought that may be the reason of a broken gdb is the weird message, tried to Google. Found two assumptions. Here's a man supposes that the gdb (despite IMHO that on the target is running the gdbserver that should send an abstract arch-independent commands) need the architecture that it is debugs to be set. But it doesn't work:

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

我没有找到可以列出支持的架构的任何命令。 第二个假设 gdbserver 本身需要配置神话选项 - with-expat 。但是... 配置:警告:无法识别的选项:--with-expat

I didn't found any command that could list supported architectures. The second assumption was that the gdbserver itself needs to be configured with a mythological option --with-expat. But... configure: WARNING: unrecognized options: --with-expat

我没有更多的想法。所以,有人知道:如何中断目标线程?(Btw,断点可以设置得很好,但它根本没有帮助,因为看起来gdb正在说一个正在运行的线程,如果线程将正在调试的 ls 刚刚走了。)

I have no more ideas. So, do anybody knows: how to interrupt the thread on the target?(Btw, breakpoints could be set just fine, but it doesn't help at all, because seems that the gdb is lying about a running thread. If the thread would running, the being debugged ls just gone immediately.)

推荐答案

可以构建multiarchgdb,默认的Ubuntu GDB(称为gdb)是为支持单一架构 - 主机PC而构建的。您不能使用它来调试其他CPU,尽管它连接到任何gdbserver。

While it is possible to build "multiarch" gdb, default Ubuntu GDB (called gdb) is built to support single architecture - host PC. You can not debug other CPUs with it, although it does connect to any gdbserver.

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

You need gdb that can debug your target (ARM) and is compatible with ABI used on your target.

你应该使用你的工具链,但是如果没有,那么从源代码构建就不难。有关简要说明,请参阅 sourceware.org/gdb/wiki/BuildingCrossGDBandGDBserver

You should get that with your toolchain, but if not, it's not hard to build from source. See sourceware.org/gdb/wiki/BuildingCrossGDBandGDBserver for brief instructions.

这篇关于GDB远程调试:不能停止线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆