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: Thu, 12 Feb 2015 18:26:01 +0200 Message-ID: <83iof75c6e.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> <838ug477ox.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1423758388 27556 80.91.229.3 (12 Feb 2015 16:26:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 12 Feb 2015 16:26:28 +0000 (UTC) Cc: dancol@dancol.org, dak@gnu.org, emacs-devel@gnu.org To: stephen@xemacs.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 12 17:26:23 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 1YLwas-0003KR-RT for ged-emacs-devel@m.gmane.org; Thu, 12 Feb 2015 17:26:22 +0100 Original-Received: from localhost ([::1]:50982 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLwas-0001km-2D for ged-emacs-devel@m.gmane.org; Thu, 12 Feb 2015 11:26:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34657) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLwan-0001kW-Nz for emacs-devel@gnu.org; Thu, 12 Feb 2015 11:26:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLwam-0001kW-8H for emacs-devel@gnu.org; Thu, 12 Feb 2015 11:26:17 -0500 Original-Received: from mtaout24.012.net.il ([80.179.55.180]:52356) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLwae-0001jU-F7; Thu, 12 Feb 2015 11:26:08 -0500 Original-Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0NJO00F002HT3000@mtaout24.012.net.il>; Thu, 12 Feb 2015 18:17:50 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NJO004BA2LPBKB0@mtaout24.012.net.il>; Thu, 12 Feb 2015 18:17:49 +0200 (IST) In-reply-to: <838ug477ox.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.180 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:182961 Archived-At: > Date: Wed, 11 Feb 2015 18:07:42 +0200 > From: Eli Zaretskii > Cc: dancol@dancol.org, dak@gnu.org, emacs-devel@gnu.org > > > From: "Stephen J. Turnbull" > > Cc: David Kastrup , > > Eli Zaretskii , > > emacs-devel@gnu.org > > 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: -fvar-tracking 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. -fvar-tracking-assignments 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: https://gcc.gnu.org/ml/gcc-help/2015-01/msg00152.html https://gcc.gnu.org/ml/gcc-help/2015-01/msg00155.html 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 "" are those which this feature is not (yet) good enough to fix.