热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

为什么对象文件的debug_str这么大?-whyobjectfile'sdebug_strsobig?

iuse[objdumpXXX.o-Ws]outputmanystringlines,theyareallstructnamesinmyotherc++head

enter image description here

i use [objdump XXX.o -Ws] output many string lines, they are all struct names in my other c++ head files, but some of them are repeated, make my XXX.o so big.

我使用[objdump XXX.o -Ws]输出许多字符串行,它们都是我的其他c ++头文件中的结构名称,但是其中一些重复,使我的XXX.o如此之大。

can anyone tell me, are the repeated struct names in debug_str required for gcc ? and is there some parameters of gcc to reduce the repeated string? thanks.

任何人都可以告诉我,gcc需要debug_str中重复的结构名称吗?是否有一些gcc的参数来减少重复的字符串?谢谢。

1 个解决方案

#1


1  

can anyone tell me, are the repeated struct names in debug_str required for gcc ?

任何人都可以告诉我,gcc需要debug_str中重复的结构名称吗?

Yes, they are required if you want to debug your program in a friendly way.

是的,如果您想以友好的方式调试程序,则需要它们。

and is there some parameters of gcc to reduce the repeated string? thanks. Not directly, no.

是否有一些gcc的参数来减少重复的字符串?谢谢。不直接,没有。

You can remove the -g or similar arguments when you compile. Though that will make source level debugging possible anymore.

您可以在编译时删除-g或类似的参数。虽然这将使源代码级调试成为可能。

You can also remove that information yourself, by running the strip -g command on your binary or object files.

您也可以通过在二进制文件或目标文件上运行strip -g命令来自行删除该信息。

Remember that this is debug information, used by a debugger. That information is not loaded or used when running your program normally.

请记住,这是调试器使用的调试信息。正常运行程序时,不会加载或使用该信息。


推荐阅读
author-avatar
手机用户2502859523
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有