Subject: Re: gdb on a 440GP ELDK

From: Matt Porter <[email-masked]>
Date: Fri, 22 Oct 2004 10:20:03 -0700

On Fri, Oct 22, 2004 at 10:40:33AM +0100, Mark Powell wrote:
> 
> Mark Powell wrote:
> 
> > Jon Masters wrote:
> >
> >> On Thu, 21 Oct 2004 10:10:44 +0100, Mark Powell 
> >> <[email-masked]> wrote:
> >>
> >>> The system seems to basically run fine apart from the fact that gdb
> >>> doesn't stop at any breakpoints.
> >>
> >> Even the most simple scenario doesn't work, e.g.:
> >
> I have been able to borrow an Ebony system to compare and gdb worked 
> fine on that system.
> The difference is that kernel debugging (with BDI2000 support) was 
> configured in my kernel but not in the Ebony kernel.
> I tried disabling the BDI2000 support in my kernel and gdb works again.
> 
> Seeing this in ebony_setup_arch():
> 
> #if !defined(CONFIG_BDI_SWITCH)
>     /*
>      * The Abatron BDI JTAG debugger does not tolerate others
>      * mucking with the debug registers.
>      */
>         mtspr(SPRN_DBCR0, (DBCR0_TDE | DBCR0_IDM));
> #endif
> 
> leads me to suspect that the BDI2000 support for kernel debugging stops 
> gdb working in userland.
> Does that sound likely? If so, I guess it is worth recording so that the 
> info is in the archives.

That's absolutely true. As the comment suggests, the BDI2000 insists
on full control of the DBCR0, so configuring for IDM mode will screw
it up.  Not configuring for IDM mode doesn't allow kgdb/gdb to work.
Since we are out of the early development phase, I'll update the
defconfigs to disable the BDI config option by default.

-Matt