From: Euan Harris Subject: [PATCH] libxl/Makefile: Don't optimize debug builds; add macro debugging information Date: Mon, 1 Dec 2014 10:39:44 +0000 Message-ID: <1417430384-26220-1-git-send-email-euan.harris@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Euan Harris , Ian.Jackson@eu.citrix.com List-Id: xen-devel@lists.xenproject.org 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. 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. Signed-off-by: Euan Harris --- tools/libxl/Makefile | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile index df08c8a..26d8679 100644 --- a/tools/libxl/Makefile +++ b/tools/libxl/Makefile @@ -15,6 +15,12 @@ CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \ -Wno-declaration-after-statement -Wformat-nonliteral CFLAGS += -I. -fPIC +ifeq ($(debug),y) +# Disable optimizations and debugging information for macros +CFLAGS += -O0 -g3 +endif + + ifeq ($(CONFIG_Linux),y) LIBUUID_LIBS += -luuid endif -- 1.7.1