例如一个例子:
#12 0xb5bf6b90 in services::dcs::NetworkDomainCollector::addDomain (...) at services/collect/dcs_NetworkDomainCollector.cpp:19
和
#14 0xb5d7a610 in framework::dom::OCObject::OCObject (...) at **/home/jenkins/workspace/Official_Builds_Pipeline**/mclinux/src/framework/dom/dom_OCObject.h:66
现在,对于我们的代码库,我们从McLinux中编译的根目录,但我最近意识到,许多文件(查看.o/gcov文件)显示它们是从mclinux/src/中汇编的,所以我想也许也许也许我只需要添加... mclinux和... mclinux/src作为“目录”参数,没有任何区别。
(gdb) info source
Current source file is services/collect/dcs_NetworkDomainCollector.cpp
Compilation directory is /home/jenkins/workspace/Official_Builds_Pipeline/mclinux/src <== SAME
Located in /home/user/mcgit/code/FMW-74565/coredumpout_16_29_52/mclinux/src/services/collect/dcs_NetworkDomainCollector.cpp <== gdb files this file!
#14 0xb5d7a610 in framework::dom::OCObject::OCObject (...) at /some/dir/mclinux/src/framework/dom/dom_OCObject.h:66
66 /some/dir/mclinux/src/framework/dom/dom_OCObject.h: No such file or directory
(gdb) info source
Current source file is /home/jenkins/workspace/Official_Builds_Pipeline/mclinux/src/framework/dom/dom_OCObject.h <== Naturally doesn't exist on my fs
Compilation directory is /home/jenkins/workspace/Official_Builds_Pipeline/mclinux/src <== SAME
<Not located by GDB>```
Is there any command I can use to see if gdb even tried to search down these paths?
Even trying to totally short circuit it with things like
set substitute-path /home/jenkins/workspace/Official_Builds_Pipeline/mclinux/src/framework/dom/ /home/user/mcgit/code/FMW-74565/coredumpout_16_29_52/mclinux/src/framework/dom/
or
set substitute-path /home/jenkins/workspace/Official_Builds_Pipeline/mclinux/src/ /home/user/mcgit/code/FMW-74565/coredumpout_16_29_52/mclinux/src/
or
set substitute-path /home/jenkins/workspace/Official_Builds_Pipeline/mclinux/ /home/user/mcgit/code/FMW-74565/coredumpout_16_29_52/mclinux/
我会回答我自己的问题,最后与替换路径一起玩,但我意识到,尽管目录更改了,但执行“ BT”时GDB打印的路径不会随着新路径而更新。不确定这是否被视为错误?但是,如果进入框架,您将看到源数据。当天的课程,不要以为替代路径失败,因为“ bt”仍然显示了旧路径。