[debug] 使用rpmbuild时gdb怎么找到debuginfo

用rpm进行源码编译和release的时候,会生成两个包,一个正常的rpm

另一个是带debuginfo后缀的包.

正常包里的二进制会被strip出来放在debuginfo包中.用于后续的debug

详见下面的两个文档:

https://gnu.wildebeest.org/blog/mjw/2016/02/02/where-are-your-symbols-debuginfo-and-sources/

https://sourceware.org/gdb/current/onlinedocs/gdb/Separate-Debug-Files.html

根据上文文档所述,无论什么时候编译,都要带着'-g'选项,因为反正最后会被strip掉.

原文地址:https://www.cnblogs.com/hugetong/p/14133867.html