[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Contributing LLVM.org patches to gud.el

From: Eli Zaretskii
Subject: Re: Contributing LLVM.org patches to gud.el
Date: Thu, 12 Feb 2015 18:26:01 +0200

> Date: Wed, 11 Feb 2015 18:07:42 +0200
> From: Eli Zaretskii <address@hidden>
> Cc: address@hidden, address@hidden, address@hidden
> > From: "Stephen J. Turnbull" <address@hidden>
> > Cc: David Kastrup <address@hidden>,
> >     Eli Zaretskii <address@hidden>,
> >     address@hidden
> > Date: Wed, 11 Feb 2015 22:22:24 +0900
> > 
> > Eli mentioned DWARF 2.  The manual for GCC 4.8.4 says:
> > 
> >     -g
> >     Produce debugging information in the operating system's native format
> >     (stabs, COFF, XCOFF, or DWARF 2). GDB can work with this debugging
> >     information.
> > 
> > Later there is an option for specifying the version of DWARF, which
> > cautions that use of DWARF 4 "may require gdb 7 and
> > -fvar-tracking-assignments".  I'll have to try that.

AFAIU, -fvar-tracking-assignments is automatically turned on when
compiling an optimized program.  The GCC manual says:

      Run variable tracking pass. It computes where variables are
      stored at each position in code. Better debugging information is
      then generated (if the debugging information format supports
      this information).

      It is enabled by default when compiling with optimization (-Os,
      -O, -O2, ...), debugging information (-g) and the debug info
      format supports it.

      Annotate assignments to user variables early in the compilation
      and attempt to carry the annotations over throughout the
      compilation all the way to the end, in an attempt to improve
      debug information while optimizing. Use of -gdwarf-4 is
      recommended along with it.

      It can be enabled even if var-tracking is disabled, in which
      case annotations are created and maintained, but discarded at
      the end.

The part about -fvar-tracking-assignments is confusing, but this
discussion seems to clarify that:


My take of this is that if you have a recent enough GCC and GDB, you
are already using this feature in optimized programs, and any
variables that are still announced as "<optimized out>" are those
which this feature is not (yet) good enough to fix.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]