【问题标题】:gdb error in re-settings breakpoint (cannot access memory)重新设置断点中的 gdb 错误(无法访问内存)
【发布时间】:2014-05-08 22:16:59
【问题描述】:

我正在尝试让 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 失败的原因?

【问题讨论】:

标签: c++ c debugging gdb bsd


【解决方案1】:

您可能正在查看此 GDB bug

虽然 GDB 7.7 看起来应该已经有了修复,但您可能想尝试 7.7.1。

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

【讨论】:

  • 我刚刚编译了 7.7.1,但我仍然遇到了同样的问题。你是正确的,删除​​ -fPIE (和 -pie 从链接选项)解决了这个问题。由于 7.7(.1) 没有解决问题,我是否应该考虑提交错误报告?
  • @Derek 是的。如果最新的 GDB 版本仍然存在问题,您绝对应该报告它。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-09-08
  • 2010-10-29
  • 2014-09-22
  • 1970-01-01
  • 2017-11-06
相关资源
最近更新 更多