gpt4 book ai didi

GDB tracing: Target returns error code '01' after continue command(GDB跟踪:TARGET在CONTINUE命令后返回错误代码‘01’)

转载 作者:bug小助手 更新时间:2023-10-25 19:13:55 39 4
gpt4 key购买 nike



I am trying to obtain GDB traces as described in this other question.
For completeness, on one terminal I am running:

我正在尝试获取这个问题中描述的GDB跟踪。为了完整起见,我在一个终端上运行:


$ gdbserver :1234 ./a.out 
Process ./a.out created; pid = 13610
Listening on port 1234

And on another one (client):

在另一台(客户端)上:


$ gdb ./a.out
...
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04.1) 9.2
Reading symbols from ./a.out...
(gdb) target remote :1234
Remote debugging using :1234
Reading /lib64/ld-linux-x86-64.so.2 from remote target...
warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.
Reading /lib64/ld-linux-x86-64.so.2 from remote target...
Reading symbols from target:/lib64/ld-linux-x86-64.so.2...
Reading symbols from /usr/lib/debug/.build-id/45/87364908de169dec62ffa538170118c1c3a078.debug...
0x00007ffff7fd0100 in _start () from target:/lib64/ld-linux-x86-64.so.2
(gdb) trace 3
Tracepoint 1 at 0x555555555157: file ../test/main.cpp, line 3.
(gdb) b 9
Breakpoint 2 at 0x55555555519a: file ../test/main.cpp, line 9.
(gdb) actions 1
Enter actions for tracepoint 1, one per line.
End with a line saying just "end".
>collect $regs,$args
>end
(gdb) tstart
(gdb) c

And here is where it differs from the other question, I get the error when I want to continue to the breakpoint at 9:

这里是它与其他问题的不同之处,当我想继续到9点的断点时,我得到了错误:


Continuing.
Reading /lib/x86_64-linux-gnu/libc.so.6 from remote target...
Target returns error code '01'.

I tried the whole experiment without the tracepoint, and the continue command works correctly.

我在没有跟踪点的情况下尝试了整个实验,并且Continue命令工作正常。


Of course I tried googling the error code 01, but seems pretty generic so I could not draw any conclusions. Any idea what could be going wrong?

当然,我尝试在谷歌上搜索错误代码01,但似乎很常见,所以我无法得出任何结论。你知道可能出了什么问题吗?


更多回答
优秀答案推荐

It appears to be a known issue, apparently tracepoints have been broken since binutils 2.33 and a patch was added to fix them in 2.41.

这似乎是一个已知的问题,显然,自从binutils 2.33以来,跟踪点已经被破坏,并在2.41中添加了一个补丁来修复它们。


Your GDB/binutils version must be some inbetween. Here are the two commits:

您的gdb/binutils版本必须介于两者之间。以下是两项承诺:



Try again with version 2.41 or later.

请使用版本2.41或更高版本重试。


更多回答

This is the answer, I had to build the latest GDB myself, the one that came with the system was: GNU gdb (Ubuntu 9.2-0ubuntu1~20.04.1) 9.2 The one I built: GNU gdb (GDB) 14.0.50.20230730-git Now it works. thanks!

这就是答案,我必须自己构建最新的GDB,系统附带的是:GNU gdb(Ubuntu 9.2-0ubuntu1~20.04.1)9.2我构建的那个:GNU gdb(Gdb)14.0.50.20230730-git现在可以工作了。谢谢!

Just beware of the comment in the issue description: > "Things remain quite broken in that area though." Meaning tracepoints support in GDB seems to be unmaintained and probably not fully functional.

只需注意问题描述中的评论:>“尽管如此,该领域的情况仍然相当糟糕。”这意味着GDB中的跟踪点支持似乎没有得到维护,而且可能功能不全。

39 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com