GDB源路径 [英] GDB source path

查看:139
本文介绍了GDB源路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使gdb使用不同的目录来查找源文件.

How to make gdb to use different directory to look for source files.

例如,我在编译过程中的源文件位于目录中:

For example my source file during the compilation was in directory:

/home/foo/bar.c

接下来,我将其移至目录:

Next, I moved it into directory:

/tmp/debug/home/foo/bar.c

如何强制gdb在此目录中搜索? 根据此站点,我应该只使用命令:

How to enforce gdb to search in this directory? According to this site I should just use command:

dir /tmp/debug/

但是它不起作用.我从gdb收到消息foo.c: "No such file or directory".

But it is not working. I get a message foo.c: "No such file or directory" from gdb.

推荐答案

set substitute-path /home/foo /tmp/debug/home/foo

http://sourceware.org/gdb/current/onlinedocs /gdb/Source-Path.html#index-set-substitute_002dpath

这篇关于GDB源路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆