I want to use gdb to debug the code. When I write the command:
gdb gdns_processor
It will output the warning message from gdb:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/local/gdnscenter/bin/gdns_processor...
warning: the debug information found in "/usr/lib/debug//usr/local/gdnscenter/bin/gdns_processor.debug" does not match "/usr/local/gdnscenter/bin/gdns_processor" (CRC mismatch).
warning: the debug information found in "/usr/lib/debug/usr/local/gdnscenter/bin/gdns_processor.debug" does not match "/usr/local/gdnscenter/bin/gdns_processor" (CRC mismatch).
(no debugging symbols found)...done.
I don’t understand CRC mismatch. Why gdb can’t find symbols?
PS: My gcc options have set -g flag.
CPPFLAGS="-D_LIBC_REENTRANT $CPPFLAGS -g"
To understand the message, you need to read about GDBs use of “separate debug files”, e.g. here.
It is likely you are not telling us the whole story. Your build procedure probably produces the
gdns_processorbinary, and thegdns_processor.debug“separate debug file” for it.You then copy the
gdns_processorto/usr/local/gdnsceter/bin/, but (apparently) neglect to copygdns_processor.debuginto/usr/lib/debug/usr/local/gdnscenter/bin/.