gpt4 book ai didi

debugging - 海湾合作委员会/gdb : How to embed absolute path to source file in debug information?

转载 作者:行者123 更新时间:2023-12-03 02:55:24 26 4
gpt4 key购买 nike

我只是想知道我是否可以告诉 gcc 在调试信息中嵌入源文件的绝对路径,即使我像这样调用 gcc

gcc -g ../src/somecode.c -o ../bin/somecode.o 

据我所知,atm,gcc只存储你提供的内容,所以如果你提供相对路径,最后,gdb也只知道相对路径。

有没有办法在编译时不使用绝对路径来绕过它?就像:让 gcc 查找完整路径?

提前致谢rTi

最佳答案

gcc -fdebug-prefix-map=..=$(readlink -f ..)

关于debugging - 海湾合作委员会/gdb : How to embed absolute path to source file in debug information?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1275476/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com