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

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

问题描述

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天全站免登陆