Re: [Kgdb-bugreport] Integration with kernel.org repository - shouldn't code in traps.c be #ifdef C
Status: Beta
Brought to you by:
jwessel
From: Piet D. <pi...@bl...> - 2006-10-06 01:30:50
|
On Thu, 2006-10-05 at 17:04 -0700, George Anzinger wrote:=20 > Piet Delaney wrote: > > On Thu, 2006-10-05 at 12:17 -0700, Tom Rini wrote: > >=20 > ~ >=20 > > -----------------------------------------------------------------------= ----- > >=20 > > I didn't find the "static init of the trap notify";=20 > > George: where is that? >=20 > Have a look here: > http://source.mvista.com/~ganzinger/ I was looking at your 2.4, 2.6.12, and now this 2.6.14-rc1 patch and was looking for how you got kgdb to allow setting breakpoints as early as the the "FIRST LINE of C CODE". Looks like our current kgdb code calls early_trap_init() quite late in the boot process: start_kernel_proc() { start_kernel() { setup_arch() { early_trap_init() } } } My guess is that your saying that a developer can add a call to breakpoint() in say start_kernel() and it will set up the trap table via the calls to set_intr_*: 123 void breakpoint(void) 124 { 125 set_intr_usr_gate(3,&int3); /* disable ints on trap */ 126 set_intr_gate(1,&debug); 127 set_intr_gate(14,&page_fault); 128 129 BREAKPOINT; 130 } There's no way to breakpoint the early code without this addition. I suppose some arch can't handle traps so early and this is the reason early_trap_init() is called from setup_arch(). There are plenty of other CONFIG #ifdef's in setup_arch(): #ifdef CONFIG_BLK_DEV_RAM #ifdef CONFIG_ACPI_BOOT #ifdef CONFIG_ACPI_NUMA #ifdef CONFIG_DISCONTIGMEM #ifdef CONFIG_SMP=20 #ifdef CONFIG_ACPI_SLEEP #ifdef CONFIG_X86_LOCAL_APIC #ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_ACPI_BOOT #ifdef CONFIG_GART_IOMMU #ifdef CONFIG_VT It appears much more consistent to do the same for the=20 call to early_trap_init(). Having a few #ifdef's in trap.c like we had in the earlier 2.6.*-mm patches is/was totally reasonable. -piet --=20 Piet Delaney Phone: (408) 200-5256 Blue Lane Technologies Fax: (408) 200-5299 10450 Bubb Rd. Cupertino, Ca. 95014 Email: pi...@bl... |