gpt4 book ai didi

c - 是否可以让 GDB 识别预处理器符号?

转载 作者:太空狗 更新时间:2023-10-29 17:18:34 26 4
gpt4 key购买 nike

我有很多很多 C 预处理器 #define 语句,这使我的 C 编程变得更加容易。但是,在使用 GDB 进行调试时,预处理器“标签”不在符号列表中。

有没有办法让 GDB 识别 #defined 标签?

最佳答案

您可以尝试使用 g3 进行编译,如 here 所述.

gcc -gdwarf-2 -g3

We pass the -gdwarf-2 and -g3 flags to ensure the compiler includes information about preprocessor macros in the debugging information.

或者你可以试试-ggdb

关于c - 是否可以让 GDB 识别预处理器符号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9789076/

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