GDB最多但并非全部源文件

问题描述 投票:0回答:1
出于某种原因,即使使用相同的汇编目录,GDB也只会找到源文件的子集

例如一个例子:

#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”仍然显示了旧路径。
c++ gdb
1个回答
0
投票

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.