Re: [patch 7/8] KGDB support for x86_64

From: Andi Kleen
Date: Fri Oct 29 2004 - 18:28:38 EST


On Fri, Oct 29, 2004 at 11:34:21AM -0700, Tom Rini wrote:
>
> Cc: Andi Kleen <ak@xxxxxxx>
> This adds KGDB support for x86_64.

Can you please explain what the additional hooks are good for?


> +++ linux-2.6.10-rc1-trini/arch/x86_64/kernel/Makefile 2004-10-29 11:26:45.757144605 -0700
> @@ -10,6 +10,8 @@ obj-y := process.o semaphore.o signal.o
> setup64.o bootflag.o e820.o reboot.o warmreboot.o
> obj-y += mce.o
>
> +CFLAGS_vsyscall.o := -g0
> +

What's this?


> +#include <linux/kgdb.h>
> #include <asm/uaccess.h>
> #include <asm/io_apic.h>
>
> @@ -103,6 +104,13 @@ asmlinkage unsigned int do_IRQ(struct pt
> __do_IRQ(irq, regs);
> irq_exit();
>
> + /*
> + * Do not call breakpoint as on the x86_64 architecture if the
> + * exception tables are not set.
> + */
> + if(CHECK_EXCEPTION_STACK())
> + kgdb_process_breakpoint();
> +

And that? Why do you need to check breakpoints in interrupts?

> #include <linux/moduleparam.h>
> +#include <linux/debugger.h>
>
> #include <asm/system.h>
> #include <asm/uaccess.h>
> @@ -642,7 +643,7 @@ asmlinkage void *do_debug(struct pt_regs
> tsk->thread.debugreg6 = condition;
>
> /* Mask out spurious TF errors due to lazy TF clearing */
> - if (condition & DR_STEP) {
> + if (condition & DR_STEP && !debugger_step) {

This also looks bogus. What is this exactly for and why is it not
handled through the debug chain?


-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/