gdb搜索源目录 [英] gdb searching for source directories
问题描述
如何在unix中提及gdb,如何递归地搜索单个目录中的源文件
,例如
,如果一个模块中有一些不同的块。
a是b,c,d的父目录,其中b,c,d是子目录。
和源文件分布在b,c,b中。
我只需要提到gdb,所有源文件都位于(父目录)中。
,gdb将用作参考,并在调试程序时递归搜索源文件。
how do i mention to gdb in unix to search for source files inside a single directory recursively for example if there are some different buiding blocks in one module. a is parent directory for b, c, d where b,c,d are child directories. and source files are distributed in b,c,b. i just have to mention to gdb that all the source files are located in a(parent directory). which gdb will use as a reference and search for source files recursively while debugging a program.
推荐答案
或者你可以执行这样的操作,调试程序 prog
与目录中的源代码 srcdir
:
Or you can do something like this, for debugging program prog
with source in directory srcdir
:
gdb `find srcdir -type d -printf '-d %p '` prog
我认为这是对您的问题的更直接的回答。如果您的可执行文件不包含编译目录和/或您没有版本6.6+的gdb,也很有用。
I think it's a more direct answer to your question. Also useful if your executable doesn't contain the compilation directories and/or you don't have version 6.6+ of gdb.
这篇关于gdb搜索源目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!