Skip to content

Commit 17ce452

Browse files
committed
kgdb, powerpc: arch specific powerpc kgdb support
This patch removes the old kgdb reminants from ARCH=powerpc and implements the new style arch specific stub for the common kgdb core interface. It is possible to have xmon and kgdb in the same kernel, but you cannot use both at the same time because there is only one set of debug hooks. The arch specific kgdb implementation saves the previous state of the debug hooks and restores them if you unconfigure the kgdb I/O driver. Kgdb should have no impact on a kernel that has no kgdb I/O driver configured. Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
1 parent 5cbad0e commit 17ce452

7 files changed

Lines changed: 468 additions & 108 deletions

File tree

‎arch/powerpc/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ config PPC
112112
select HAVE_FTRACE
113113
select HAVE_IDE
114114
select HAVE_KPROBES
115+
select HAVE_ARCH_KGDB
115116
select HAVE_KRETPROBES
116117
select HAVE_LMB
117118
select HAVE_DMA_ATTRS if PPC64

‎arch/powerpc/Kconfig.debug‎

Lines changed: 6 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,6 @@ config HCALL_STATS
4141
This option will add a small amount of overhead to all hypervisor
4242
calls.
4343

44-
config DEBUGGER
45-
bool "Enable debugger hooks"
46-
depends on DEBUG_KERNEL
47-
help
48-
Include in-kernel hooks for kernel debuggers. Unless you are
49-
intending to debug the kernel, say N here.
50-
51-
config KGDB
52-
bool "Include kgdb kernel debugger"
53-
depends on DEBUGGER && (BROKEN || PPC_GEN550 || 4xx)
54-
select DEBUG_INFO
55-
help
56-
Include in-kernel hooks for kgdb, the Linux kernel source level
57-
debugger. See <http://kgdb.sourceforge.net/> for more information.
58-
Unless you are intending to debug the kernel, say N here.
59-
6044
config CODE_PATCHING_SELFTEST
6145
bool "Run self-tests of the code-patching code."
6246
depends on DEBUG_KERNEL
@@ -67,36 +51,9 @@ config FTR_FIXUP_SELFTEST
6751
depends on DEBUG_KERNEL
6852
default n
6953

70-
choice
71-
prompt "Serial Port"
72-
depends on KGDB
73-
default KGDB_TTYS1
74-
75-
config KGDB_TTYS0
76-
bool "ttyS0"
77-
78-
config KGDB_TTYS1
79-
bool "ttyS1"
80-
81-
config KGDB_TTYS2
82-
bool "ttyS2"
83-
84-
config KGDB_TTYS3
85-
bool "ttyS3"
86-
87-
endchoice
88-
89-
config KGDB_CONSOLE
90-
bool "Enable serial console thru kgdb port"
91-
depends on KGDB && 8xx || CPM2
92-
help
93-
If you enable this, all serial console messages will be sent
94-
over the gdb stub.
95-
If unsure, say N.
96-
9754
config XMON
9855
bool "Include xmon kernel debugger"
99-
depends on DEBUGGER
56+
depends on DEBUG_KERNEL
10057
help
10158
Include in-kernel hooks for the xmon kernel monitor/debugger.
10259
Unless you are intending to debug the kernel, say N here.
@@ -126,6 +83,11 @@ config XMON_DISASSEMBLY
12683
to say Y here, unless you're building for a memory-constrained
12784
system.
12885

86+
config DEBUGGER
87+
bool
88+
depends on KGDB || XMON
89+
default y
90+
12991
config IRQSTACKS
13092
bool "Use separate kernel stacks when processing interrupts"
13193
help

‎arch/powerpc/kernel/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ obj-y += time.o prom.o traps.o setup-common.o \
7474
misc_$(CONFIG_WORD_SIZE).o
7575
obj-$(CONFIG_PPC32) += entry_32.o setup_32.o
7676
obj-$(CONFIG_PPC64) += dma_64.o iommu.o
77+
obj-$(CONFIG_KGDB) += kgdb.o
7778
obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o
7879
obj-$(CONFIG_MODULES) += ppc_ksyms.o
7980
obj-$(CONFIG_BOOTX_TEXT) += btext.o

0 commit comments

Comments
 (0)