[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] tools/Rules.mk: Don't optimize debug builds; add macro debugging information



commit 1166ecf781b1016eaa61f8d5ba4fb1fde9d599b6
Author:     Euan Harris <euan.harris@xxxxxxxxxx>
AuthorDate: Mon Dec 1 14:21:05 2014 +0000
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Mon Jan 12 16:10:51 2015 +0000

    tools/Rules.mk: Don't optimize debug builds; add macro debugging information
    
    Tools 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 <euan.harris@xxxxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
    [ ijc -- inserted a clarifying "enable" into comment ]
---
 tools/Rules.mk |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/tools/Rules.mk b/tools/Rules.mk
index 87a56dc..962a743 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -54,6 +54,11 @@ CFLAGS_libxenvchan = -I$(XEN_LIBVCHAN)
 LDLIBS_libxenvchan = $(SHLIB_libxenctrl) $(SHLIB_libxenstore) 
-L$(XEN_LIBVCHAN) -lxenvchan
 SHLIB_libxenvchan  = -Wl,-rpath-link=$(XEN_LIBVCHAN)
 
+ifeq ($(debug),y)
+# Disable optimizations and enable debugging information for macros
+CFLAGS += -O0 -g3
+endif
+
 LIBXL_BLKTAP ?= $(CONFIG_BLKTAP2)
 
 ifeq ($(LIBXL_BLKTAP),y)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.