gcc -ggdb和gcc -g有什么区别? [英] What is the difference between gcc -ggdb and gcc -g

查看:436
本文介绍了gcc -ggdb和gcc -g有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用gcc编译C程序
时,我通常使用 -g 来获取一些调试信息到elf文件
中,以便gdb可以帮助我,如果需要的话。

但是,我注意到一些程序使用 -ggdb ,因为它应该使
debug info更加gdb友好。

它们有什么不同,建议使用哪些?






<注意:指向调试程序或GCC选项的链接, http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html#Debugging-Options

解决方案

可能没有区别 - 取决于操作系统本机格式以及您希望调试信息的便携性。查看GCC手册调试选项


When I use gcc to compile C programs I usually use -g to get some debug information into the elf file so that gdb can help me if needed.

However, I noticed that some programs use -ggdb, since it's supposed to make the debug info more gdb friendly.

How do they differ and which is recommended to use?


Note: A link to the options for Debugging Your Program or GCC, http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html#Debugging-Options

解决方案

It is possible that there is no difference - depends on the OS native format and how portable you want the debugging info to be. See GCC manual Debugging Options.

这篇关于gcc -ggdb和gcc -g有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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