c++ - 关于 GDB 和 CRC 不匹配

标签 c++ gcc gdb

我想使用gdb 调试代码。当我写命令时:

gdb gdns_processor 

它将从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.

我不明白 CRC 不匹配。为什么 gdb 找不到符号?

PS: 我的 gcc 选项设置了 -g 标志。

CPPFLAGS="-D_LIBC_REENTRANT $CPPFLAGS -g"

最佳答案

I don't understand CRC mismatch

要理解该消息,您需要阅读有关 GDB 使用“单独的调试文件”的信息,例如here .

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

很可能您没有告诉我们整个故事。您的构建过程可能会生成 gdns_processor 二进制文件,并为其生成 gdns_processor.debug“单独的调试文件”。

然后您将 gdns_processor 复制到 /usr/local/gdnsceter/bin/,但(显然)忽略了复制 gdns_processor.debug进入 /usr/lib/debug/usr/local/gdnscenter/bin/

关于c++ - 关于 GDB 和 CRC 不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12926839/

相关文章:

c - 如何使用gdb在for循环中指定计数器的特定值?

C++ STL - 为什么将返回迭代器的函数视为 void 函数?

c++ - 如何使用相同的迭代器获取列表的上一个元素?

c++ - 将编译器标志添加到 CMakeLists.txt

linux - gcc:在 32 位平台上编译 64 位二进制文​​件

c - 可预测地对单个函数进行性能分析

c++ - GNU C 和 C++ 链接错误

c - GDB “info frame” 输出的含义?

c++ - 将图像写入目录失败

linux - 2G 是 Linux 上 coredump 文件的限制大小吗?