如何让gdb使用不同的目录来查找源文件。
例如,我在编译期间的源文件位于目录中:
/home/foo/bar.c
接下来,我将其移动到目录中:
/tmp/debug/home/foo/bar.c
如何强制gdb在该目录中搜索?
根据这个网站 https://sourceware.org/gdb/onlinedocs/gdb/Source-Path.html我应该只使用命令:
dir /tmp/debug/
但它不起作用。我收到一条消息foo.c: "No such file or directory"
来自 gdb。
set substitute-path /home/foo /tmp/debug/home/foo
http://sourceware.org/gdb/current/onlinedocs/gdb/Source-Path.html#index-set-substitute_002dpath http://sourceware.org/gdb/current/onlinedocs/gdb/Source-Path.html#index-set-substitute_002dpath
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)