有没有办法将函数标记为内联,但仍然可以在调试器中调用?我想调用的所有函数都标记为 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/