gdb error in re-settings breakpoint (cannot access memory)

别说谁变了你拦得住时间么 提交于 2019-12-10 17:08:29

问题


I am trying to get gdb to set a breakpoint in pcbsd10 (freebsd10).

I have compiled my code with debug symbols, and here is the output from 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
...

And my code continues to run without stopping at the breakpoint.

What is going on here? How can I get more insight into why gdb is failing?


回答1:


You are possibly looking at this GDB bug.

Although it looks like GDB 7.7 should already have a fix, you may want to try 7.7.1.

Alternatively, build your binary as a non-PIE binary (remove -fPIE from the Makefile).



来源:https://stackoverflow.com/questions/23553527/gdb-error-in-re-settings-breakpoint-cannot-access-memory

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!