emacs-devel
[Top][All Lists]
Advanced

[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: Wed, 11 Feb 2015 18:07:42 +0200

> 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
> 
> Daniel Colascione writes:
> 
>  > DWARF's virtual machine contains instructions for regenerating
>  > these values from extant values and for building them out of thin
>  > air. See section 2.5 of the DWARF 4 specification. GCC could emit
>  > enough information to rebuild lost values, but does not.
> 
> 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.

I'm sorry for confusing wording, although this is not entirely my
fault.  The official name of the DWARF Standard is "DWARF Version N",
and the latest is "DWARF Version 4".  But GDB and GCC developers tend
to refer to DWARF Version 2 and newer as "DWARF 2".  Even GDB itself
caught this disease: if I compile a program with an explicit -gdwarf-4
command-line option (this is GCC 4.8.1), GDB still says

  (gdb) info source
  Current source file is tt.c
  Compilation directory is D:\usr\eli\utils
  Located in D:\usr\eli\utils\tt.c
  Contains 16 lines.
  Source language is c.
  Compiled with DWARF 2 debugging format.  <<<<<<<<<<<<<<<<<<<<<<

However, "objdump --dwarf=info" tells the truth:

  Contents of the .debug_info section:

    Compilation Unit @ offset 0x0:
     Length:        0x2bf (32-bit)
     Version:       4    <<<<<<<<<<<<<<<<<<<<<

> For those of us who aren't gdb developers, it would be nice if gdb
> mentioned that use of DWARF 4 and special gcc options helps in
> debugging.

It doesn't have to: GCC defaults to the latest version of DWARF
automatically.  Thus, if your GCC supports DWARF Version 4, it will
always use it, unless you override that with -gdwarf-3 or some such.



reply via email to

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