From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Contributing LLVM.org patches to gud.el Date: Wed, 11 Feb 2015 18:07:42 +0200 Message-ID: <838ug477ox.fsf@gnu.org> References: <87mw4rxkzv.fsf@fencepost.gnu.org> <87y4oavxcy.fsf@fencepost.gnu.org> <87d25juy8m.fsf@fencepost.gnu.org> <83iofa8lu2.fsf@gnu.org> <87wq3qrvjz.fsf@fencepost.gnu.org> <83386d92ox.fsf@gnu.org> <874mqtsoqy.fsf@fencepost.gnu.org> <83y4o57lfj.fsf@gnu.org> <87oap1nmef.fsf@uwakimon.sk.tsukuba.ac.jp> <54DAD0C3.9040103@dancol.org> <8761b8raxh.fsf@fencepost.gnu.org> <54DB343D.5070008@dancol.org> <87h9usoa5r.fsf@uwakimon.sk.tsukuba.ac.jp> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1423670907 27220 80.91.229.3 (11 Feb 2015 16:08:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Feb 2015 16:08:27 +0000 (UTC) Cc: dancol@dancol.org, dak@gnu.org, emacs-devel@gnu.org To: "Stephen J. Turnbull" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 11 17:08:14 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YLZpl-0001vq-9U for ged-emacs-devel@m.gmane.org; Wed, 11 Feb 2015 17:08:13 +0100 Original-Received: from localhost ([::1]:45711 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLZpk-00086L-Kh for ged-emacs-devel@m.gmane.org; Wed, 11 Feb 2015 11:08:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55141) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLZpW-00086A-3q for emacs-devel@gnu.org; Wed, 11 Feb 2015 11:07:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLZpV-0005i8-2X for emacs-devel@gnu.org; Wed, 11 Feb 2015 11:07:58 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:50868) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLZpP-0005ha-QA; Wed, 11 Feb 2015 11:07:51 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NJM00F007BCGE00@a-mtaout22.012.net.il>; Wed, 11 Feb 2015 18:07:50 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NJM00FKP7H19E50@a-mtaout22.012.net.il>; Wed, 11 Feb 2015 18:07:50 +0200 (IST) In-reply-to: <87h9usoa5r.fsf@uwakimon.sk.tsukuba.ac.jp> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.172 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:182898 Archived-At: > From: "Stephen J. Turnbull" > Cc: David Kastrup , > Eli Zaretskii , > emacs-devel@gnu.org > 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.