Pio*_*ski 10 debugging gdb path
如何让gdb使用不同的目录来查找源文件.
例如,我在编译期间的源文件位于目录中:
/home/foo/bar.c
Run Code Online (Sandbox Code Playgroud)
接下来,我将其移动到目录中:
/tmp/debug/home/foo/bar.c
Run Code Online (Sandbox Code Playgroud)
如何强制gdb在这个目录中搜索?根据这个网站我应该使用命令:
dir /tmp/debug/
Run Code Online (Sandbox Code Playgroud)
但它没有用.我foo.c: "No such file or directory"从gdb 收到一条消息.
Ser*_*kov 15
set substitute-path /home/foo /tmp/debug/home/foo
Run Code Online (Sandbox Code Playgroud)
http://sourceware.org/gdb/current/onlinedocs/gdb/Source-Path.html#index-set-substitute_002dpath