c - 告诉 C 内联函数但仍然可以调用调试器

标签 c gcc

有没有办法将函数标记为内联,但仍然可以在调试器中调用?我想调用的所有函数都标记为 static inline,因为我们只允许在我们的文件中公开某些函数。我正在使用 gcc。

最佳答案

-ginline-points 可以帮助:

Generate extended debug information for inlined functions. Location view tracking markers are inserted at inlined entry points, so that address and view numbers can be computed and output in debug information. This can be enabled independently of location views, in which case the view numbers won’t be output, but it can only be enabled along with statement frontiers, and it is only enabled by default if location views are enabled.

关于c - 告诉 C 内联函数但仍然可以调用调试器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52690601/

相关文章:

c - 编译时错误 "undefined reference to ` sin'"(使用 -lm)

c - 生产者消费者C编程中的死锁

c - 静态/动态库与 .so 库?

编译具有冲突类型的 C 代码

c - 线程显式调度 POSIX API 给出错误

C++比较函数结果

c - 如何打印 uint32_t 和 uint16_t 变量的值?

c - 您对此算法有何看法?

c - 可以像这样运行 scanf 吗?

C API 设计 : what to do when malloc returns NULL?