1menu "Kernel hacking"
2
3source "lib/Kconfig.debug"
4
5config DEBUG_DECOMPRESS_KERNEL
6	bool "Using serial port during decompressing kernel"
7	depends on DEBUG_KERNEL
8	default n
9	help
10	  If you say Y here you will confirm the start and the end of
11	  decompressing Linux seeing "Uncompressing Linux... " and
12	  "Ok, booting the kernel.\n" on console.
13
14config TEST_MISALIGNMENT_HANDLER
15	bool "Run tests on the misalignment handler"
16	depends on DEBUG_KERNEL
17	default n
18	help
19	  If you say Y here the kernel will execute a list of misaligned memory
20	  accesses to make sure the misalignment handler deals them with
21	  correctly.  If it does not, the kernel will throw a BUG.
22
23config KPROBES
24	bool "Kprobes"
25	depends on DEBUG_KERNEL
26	help
27	  Kprobes allows you to trap at almost any kernel address and
28	  execute a callback function.  register_kprobe() establishes
29	  a probepoint and specifies the callback.  Kprobes is useful
30	  for kernel debugging, non-intrusive instrumentation and testing.
31	  If in doubt, say "N".
32
33config GDBSTUB
34	bool "Remote GDB kernel debugging"
35	depends on DEBUG_KERNEL && DEPRECATED
36	select DEBUG_INFO
37	select FRAME_POINTER
38	help
39	  If you say Y here, it will be possible to remotely debug the kernel
40	  using gdb. This enlarges your kernel ELF image disk size by several
41	  megabytes and requires a machine with more than 16 MB, better 32 MB
42	  RAM to avoid excessive linking time. This is only useful for kernel
43	  hackers. If unsure, say N.
44
45	  This is deprecated in favour of KGDB and will be removed in a later
46	  version.
47
48config GDBSTUB_IMMEDIATE
49	bool "Break into GDB stub immediately"
50	depends on GDBSTUB
51	help
52	  If you say Y here, GDB stub will break into the program as soon as
53	  possible, leaving the program counter at the beginning of
54	  start_kernel() in init/main.c.
55
56config GDBSTUB_ALLOW_SINGLE_STEP
57	bool "Allow software single-stepping in GDB stub"
58	depends on GDBSTUB && !SMP && !PREEMPT
59	help
60	  Allow GDB stub to perform software single-stepping through the
61	  kernel.  This doesn't work very well on SMP or preemptible kernels as
62	  it uses temporary breakpoints to emulate single-stepping.
63
64config GDB_CONSOLE
65	bool "Console output to GDB"
66	depends on GDBSTUB
67	help
68	  If you are using GDB for remote debugging over a serial port and
69	  would like kernel messages to be formatted into GDB $O packets so
70	  that GDB prints them as program output, say 'Y'.
71
72config GDBSTUB_DEBUGGING
73	bool "Debug GDB stub by messages to serial port"
74	depends on GDBSTUB
75	help
76	  This causes debugging messages to be displayed at various points
77	  during execution of the GDB stub routines. Such messages will be
78	  displayed on ttyS0 if that isn't the GDB stub's port, or ttySM0
79	  otherwise.
80
81config GDBSTUB_DEBUG_ENTRY
82	bool "Debug GDB stub entry"
83	depends on GDBSTUB_DEBUGGING
84	help
85	  This option causes information to be displayed about entry to or exit
86	  from the main GDB stub routine.
87
88config GDBSTUB_DEBUG_PROTOCOL
89	bool "Debug GDB stub protocol"
90	depends on GDBSTUB_DEBUGGING
91	help
92	  This option causes information to be displayed about the GDB remote
93	  protocol messages generated exchanged with GDB.
94
95config GDBSTUB_DEBUG_IO
96	bool "Debug GDB stub I/O"
97	depends on GDBSTUB_DEBUGGING
98	help
99	  This option causes information to be displayed about GDB stub's
100	  low-level I/O.
101
102config GDBSTUB_DEBUG_BREAKPOINT
103	bool "Debug GDB stub breakpoint management"
104	depends on GDBSTUB_DEBUGGING
105	help
106	  This option causes information to be displayed about GDB stub's
107	  breakpoint management.
108
109choice
110	prompt "GDB stub port"
111	default GDBSTUB_ON_TTYSM0
112	depends on GDBSTUB
113	help
114	  Select the serial port used for GDB-stub.
115
116config GDBSTUB_ON_TTYSM0
117	bool "/dev/ttySM0 [SIF0]"
118	depends on MN10300_TTYSM0
119	select GDBSTUB_ON_TTYSMx
120
121config GDBSTUB_ON_TTYSM1
122	bool "/dev/ttySM1 [SIF1]"
123	depends on MN10300_TTYSM1
124	select GDBSTUB_ON_TTYSMx
125
126config GDBSTUB_ON_TTYSM2
127	bool "/dev/ttySM2 [SIF2]"
128	depends on MN10300_TTYSM2
129	select GDBSTUB_ON_TTYSMx
130
131config GDBSTUB_ON_TTYS0
132	bool "/dev/ttyS0"
133	select GDBSTUB_ON_TTYSx
134
135config GDBSTUB_ON_TTYS1
136	bool "/dev/ttyS1"
137	select GDBSTUB_ON_TTYSx
138
139endchoice
140
141config GDBSTUB_ON_TTYSMx
142	bool
143	depends on GDBSTUB_ON_TTYSM0 || GDBSTUB_ON_TTYSM1 || GDBSTUB_ON_TTYSM2
144	default y
145
146config GDBSTUB_ON_TTYSx
147	bool
148	depends on GDBSTUB_ON_TTYS0 || GDBSTUB_ON_TTYS1
149	default y
150
151endmenu
152
153config KERNEL_DEBUGGER
154	def_bool y
155	depends on GDBSTUB || KGDB
156