gpt4 book ai didi

c++ - gdb 重新设置断点时出错(无法访问内存)

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:02:33 26 4
gpt4 key购买 nike

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

最佳答案

您可能正在查看此 GDB bug .

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

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

关于c++ - gdb 重新设置断点时出错(无法访问内存),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23553527/

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