Kconfig.kgdb 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. config HAVE_ARCH_KGDB
  3. bool
  4. # set if architecture has the its kgdb_arch_handle_qxfer_pkt
  5. # function to enable gdb stub to address XML packet sent from GDB.
  6. config HAVE_ARCH_KGDB_QXFER_PKT
  7. bool
  8. menuconfig KGDB
  9. bool "KGDB: kernel debugger"
  10. depends on HAVE_ARCH_KGDB
  11. depends on DEBUG_KERNEL
  12. help
  13. If you say Y here, it will be possible to remotely debug the
  14. kernel using gdb. It is recommended but not required, that
  15. you also turn on the kernel config option
  16. CONFIG_FRAME_POINTER to aid in producing more reliable stack
  17. backtraces in the external debugger. Documentation of
  18. kernel debugger is available at http://kgdb.sourceforge.net
  19. as well as in Documentation/dev-tools/kgdb.rst. If
  20. unsure, say N.
  21. if KGDB
  22. config KGDB_HONOUR_BLOCKLIST
  23. bool "KGDB: use kprobe blocklist to prohibit unsafe breakpoints"
  24. depends on HAVE_KPROBES
  25. depends on MODULES
  26. select KPROBES
  27. default y
  28. help
  29. If set to Y the debug core will use the kprobe blocklist to
  30. identify symbols where it is unsafe to set breakpoints.
  31. In particular this disallows instrumentation of functions
  32. called during debug trap handling and thus makes it very
  33. difficult to inadvertently provoke recursive trap handling.
  34. If unsure, say Y.
  35. config KGDB_SERIAL_CONSOLE
  36. tristate "KGDB: use kgdb over the serial console"
  37. select CONSOLE_POLL
  38. select MAGIC_SYSRQ
  39. depends on TTY && HW_CONSOLE
  40. default y
  41. help
  42. Share a serial console with kgdb. Sysrq-g must be used
  43. to break in initially.
  44. config KGDB_TESTS
  45. bool "KGDB: internal test suite"
  46. default n
  47. help
  48. This is a kgdb I/O module specifically designed to test
  49. kgdb's internal functions. This kgdb I/O module is
  50. intended to for the development of new kgdb stubs
  51. as well as regression testing the kgdb internals.
  52. See the drivers/misc/kgdbts.c for the details about
  53. the tests. The most basic of this I/O module is to boot
  54. a kernel boot arguments "kgdbwait kgdbts=V1F100"
  55. config KGDB_TESTS_ON_BOOT
  56. bool "KGDB: Run tests on boot"
  57. depends on KGDB_TESTS
  58. default n
  59. help
  60. Run the kgdb tests on boot up automatically without the need
  61. to pass in a kernel parameter
  62. config KGDB_TESTS_BOOT_STRING
  63. string "KGDB: which internal kgdb tests to run"
  64. depends on KGDB_TESTS_ON_BOOT
  65. default "V1F100"
  66. help
  67. This is the command string to send the kgdb test suite on
  68. boot. See the drivers/misc/kgdbts.c for detailed
  69. information about other strings you could use beyond the
  70. default of V1F100.
  71. config KGDB_LOW_LEVEL_TRAP
  72. bool "KGDB: Allow debugging with traps in notifiers"
  73. depends on X86 || MIPS
  74. default n
  75. help
  76. This will add an extra call back to kgdb for the breakpoint
  77. exception handler which will allow kgdb to step through a
  78. notify handler.
  79. config KGDB_KDB
  80. bool "KGDB_KDB: include kdb frontend for kgdb"
  81. default n
  82. help
  83. KDB frontend for kernel
  84. config KDB_DEFAULT_ENABLE
  85. hex "KDB: Select kdb command functions to be enabled by default"
  86. depends on KGDB_KDB
  87. default 0x1
  88. help
  89. Specifiers which kdb commands are enabled by default. This may
  90. be set to 1 or 0 to enable all commands or disable almost all
  91. commands.
  92. Alternatively the following bitmask applies:
  93. 0x0002 - allow arbitrary reads from memory and symbol lookup
  94. 0x0004 - allow arbitrary writes to memory
  95. 0x0008 - allow current register state to be inspected
  96. 0x0010 - allow current register state to be modified
  97. 0x0020 - allow passive inspection (backtrace, process list, lsmod)
  98. 0x0040 - allow flow control management (breakpoint, single step)
  99. 0x0080 - enable signalling of processes
  100. 0x0100 - allow machine to be rebooted
  101. The config option merely sets the default at boot time. Both
  102. issuing 'echo X > /sys/module/kdb/parameters/cmd_enable' or
  103. setting with kdb.cmd_enable=X kernel command line option will
  104. override the default settings.
  105. config KDB_KEYBOARD
  106. bool "KGDB_KDB: keyboard as input device"
  107. depends on VT && KGDB_KDB
  108. default n
  109. help
  110. KDB can use a PS/2 type keyboard for an input device
  111. config KDB_CONTINUE_CATASTROPHIC
  112. int "KDB: continue after catastrophic errors"
  113. depends on KGDB_KDB
  114. default "0"
  115. help
  116. This integer controls the behaviour of kdb when the kernel gets a
  117. catastrophic error, i.e. for a panic or oops.
  118. When KDB is active and a catastrophic error occurs, nothing extra
  119. will happen until you type 'go'.
  120. CONFIG_KDB_CONTINUE_CATASTROPHIC == 0 (default). The first time
  121. you type 'go', you will be warned by kdb. The secend time you type
  122. 'go', KDB tries to continue. No guarantees that the
  123. kernel is still usable in this situation.
  124. CONFIG_KDB_CONTINUE_CATASTROPHIC == 1. KDB tries to continue.
  125. No guarantees that the kernel is still usable in this situation.
  126. CONFIG_KDB_CONTINUE_CATASTROPHIC == 2. KDB forces a reboot.
  127. If you are not sure, say 0.
  128. config ARCH_HAS_EARLY_DEBUG
  129. bool
  130. default n
  131. help
  132. If an architecture can definitely handle entering the debugger
  133. when early_param's are parsed then it select this config.
  134. Otherwise, if "kgdbwait" is passed on the kernel command line it
  135. won't actually be processed until dbg_late_init() just after the
  136. call to kgdb_arch_late() is made.
  137. NOTE: Even if this isn't selected by an architecture we will
  138. still try to register kgdb to handle breakpoints and crashes
  139. when early_param's are parsed, we just won't act on the
  140. "kgdbwait" parameter until dbg_late_init(). If you get a
  141. crash and try to drop into kgdb somewhere between these two
  142. places you might or might not end up being able to use kgdb
  143. depending on exactly how far along the architecture has initted.
  144. endif # KGDB