Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

about GDB and CRC mismatch

Tags:

c++

gcc

gdb

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"
like image 607
lxgeek Avatar asked Oct 06 '22 07:10

lxgeek


1 Answers

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/.

like image 192
Employed Russian Avatar answered Oct 10 '22 03:10

Employed Russian