lxgeek lxgeek - 3 months ago 20
C++ Question

about GDB and CRC mismatch

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"

Answer

I don't understand CRC mismatch

To understand the message, you need to read about GDBs use of "separate debug files", e.g. here.

my Gcc options have set -g. CPPFLAGS="-D_LIBC_REENTRANT $CPPFLAGS -g"

It is likely you are not telling us the whole story. Your build procedure probably produces the gdns_processor binary, and the gdns_processor.debug "separate debug file" for it.

You then copy the gdns_processor to /usr/local/gdnsceter/bin/, but (apparently) neglect to copy gdns_processor.debug into /usr/lib/debug/usr/local/gdnscenter/bin/.