Hello,

2017-05-29 13:02 GMT+02:00 Lu Wang <wanglus...@hotmail.com>:
> I have set some breakpoints. If I recompile the code for debugging.
> Then I execute the program using the command
> run and the breakpoints disappear. This ought to work, but doesn't
> restore my breakpoints.
>
> the output is
>
> `/home/tw/Documents/test1/xxx' has changed; re-reading symbols.
> Error in re-setting breakpoint 1: Cannot access memory at address
> 0x5555555546f0
> Starting program: /home/tw/Documents/test1/xxx
> [Switching to thread 1 (process 11336)](running)
> [Inferior 1 (process 11336) exited normally]

Not sure if I understand correctly, but break points work for me...

/tmp/hello-2.10$ gdb hello
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 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-linux-gnu".
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 hello...done.
(gdb) b main
Breakpoint 1 at 0x15f0: file src/hello.c, line 41.
(gdb) run
Starting program: /tmp/hello-2.10/hello

Breakpoint 1, main (argc=1, argv=0x7fffffffe0a8) at src/hello.c:41
41      {
(gdb)


However, what do you mean with you recompile the code for debugging?
Can you show a reproducible testcase?

Regards


-- 
 Héctor Orón  -.. . -... .. .- -.   -.. . ...- . .-.. --- .--. . .-.

Reply via email to