From mboxrd@z Thu Jan 1 00:00:00 1970 From: Euan Harris Subject: Re: [PATCH] libxl/Makefile: Don't optimize debug builds; add macro debugging information Date: Mon, 1 Dec 2014 11:55:21 +0000 Message-ID: <20141201115521.GB3731@citrix.com> References: <1417430384-26220-1-git-send-email-euan.harris@citrix.com> <1417434193.29138.14.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1417434193.29138.14.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Mon, Dec 01, 2014 at 11:43:13AM +0000, Ian Campbell wrote: > On Mon, 2014-12-01 at 10:39 +0000, Euan Harris wrote: > > libxl debug builds are built with optimization level -O1, inherited from > > the CFLAGS definition in StdGNU.mk. Optimizations confuse the debugger, > > and the comment justifying -O1 in StdGNU.mk should not apply for a > > userspace library. Disable optimization by appending -O0 to CFLAGS, > > which overrides the -O1 flag specified earlier. > > I think if this argument applies (I see no reason to disagree) then it > should apply to the whole of tools/* or at least to tools/lib* and not > just to libxl. IOW this probably belongs at a higher level somewhere. Ok, I'll submit a new patch putting it in tools/Rules.mk > > Also specify -g3, to add macro debugging information which allows > > gdb to expand macro invocations. This is useful as libxl uses many > > non-trivial macros. > > Useful, I'd never heard of this. Do you know which version of gcc > introduced it? (AKA do we need to make it part of configure.ac to check > availability or not). It's documented in GCC 2.95.3 [1], which is as far back as the online manuals go. [1] https://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC9 > Not sure if you were proposing this change for 4.5 or not. It would be nice to have, but I was assuming that 4.5 was more or less closed by now. Thanks, Euan