GDB 跟踪:继续命令后目标返回错误代码“01”

问题描述 投票:0回答:1

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

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

另一位(客户):

$ 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

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

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

我尝试了整个实验没有跟踪点,并且继续命令工作正常。

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

gdb trace gdbserver
1个回答
0
投票

这似乎是一个“已知问题”,显然自 binutils 2.33 以来跟踪点已被破坏,并且在 2.41 中添加了补丁来修复它们。 您的 GDB/binutils 版本必须介于两者之间。这是两个提交:

自 binutils-2_33 (07/2019) 起已损坏:
    cb1e4e32c2d9588e1d77ea49bafb5dcdc1cff764
  • 从 binutils-2_41 (03/2023) 修复:
  • 0b63c811efc38f50b72422ed6a9db1de053e8736
  • 使用 2.41 或更高版本重试。

© www.soinside.com 2019 - 2024. All rights reserved.