gpt4 book ai didi

c - 使用 Debug模式构建 binutils

转载 作者:行者123 更新时间:2023-11-30 18:05:22 27 4
gpt4 key购买 nike

我正在尝试构建 binutils 2.21 源代码并启用调试。我的主要目标是实际调试 objdump。但为了构建它,我想我必须构建整个包。

不幸的是,配置文件上没有调试选项。在配置 CFLAGS 之前,我尝试将 -g 和 -ggdb 添加到它。然而错误是:

Configuring in ./intl
configure: loading cache ./config.cache
configure: error: `CFLAGS' has changed since the previous run:
configure: former value: `-g -O2 -D__USE_MINGW_ACCESS'
configure: current value: `-g -D__USE_MINGW_ACCESS'
configure: error: in `/c/binutils-2.21/intl':
configure: error: changes in the environment can compromise the build
configure: error: run `make distclean' and/or `rm ./config.cache' and start over

make[1]: *** [configure-intl] Error 1
make[1]: Leaving directory `/c/binutils-2.21'
make: *** [all] Error 2

我尝试了“make clean”和“make distclean”,但收到了相同的错误。实际上,根据以前的 CFLAGS,它之前有 -g 选项,但是当我尝试在 gdb 中打开 objdump.exe 时,它​​说

    Reading symbols from c:\binutils-2.21\binutils/objdump.exe...
(no debugging symbols found)...done.

提前谢谢您。

最佳答案

是的,我已经尝试了很多。正如我所说,-g 标签位于 gcc 上。但是 makefile 将所有启用调试的二进制文件保存到 binutils.libs\目录中。因此,当我在 gdb 下运行 binutils.libs\objdump.exe 时,一切都很好。不过还是谢谢你的回答。

关于c - 使用 Debug模式构建 binutils,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6507000/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com