gdb错误:在重新设置断点时出错(无法访问内存)

4

我正在尝试让gdb在pcbsd10(freebsd10)中设置断点。

我已经使用调试符号编译了我的代码,以下是来自gdb的输出:

GNU gdb (GDB) 7.7
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-freebsd10.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from tor...done.
(gdb) break config.c:3626
Breakpoint 1 at 0xfde72: file src/or/config.c, line 3626.
(gdb) run
Starting program: /usr/home/jon/swdev/apps/tor/src/or/tor -f /home/jon/torrc
Error in re-setting breakpoint 1: Cannot access memory at address 0xfdb90
Error in re-setting breakpoint 1: Cannot access memory at address 0xfdb90
...

我的代码继续运行而没有停在断点处。

这是怎么回事?我如何更深入地了解gdb为什么失败?


请看这里:https://dev59.com/LkfRa4cB1Zd3GeqP_r6V#912870 - cnicutar
1个回答

3

您可能正在查看这个GDB 错误

虽然看起来GDB 7.7应该已经有一个修复,但您可以尝试使用7.7.1版本。

或者,将您的二进制文件构建为非PIE二进制文件(从Makefile中删除-fPIE)。


我刚刚编译了7.7.1版本,但仍然遇到了相同的问题。您说得对,去掉-fPIE(以及链接选项中的-pie)可以解决这个问题。既然7.7(.1)版本没有解决这个问题,我应该考虑提交一个错误报告吗? - Derek
@Derek 是的。如果最新的GDB版本仍然存在问题,你应该立即报告它。 - Employed Russian

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接