c - 使用 Debug模式构建 binutils

标签 c mingw gnu binutils

我正在尝试构建 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/

相关文章:

opencv - 如何在 Windows 上安装 NAWK?

macos - Binutils stat 非法选项 -c

c - 从 unsigned long 中提取 N 到 N+4 的 4 位

命令行应用程序 : How to attach a child process to xcode debugger?

c - GTK+/GCC 启动时崩溃

c++ - 如何在不使用 ide 的情况下为 MinGW 安装 allegro 5?

c - 如何在 Windows 上调试 C 程序?

c - C 编程中的跳转/分支表

c - 使用 write() 在 C 中写入文本

linux - 在 GNU/Linux 中,如何将 mingw-w64 与 SCons 结合使用来生成 64 位 Windows 可执行文件?