Re: gcc i debug

Autor: Andrzej Pięta (ap_at_zt.koszalin.tpnet.pl)
Data: Tue 05 Feb 2002 - 11:14:45 MET


On Tue, 5 Feb 2002, Lech Wiktor Piotrowski wrote:

> jak skompilowc cos gcc z debugieim? Te helpy sa straszne - nie ma w nich zadnych
> podstawowych opcji gcc, albo jestem slepy :(
>
> Probowalem opcji -debug, kompilator nie protestuje, ale gdb twierdzi,z e nie znalazl
> zadnych symboli debugowania...
Witam :-)
        Pod unixem mam gcc:
      -g Produce debugging information in the operating system's
native format (stabs, COFF, XCOFF, or DWARF). GDB can work with this
debugging information.
 
              On most systems that use stabs format, `-g' enables use of
extra debugging information that only GDB can use; this extra
information makes debugging work better in GDB but will probably make
other de buggers crash or refuse to read the program. If you want
to control for certain whether to generate the extra
information, use
              `-gstabs+', `-gstabs', `-gxcoff+', `-gxcoff',
`-gdwarf+', or `-gdwarf' (see below).
 
              Unlike most other C compilers, GNU CC allows you to use
`-g' with`-O'. The shortcuts taken by optimized code may
occasionally produce surprising results: some variables you declared may not
exist at all; flow of control may briefly move where you did not
expect it; some statements may not be executed because they
compute constant results or their values were already at hand; some
statements may execute in different places because they were moved
out of loops.
 
              Nevertheless it proves possible to debug optimized
output. This makes it reasonable to use the optimizer for programs that
might have bugs.

To powinno być to o co Ci chodzi.
                                                        
                        Pozdrowienia
                                Andrzej
OS / 2 > Win ^ 95
|--------Telekomunikacja Polska S.A.----------------------------|
|+ +Andrzej Pięta+ +ap_at_koszalin.tpsa.pl ap_at_koszalin.tpnet.pl+ +|
|* * * * Departament, Ośrodek Informatyki w Szczecinie * * * * *|
|--------Obszar Telekomunikacji w Koszalinie--------------------|



To archiwum zostało wygenerowane przez hypermail 2.1.7 : Tue 18 May 2004 - 15:36:51 MET DST