【发布时间】:2014-08-12 13:45:58
【问题描述】:
我有一个奇怪的问题。当我调试我的代码时,我无法查看其中一个共享库中任何函数的源代码。当我在函数上设置断点时,我遇到了断点,但得到以下输出
Breakpoint 1, omx_isend (ep=0xd10120, buffer=0x7fffffffd1d0,
length=70, dest_endpoint=..., match_info=1311768467139281697,
context=0x0, requestp=0x7fffffffd160)
at <command-line>:1027
1027 <command-line>: No such file or directory
如果我在 gdb 中运行 bt,我会看到以下内容
omx_isend (ep=0xd10120, buffer=0x7fffffffd1d0, length=70, dest_endpoint=..., match_info=1311768467139281697, context=0x0,
requestp=0x7fffffffd160) at <command-line>:1027
我不明白为什么它显示<command-line> 而不是源文件名。
共享库使用-g 构建,并包含调试符号。
【问题讨论】:
-
看起来目标文件是通过在标准输入上将源代码通过管道传输到 GCC 构建的,因此它不知道文件名。
-
有没有办法告诉 gdb 在哪里可以找到哪个函数?