]> xenbits.xensource.com Git - xen.git/commitdiff
build: convert crash_debug to Kconfig
authorDoug Goldstein <cardoe@cardoe.com>
Wed, 8 Jun 2016 12:06:59 +0000 (14:06 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 8 Jun 2016 12:09:16 +0000 (14:09 +0200)
Convert the crash_debug option to Kconfig as CONFIG_CRASH_DEBUG. This
was previously togglable on the command line so this adds a message for
users enabling it from the command line to tell them to enable it from
make menuconfig.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
INSTALL
docs/misc/crashdb.txt
xen/Kconfig.debug
xen/Rules.mk
xen/arch/x86/Makefile
xen/arch/x86/x86_64/Makefile
xen/common/Makefile
xen/include/asm-x86/debugger.h
xen/include/xen/gdbstub.h

diff --git a/INSTALL b/INSTALL
index 95fa94d048a777c6b712887edfec44e61bc2e9f8..2974b9b7f1279251890756c7af3809cd941c9033 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -231,7 +231,6 @@ verbose=y
 perfc=y
 perfc_arrays=y
 lock_profile=y
-crash_debug=y
 frame_pointer=y
 lto=y
 
index b41a538adbf42bc4947c88e8c4607592fef31abb..973366624b16e5261879750ca5431ce64f87b43a 100644 (file)
@@ -5,7 +5,7 @@ Xen has a simple gdb stub for doing post-mortem debugging i.e. once
 you've crashed it, you get to poke around and find out why.  There's
 also a special key handler for making it crash, which is handy.
 
-You need to have crash_debug=y set when compiling , and you also need
+You need to have CRASH_DEBUG=y set when compiling, and you also need
 to enable it on the Xen command line, eg by gdb=com1.
 
 If you need to have a serial port shared between gdb and the console,
@@ -19,7 +19,7 @@ if you have a simple null modem connection between the test box and
 the workstation, and aren't using a H/L split console:
 
   * Set debug=y in Config.mk
-  * Set crash_debug=y in xen/Rules.mk
+  * Set CRASH_DEBUG=y with `make -C xen menuconfig`
   * Make the changes in the attached patch, and build.
   * Arrange to pass gdb=com1 as a hypervisor command line argument
     (I already have com1=38400,8n1 console=com1,vga sync_console)
index 796af0c98b906e743afaa0882efcd711bda6e892..8eeb13fe269862d2c4a61ecb8dccf22c1e4e84fa 100644 (file)
@@ -11,4 +11,15 @@ config DEBUG
 
          You probably want to say 'N' here.
 
+if DEBUG || EXPERT = "y"
+
+config CRASH_DEBUG
+       bool "Crash Debugging Support"
+       depends on X86
+       ---help---
+         If you want to attach gdb to Xen to debug Xen if it crashes
+         then say Y.
+
+endif # DEBUG || EXPERT
+
 endmenu
index da2f490f4ed26705749d486656554c106016dc08..b077e25b22961220c4d99bdd56681592b242e929 100644 (file)
@@ -7,7 +7,6 @@ verbose       ?= n
 perfc         ?= n
 perfc_arrays  ?= n
 lock_profile  ?= n
-crash_debug   ?= n
 frame_pointer ?= n
 lto           ?= n
 
@@ -25,6 +24,9 @@ ifeq ($(perfc_arrays),y)
 perfc := y
 endif
 
+ifneq ($(origin crash_debug),undefined)
+$(error "You must use 'make menuconfig' to enable/disable crash_debug now.")
+endif
 ifeq ($(origin debug),command line)
 $(warning "You must use 'make menuconfig' to enable/disable debug now.")
 endif
@@ -59,7 +61,6 @@ CFLAGS += -Wa,--strip-local-absolute
 endif
 
 CFLAGS-$(verbose)       += -DVERBOSE
-CFLAGS-$(crash_debug)   += -DCRASH_DEBUG
 CFLAGS-$(perfc)         += -DPERF_COUNTERS
 CFLAGS-$(perfc_arrays)  += -DPERF_ARRAYS
 CFLAGS-$(lock_profile)  += -DLOCK_PROFILE
index b377c913206719e6d0977046bb37a64c7823d7b8..b18f0339f60fa7cd446125a72d1ba6d9e1aa31ac 100644 (file)
@@ -27,6 +27,7 @@ obj-y += domain_page.o
 obj-y += e820.o
 obj-y += extable.o
 obj-y += flushtlb.o
+obj-$(CONFIG_CRASH_DEBUG) += gdbstub.o
 obj-y += i387.o
 obj-y += i8259.o
 obj-y += io_apic.o
@@ -66,8 +67,6 @@ obj-y += hpet.o
 obj-y += vm_event.o
 obj-y += xstate.o
 
-obj-$(crash_debug) += gdbstub.o
-
 x86_emulate.o: x86_emulate/x86_emulate.c x86_emulate/x86_emulate.h
 
 efi-y := $(shell if [ ! -r $(BASEDIR)/include/xen/compile.h -o \
index 5b54c16d095838badd6502846742924faaa0a289..d8815e78b09d98ed43c2ec83418e4156a5a5f936 100644 (file)
@@ -14,4 +14,4 @@ obj-y += cpu_idle.o
 obj-y += cpufreq.o
 obj-bin-$(CONFIG_KEXEC) += kexec_reloc.o
 
-obj-$(crash_debug)   += gdbstub.o
+obj-$(CONFIG_CRASH_DEBUG)   += gdbstub.o
index 2a832614ffc9d2f0cd0e1c9d9575f460a7ae81dc..a4bd4d64fde7ff1bac8ab7a62c85c5e7bf208927 100644 (file)
@@ -8,6 +8,7 @@ obj-y += domain.o
 obj-y += event_2l.o
 obj-y += event_channel.o
 obj-y += event_fifo.o
+obj-$(CONFIG_CRASH_DEBUG) += gdbstub.o
 obj-y += grant_table.o
 obj-y += guestcopy.o
 obj-bin-y += gunzip.init.o
@@ -63,7 +64,6 @@ obj-y += xmalloc_tlsf.o
 obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma unlzo unlz4 earlycpio,$(n).init.o)
 
 obj-$(perfc)       += perfc.o
-obj-$(crash_debug) += gdbstub.o
 
 obj-$(CONFIG_COMPAT) += $(addprefix compat/,domain.o kernel.o memory.o multicall.o xlat.o)
 
index 33f47003080755f865edbeb8b7284546e3cae0e1..271cbaa88b3403dd4c876e6c47b87f98dbaa811c 100644 (file)
@@ -39,7 +39,7 @@
 #define DEBUGGER_trap_fatal(_v, _r) \
     if ( debugger_trap_fatal(_v, _r) ) return;
 
-#if defined(CRASH_DEBUG)
+#ifdef CONFIG_CRASH_DEBUG
 
 #include <xen/gdbstub.h>
 
index ab710da0470ac5bd405705bb440ee2ea5b899195..a5e6714439ac7b1ad7210d7fe48be0801e634169 100644 (file)
@@ -23,7 +23,7 @@
 #include <asm/atomic.h>
 #include <asm/page.h>
 
-#ifdef CRASH_DEBUG
+#ifdef CONFIG_CRASH_DEBUG
 
 struct gdb_context {
     int                 serhnd;           /* handle on our serial line */