* [PATCH v4] Separate runtime debug output from debug symbols
@ 2014-10-09 7:58 Olaf Hering
2014-10-09 14:07 ` Jan Beulich
0 siblings, 1 reply; 3+ messages in thread
From: Olaf Hering @ 2014-10-09 7:58 UTC (permalink / raw)
To: xen-devel
Cc: Wei Liu, Olaf Hering, Keir Fraser, David Scott, Tim Deegan,
Stefano Stabellini, Ian Jackson, Jan Beulich, Samuel Thibault,
Ian Campbell
Two make variables exist (debug=y and debug_symbols=y) to control either
the creation of additional runtime debug or the creation of debug
symbols for tools like gdb. Some places in the code still passed -g
unconditionally to the compiler. Wrap them into a "debug_symbols"
conditional. The xen build passed -g unconditional, reuse the existing
debug_symbols=y check in Config.mk. There are still parts of the code
that hardcode -g, namely the external qemu-traditional and stubdom
packages. They are not changed by this patch.
No change in behaviour is expected by that patch for tools and xen.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Jan Beulich <jbeulich@suse.com> (for xen/Rules.mk)
Cc: David Scott <dave.scott@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Tim Deegan <tim@xen.org>
Cc: Wei Liu <wei.liu2@citrix.com>
---
IanJ, I think the change to Config.mk is what you mean in your response
to v3 of that patch.
Config.mk | 2 +-
tools/Makefile | 7 +++++++
tools/ocaml/common.make | 5 ++++-
xen/Rules.mk | 2 +-
4 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/Config.mk b/Config.mk
index 6324237..7519fa9 100644
--- a/Config.mk
+++ b/Config.mk
@@ -18,7 +18,7 @@ or = $(if $(strip $(1)),$(1),$(if $(strip $(2)),$(2),$(if $(strip $(3)),$(
# A debug build of Xen and tools?
debug ?= y
-debug_symbols ?= $(debug)
+debug_symbols ?= y
# Test coverage support
coverage ?= n
diff --git a/tools/Makefile b/tools/Makefile
index 543cd29..884dc91 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -197,6 +197,12 @@ else
QEMU_XEN_ENABLE_DEBUG :=
endif
+ifeq ($(debug_symbols),y)
+QEMU_XEN_ENABLE_DEBUG_SYMBOLS := --enable-debug-info --disable-strip
+else
+QEMU_XEN_ENABLE_DEBUG_SYMBOLS := --disable-debug-info
+endif
+
subdir-all-qemu-xen-dir: qemu-xen-dir-find
if test -d $(QEMU_UPSTREAM_LOC) ; then \
source=$(QEMU_UPSTREAM_LOC); \
@@ -206,6 +212,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
cd qemu-xen-dir; \
$$source/configure --enable-xen --target-list=i386-softmmu \
$(QEMU_XEN_ENABLE_DEBUG) \
+ $(QEMU_XEN_ENABLE_DEBUG_SYMBOLS) \
--prefix=$(LIBEXEC) \
--libdir=$(LIBEXEC_LIB) \
--includedir=$(LIBEXEC_INC) \
diff --git a/tools/ocaml/common.make b/tools/ocaml/common.make
index d5478f6..33b3142 100644
--- a/tools/ocaml/common.make
+++ b/tools/ocaml/common.make
@@ -13,7 +13,10 @@ CFLAGS += -fPIC -Werror -I$(shell ocamlc -where)
OCAMLOPTFLAG_G := $(shell $(OCAMLOPT) -h 2>&1 | sed -n 's/^ *\(-g\) .*/\1/p')
OCAMLOPTFLAGS = $(OCAMLOPTFLAG_G) -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) -cc $(CC) -w F -warn-error F
-OCAMLCFLAGS += -g $(OCAMLINCLUDE) -w F -warn-error F
+ifeq ($(debug_symbols),y)
+OCAMLCFLAGS += -g
+endif
+OCAMLCFLAGS += $(OCAMLINCLUDE) -w F -warn-error F
VERSION := 4.1
diff --git a/xen/Rules.mk b/xen/Rules.mk
index a97405c..60cd173 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -43,7 +43,7 @@ ALL_OBJS-$(x86) += $(BASEDIR)/crypto/built_in.o
CFLAGS += -fno-builtin -fno-common
CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
-CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
+CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h
CFLAGS += -nostdinc
CFLAGS-$(XSM_ENABLE) += -DXSM_ENABLE
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v4] Separate runtime debug output from debug symbols
2014-10-09 7:58 [PATCH v4] Separate runtime debug output from debug symbols Olaf Hering
@ 2014-10-09 14:07 ` Jan Beulich
2014-10-09 14:58 ` Andrew Cooper
0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2014-10-09 14:07 UTC (permalink / raw)
To: olaf, xen-devel
Cc: wei.liu2, ian.campbell, stefano.stabellini, tim, ian.jackson,
samuel.thibault, keir, dave.scott
>>> Olaf Hering <olaf@aepfle.de> 10/09/14 9:59 AM >>>
>--- a/Config.mk
>+++ b/Config.mk
>@@ -18,7 +18,7 @@ or = $(if $(strip $(1)),$(1),$(if $(strip $(2)),$(2),$(if $(strip $(3)),$(
>
># A debug build of Xen and tools?
>debug ?= y
>-debug_symbols ?= $(debug)
>+debug_symbols ?= y
Even if this may be what Ian asked you to do (albeit it's not entirely clear
to me), I don't think I'm in agreement with this change being done: I
personally expect to be able to disable debug_symbols as a side effect
of disabling debug.
Jan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v4] Separate runtime debug output from debug symbols
2014-10-09 14:07 ` Jan Beulich
@ 2014-10-09 14:58 ` Andrew Cooper
0 siblings, 0 replies; 3+ messages in thread
From: Andrew Cooper @ 2014-10-09 14:58 UTC (permalink / raw)
To: Jan Beulich, olaf, xen-devel
Cc: wei.liu2, ian.campbell, stefano.stabellini, tim, ian.jackson,
samuel.thibault, keir, dave.scott
On 09/10/14 15:07, Jan Beulich wrote:
>>>> Olaf Hering <olaf@aepfle.de> 10/09/14 9:59 AM >>>
>> --- a/Config.mk
>> +++ b/Config.mk
>> @@ -18,7 +18,7 @@ or = $(if $(strip $(1)),$(1),$(if $(strip $(2)),$(2),$(if $(strip $(3)),$(
> >
>> # A debug build of Xen and tools?
>> debug ?= y
>> -debug_symbols ?= $(debug)
>> +debug_symbols ?= y
>
> Even if this may be what Ian asked you to do (albeit it's not entirely clear
> to me), I don't think I'm in agreement with this change being done: I
> personally expect to be able to disable debug_symbols as a side effect
> of disabling debug.
>
> Jan
Agreed, which is why I (as the author of the debug_symbols change) left
it that way.
FWIW, I believe that v3 of this patch is correct. I did not follow the
reasoning for the objection.
Anyone building for themselves will (should) be doing debug builds.
Anyone packaging RPMs will want debug_symbols enabled to generate
-debuginfo RPMs. I presume .debs have a similar principle.
~Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-10-09 14:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-09 7:58 [PATCH v4] Separate runtime debug output from debug symbols Olaf Hering
2014-10-09 14:07 ` Jan Beulich
2014-10-09 14:58 ` Andrew Cooper
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.