Ton, George, Amit, et. al:

If CONFIG_KGDB isn't defined, the kernel should be exactly the
same as when kgdb isn't integrated. So shouldn't we should add 
#ifdef CONFIG_KGDB in the traps.c code where the traps are 
initialized and panic notify is registered. 

For example in our dusty 2.6.12 Kernel:
-------------------------------------------------------------------------
void die_nmi (struct pt_regs *regs, const char *msg)
{
#ifdef CONFIG_KGDB
    notify_die(DIE_NMIWATCHDOG, "nmi watchdog", regs, 0, 2, SIGPWR);
#endif
.
.
.
    /* Disable additional traps. They'll be re-enabled when
     * the signal is delivered.
     */
clear_dr7:
    __asm__("movl %0,%%db7"
        :       /* no output */
        : "r" (0)); /* set_debugreg(0, 7); */

#ifdef CONFIG_KGDB
    notify_die(DIE_DEBUG, "debug2", regs, condition, error_code,
SIGTRAP);
#endif
    return;
.
.
.

#ifdef CONFIG_KGDB
/* 
 * Some traps need to be set early. 
 * Traps {1, 3, 14} moved from trap_init below.
 */
void __init early_trap_init(void) {
    set_intr_gate(1,&debug);
    set_system_intr_gate(3, &int3); /* int3 can be called from all */
    set_intr_gate(14,&page_fault);
}
#endif
.
.
.
#ifndef CONFIG_KGDB
    set_intr_gate(1,&debug);
#endif
    set_intr_gate(2,&nmi);
#ifndef CONFIG_KGDB
    set_system_intr_gate(3, &int3); /* int3-5 can be called from all */
#endif
    set_system_gate(4,&overflow);
    set_system_gate(5,&bounds);
    set_trap_gate(6,&invalid_op);
    set_trap_gate(7,&device_not_available);
    set_task_gate(8,GDT_ENTRY_DOUBLEFAULT_TSS);
    set_trap_gate(9,&coprocessor_segment_overrun);
    set_trap_gate(10,&invalid_TSS);
    set_trap_gate(11,&segment_not_present);
    set_trap_gate(12,&stack_segment);
    set_trap_gate(13,&general_protection);
#ifndef  CONFIG_KGDB
    set_intr_gate(14,&page_fault);
#endif
--------------------------------------------------------------------------
And early_trap_init() should only be called if KGDB is configured.

Integration of kgdb into production kernels is more easily
accepted if the code has no effect when not configured; at
least here I think it might. I would think the same might apply with
the kernel.org kernel. As I recall George's patch complied with
this concept. 

-piet


 
-- 
Piet Delaney                                    Phone: (408) 200-5256
Blue Lane Technologies                          Fax:   (408) 200-5299
10450 Bubb Rd.
Cupertino, Ca. 95014                            Email: [EMAIL PROTECTED]

Attachment: signature.asc
Description: This is a digitally signed message part

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Kgdb-bugreport mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport

Reply via email to