【发布时间】:2023-03-07 03:09:01
【问题描述】:
我正在尝试使用 gdb 调试 C 程序。我使用的编译标志如下
-fno-strict-aliasing -Wall -DHAVE_CONFIG_H -DNO_OLD_ERF_TYPES -Werror -Wredundant-decls -O2 -DNDEBUG -DBYTESWAP -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -g
我使用的编译器版本是
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-52)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
我调试为
libtool gdb mytool
我设置断点并运行程序。执行不会在断点处停止,我收到以下警告。
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x2aaaaaaab000
[Thread debugging using libthread_db enabled]
【问题讨论】:
-
检查这个问题 - stackoverflow.com/questions/18548139/…。这可能会对您有所帮助。
-
不。我尝试使用静态。没有用:(
-
调试未优化的构建已解决?
-
你确定你的调试符号没有被删除吗?在构建发布代码时很常见。另外,不使用 libtool 可以试试吗?
-
您可能应该探索您想要放置断点的代码。也许您正在为内联的内容或完全删除的内容设置断点。尝试反汇编调用函数并在适当的指令处设置断点。
标签: c++ c debugging compiler-construction gdb