public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* -g vs -g3 -ggdb3
@ 2007-05-23 22:00 John Carter
  2007-05-24 16:18 ` Alfred M. Szmidt
  0 siblings, 1 reply; 2+ messages in thread
From: John Carter @ 2007-05-23 22:00 UTC (permalink / raw)
  To: gcc-help

Here's the FM That I Read....

`-gLEVEL'
`-ggdbLEVEL'
`-gstabsLEVEL'
`-gcoffLEVEL'
`-gxcoffLEVEL'
`-gvmsLEVEL'
      Request debugging information and also use LEVEL to specify how
      much information.  The default level is 2.

      Level 1 produces minimal information, enough for making backtraces
      in parts of the program that you don't plan to debug.  This
      includes descriptions of functions and external variables, but no
      information about local variables and no line numbers.

      Level 3 includes extra information, such as all the macro
      definitions present in the program.  Some debuggers support macro
      expansion when you use `-g3'.

      `-gdwarf-2' does not accept a concatenated debug level, because
      GCC used to support an option `-gdwarf' that meant to generate
      debug information in version 1 of the DWARF format (which is very
      different from version 2), and it would have been too confusing.
      That debug format is long obsolete, but the option cannot be
      changed now.  Instead use an additional `-gLEVEL' option to change
      the debug level for DWARF2.

Someone recommended we use -g3 -ggdb3 when debugging with gdb. It
seems to bloat the ELF files hugely. Three questions...

Q1 Which is the best setting to use with gdb (under linux)?

Q2 Is there anyway to decrease the bloat?

Q3 Do we need to say -g3 -ggdb3 or is -ggdb3 sufficient?


Thanks,

John Carter                             Phone : (64)(3) 358 6639
Tait Electronics                        Fax   : (64)(3) 359 4632
PO Box 1645 Christchurch                Email : john.carter@tait.co.nz
New Zealand

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: -g vs -g3 -ggdb3
  2007-05-23 22:00 -g vs -g3 -ggdb3 John Carter
@ 2007-05-24 16:18 ` Alfred M. Szmidt
  0 siblings, 0 replies; 2+ messages in thread
From: Alfred M. Szmidt @ 2007-05-24 16:18 UTC (permalink / raw)
  To: John Carter; +Cc: gcc-help

   Q1 Which is the best setting to use with gdb (under linux)?

It depends on the task.

   Q2 Is there anyway to decrease the bloat?

You can always use a lower debugging level, but then you lose some
information.  It is always possible to debug programs just by
examining the assembler output as well.

   Q3 Do we need to say -g3 -ggdb3 or is -ggdb3 sufficient?

-ggdb produces debuging information only usable by gdb, while -g
produces whatever the native system uses.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-05-24 16:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-23 22:00 -g vs -g3 -ggdb3 John Carter
2007-05-24 16:18 ` Alfred M. Szmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).