> Andi Kleen <andi@firstfloor.org> writes:> > > [...] The kgdb code in git-x86#mm is right now is totally broken of> > course because the CFI annotations in assembler code are gone now,> > but they are needed for gdb use. [...]> > This loss of CFI data is unfortunate for other potential consumers > too, such as systemtap, which intends to supplement its current stack > backtracing heuristics with CFI data.

yes, but we removed those patches meanwhile because Roland McGrath has agreed to clean up the CFI mess. (Thanks Roland! We were very close to nuking them altogether because the unreadability they introduced was causing real bugs.)

[ btw., Andi's characterisation of it being "totally broken" is incorrect and alarmist. It only means that the "backtrace" command will not work in kgdb in certain types of contexts (only the current function is displayed, not the parent function(s)), but there's no "breakage", just less information available to the debugger. ]

in any case, while there are still holes in the frame annotations and it all needs a good bit of cleanup, that is a largely separate issue from whether kgdb is merge-worthy or not.

I'd like to thank Andi for his kgdb review efforts and comments. Unfortunately they were not done against kgdb-light which is being offered for upstream merge, but against an older version of kgdb. (Sorry about the 12 hour delay in my reply - Andi's mail did not have any of the kgdb or x86 persons Cc:-ed so it was not immediately noticed on a busy Monday, only in the lower-prio lkml scans.)

after a quick glance i'm happy to conclude that all but one of Andi's review comments were already addressed in kgdb-light -v7 AFAICS, and the only one not addressed (emergency_resync()) is now addressed in -v8.

In any case, if there are any open issues we are very much ready and willing to address them now or after any potential upstream merge of this codebase. This has meanwhile become one of the best-reviewed pieces of kernel code in living memory ;-)

source "samples/Kconfig"++source "lib/Kconfig.kgdb"diff --git a/lib/Kconfig.kgdb b/lib/Kconfig.kgdbnew file mode 100644index 0000000..a739e9d--- /dev/null+++ b/lib/Kconfig.kgdb@@ -0,0 +1,40 @@++menuconfig KGDB+ bool "KGDB: kernel debugging with remote gdb"+ select FRAME_POINTER+ depends on HAVE_ARCH_KGDB+ depends on DEBUG_KERNEL && EXPERIMENTAL+ help+ If you say Y here, it will be possible to remotely debug the+ kernel using gdb. Documentation of kernel debugger is available+ at http://kgdb.sourceforge.net as well as in DocBook form+ in Documentation/DocBook/. If unsure, say N.++config HAVE_ARCH_KGDB_SHADOW_INFO+ bool++config HAVE_ARCH_KGDB+ bool++config KGDB_CONSOLE_OUTPUT+ bool "KGDB: Console messages through gdb"+ depends on KGDB+ help+ If you say Y here, console messages will appear through gdb.+ Other consoles such as tty or ttyS will continue to work as usual.+ Note that if you use this in conjunction with KGDBOE, if the+ ethernet driver runs into an error condition during use with KGDB,+ it is possible to hit an infinite recursion, causing the kernel+ to crash, and typically reboot. For this reason, it is preferable+ to use NETCONSOLE in conjunction with KGDBOE instead of+ KGDB_CONSOLE.++config KGDB_SERIAL_CONSOLE+ tristate "KGDB: use kgdb over the serial console"+ depends on KGDB+ select CONSOLE_POLL+ select MAGIC_SYSRQ+ default y+ help+ Share a serial console with kgdb. Sysrq-g must be used+ to break in initially.diff --git a/mm/Makefile b/mm/Makefileindex 9f117ba..fb9e7ac 100644--- a/mm/Makefile+++ b/mm/Makefile@@ -8,7 +8,7 @@ mmu-$(CONFIG_MMU) := fremap.o highmem.o madvise.o memory.o mincore.o \ vmalloc.o