是否存在GCC编译指示来覆盖某些部分代码的调试信息(-g)的生成? [英] Is there a GCC pragma to override generation of debug info (-g) for some section of code?

查看:138
本文介绍了是否存在GCC编译指示来覆盖某些部分代码的调试信息(-g)的生成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在应用程序中包含一些调试信息,但隐藏某些符号以免出现.有什么办法可以在GCC 4.0(或4.2)中做到这一点?这是在OSX上.

I'd like to include some debug information in an application, but hide certain symbols from appearing. Is there any way to do this with GCC 4.0 (or 4.2)? This is on OSX.

推荐答案

将所有此类代码移动到单个源文件中,并在不使用-g的情况下进行编译.请注意,出于明显的原因,您不能省略全局符号名称.

Move all such code into a single source file and compile that without -g. Note that you can't omit global symbol names for obvious reasons.

这篇关于是否存在GCC编译指示来覆盖某些部分代码的调试信息(-g)的生成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆