xref: /linux/lib/Kconfig.kgdb (revision b8017177cdfd46b0222b3b74b206780f52f22f3d)
1dc7d5527SJason Wessel
2e024cbd2SJan Engelhardtconfig HAVE_ARCH_KGDB
3e024cbd2SJan Engelhardt	bool
4e024cbd2SJan Engelhardt
5dc7d5527SJason Wesselmenuconfig KGDB
6dcc78711SJason Wessel	bool "KGDB: kernel debugger"
7dc7d5527SJason Wessel	depends on HAVE_ARCH_KGDB
8525c1f92SKees Cook	depends on DEBUG_KERNEL
9dc7d5527SJason Wessel	help
10dc7d5527SJason Wessel	  If you say Y here, it will be possible to remotely debug the
115f5ddfb3SJason Wessel	  kernel using gdb.  It is recommended but not required, that
125f5ddfb3SJason Wessel	  you also turn on the kernel config option
135f5ddfb3SJason Wessel	  CONFIG_FRAME_POINTER to aid in producing more reliable stack
145f5ddfb3SJason Wessel	  backtraces in the external debugger.  Documentation of
155f5ddfb3SJason Wessel	  kernel debugger is available at http://kgdb.sourceforge.net
165f5ddfb3SJason Wessel	  as well as in DocBook form in Documentation/DocBook/.  If
175f5ddfb3SJason Wessel	  unsure, say N.
18dc7d5527SJason Wessel
19e024cbd2SJan Engelhardtif KGDB
20dc7d5527SJason Wessel
21dc7d5527SJason Wesselconfig KGDB_SERIAL_CONSOLE
22dc7d5527SJason Wessel	tristate "KGDB: use kgdb over the serial console"
23dc7d5527SJason Wessel	select CONSOLE_POLL
24dc7d5527SJason Wessel	select MAGIC_SYSRQ
254f73bc4dSJoe Millenbach	depends on TTY
26dc7d5527SJason Wessel	default y
27dc7d5527SJason Wessel	help
28dc7d5527SJason Wessel	  Share a serial console with kgdb. Sysrq-g must be used
29dc7d5527SJason Wessel	  to break in initially.
30e8d31c20SJason Wessel
31e8d31c20SJason Wesselconfig KGDB_TESTS
32e8d31c20SJason Wessel	bool "KGDB: internal test suite"
33e8d31c20SJason Wessel	default n
34e8d31c20SJason Wessel	help
35e8d31c20SJason Wessel	  This is a kgdb I/O module specifically designed to test
36e8d31c20SJason Wessel	  kgdb's internal functions.  This kgdb I/O module is
37e8d31c20SJason Wessel	  intended to for the development of new kgdb stubs
38e8d31c20SJason Wessel	  as well as regression testing the kgdb internals.
39e8d31c20SJason Wessel	  See the drivers/misc/kgdbts.c for the details about
40e8d31c20SJason Wessel	  the tests.  The most basic of this I/O module is to boot
41e8d31c20SJason Wessel	  a kernel boot arguments "kgdbwait kgdbts=V1F100"
42974460c5SJason Wessel
43974460c5SJason Wesselconfig KGDB_TESTS_ON_BOOT
44974460c5SJason Wessel	bool "KGDB: Run tests on boot"
45974460c5SJason Wessel	depends on KGDB_TESTS
46974460c5SJason Wessel	default n
47974460c5SJason Wessel	help
48974460c5SJason Wessel	  Run the kgdb tests on boot up automatically without the need
49974460c5SJason Wessel	  to pass in a kernel parameter
50974460c5SJason Wessel
51974460c5SJason Wesselconfig KGDB_TESTS_BOOT_STRING
52974460c5SJason Wessel	string "KGDB: which internal kgdb tests to run"
53974460c5SJason Wessel	depends on KGDB_TESTS_ON_BOOT
54974460c5SJason Wessel	default "V1F100"
55974460c5SJason Wessel	help
56974460c5SJason Wessel	  This is the command string to send the kgdb test suite on
57974460c5SJason Wessel	  boot.  See the drivers/misc/kgdbts.c for detailed
58974460c5SJason Wessel	  information about other strings you could use beyond the
59974460c5SJason Wessel	  default of V1F100.
60e024cbd2SJan Engelhardt
61f503b5aeSJason Wesselconfig KGDB_LOW_LEVEL_TRAP
62f503b5aeSJason Wessel       bool "KGDB: Allow debugging with traps in notifiers"
635dd11d5dSJason Wessel       depends on X86 || MIPS
64f503b5aeSJason Wessel       default n
65f503b5aeSJason Wessel       help
66f503b5aeSJason Wessel         This will add an extra call back to kgdb for the breakpoint
67278cee05SMasanari Iida         exception handler which will allow kgdb to step through a
68278cee05SMasanari Iida         notify handler.
69f503b5aeSJason Wessel
70dcc78711SJason Wesselconfig KGDB_KDB
71dcc78711SJason Wessel	bool "KGDB_KDB: include kdb frontend for kgdb"
72dcc78711SJason Wessel	default n
73dcc78711SJason Wessel	help
74dcc78711SJason Wessel	  KDB frontend for kernel
75dcc78711SJason Wessel
76*b8017177SDaniel Thompsonconfig KDB_DEFAULT_ENABLE
77*b8017177SDaniel Thompson	hex "KDB: Select kdb command functions to be enabled by default"
78*b8017177SDaniel Thompson	depends on KGDB_KDB
79*b8017177SDaniel Thompson	default 0x1
80*b8017177SDaniel Thompson	help
81*b8017177SDaniel Thompson	  Specifiers which kdb commands are enabled by default. This may
82*b8017177SDaniel Thompson	  be set to 1 or 0 to enable all commands or disable almost all
83*b8017177SDaniel Thompson	  commands.
84*b8017177SDaniel Thompson
85*b8017177SDaniel Thompson	  Alternatively the following bitmask applies:
86*b8017177SDaniel Thompson
87*b8017177SDaniel Thompson	    0x0002 - allow arbitrary reads from memory and symbol lookup
88*b8017177SDaniel Thompson	    0x0004 - allow arbitrary writes to memory
89*b8017177SDaniel Thompson	    0x0008 - allow current register state to be inspected
90*b8017177SDaniel Thompson	    0x0010 - allow current register state to be modified
91*b8017177SDaniel Thompson	    0x0020 - allow passive inspection (backtrace, process list, lsmod)
92*b8017177SDaniel Thompson	    0x0040 - allow flow control management (breakpoint, single step)
93*b8017177SDaniel Thompson	    0x0080 - enable signalling of processes
94*b8017177SDaniel Thompson	    0x0100 - allow machine to be rebooted
95*b8017177SDaniel Thompson
96*b8017177SDaniel Thompson	  The config option merely sets the default at boot time. Both
97*b8017177SDaniel Thompson	  issuing 'echo X > /sys/module/kdb/parameters/cmd_enable' or
98*b8017177SDaniel Thompson          setting with kdb.cmd_enable=X kernel command line option will
99*b8017177SDaniel Thompson	  override the default settings.
100*b8017177SDaniel Thompson
101ada64e4cSJason Wesselconfig KDB_KEYBOARD
102ada64e4cSJason Wessel	bool "KGDB_KDB: keyboard as input device"
103ada64e4cSJason Wessel	depends on VT && KGDB_KDB
104ada64e4cSJason Wessel	default n
105ada64e4cSJason Wessel	help
106ada64e4cSJason Wessel	  KDB can use a PS/2 type keyboard for an input device
107ada64e4cSJason Wessel
1083b0eb71eSRobert Obermeierconfig KDB_CONTINUE_CATASTROPHIC
1093b0eb71eSRobert Obermeier	int "KDB: continue after catastrophic errors"
1103b0eb71eSRobert Obermeier	depends on KGDB_KDB
1113b0eb71eSRobert Obermeier	default "0"
1123b0eb71eSRobert Obermeier	help
1133b0eb71eSRobert Obermeier	  This integer controls the behaviour of kdb when the kernel gets a
1143b0eb71eSRobert Obermeier	  catastrophic error, i.e. for a panic or oops.
1153b0eb71eSRobert Obermeier	  When KDB is active and a catastrophic error occurs, nothing extra
1163b0eb71eSRobert Obermeier	  will happen until you type 'go'.
1173b0eb71eSRobert Obermeier	  CONFIG_KDB_CONTINUE_CATASTROPHIC == 0 (default). The first time
1183b0eb71eSRobert Obermeier	  you type 'go', you will be warned by kdb. The secend time you type
1193b0eb71eSRobert Obermeier	  'go', KDB tries to continue. No guarantees that the
1203b0eb71eSRobert Obermeier	  kernel is still usable in this situation.
1213b0eb71eSRobert Obermeier	  CONFIG_KDB_CONTINUE_CATASTROPHIC == 1. KDB tries to continue.
1223b0eb71eSRobert Obermeier	  No guarantees that the kernel is still usable in this situation.
1233b0eb71eSRobert Obermeier	  CONFIG_KDB_CONTINUE_CATASTROPHIC == 2. KDB forces a reboot.
1243b0eb71eSRobert Obermeier	  If you are not sure, say 0.
1253b0eb71eSRobert Obermeier
126e024cbd2SJan Engelhardtendif # KGDB
127