kgdb for ppc64 now available

Anton Blanchard anton at
Fri Sep 30 16:32:34 EST 2005


> For those interested, kgdb now supports ppc64 SMP.  On powermac only
> an Ethernet connection is supported currently, but generic 8250 UART
> PCI cards will be supported soon.

Nice! A few comments:

+       { 0x0300, 0x0b /* SIGSEGV */ },         /* data access */
+       { 0x0400, 0x0a /* SIGBUS */  },         /* instruction access */

0x380 data segment miss is not in the list of traps.

+       return kgdb_handle_exception(0, computeSignal(regs->trap), 0, regs);

We should use TRAP(regs) instead of regs->trap since the bottom bits may
not be zero for an exception that only saves a partial register set.

@@ -2,7 +2,7 @@
 # Makefile for the linux ppc64 kernel.

-EXTRA_CFLAGS   += -mno-minimal-toc
+#EXTRA_CFLAGS  += -mno-minimal-toc
 extra-y                := head.o

 obj-y               := setup.o entry.o traps.o irq.o idle.o dma.o \

Is there a problem with compiling arch/ppc64/kernel -mno-minimal-toc?

I notice x86-64 is using the new die hooks, Im about to convert xmon
over to it and once that is done it will make sense to move kgdb and kdb

In regs_to_gdb_regs it would be nice to send out the dar, dsisr and
perhaps softe (used on iseries and will be useful once we go to soft
interrupt disable on pseries). Even though we already get the trap
number delived to gdb via the signal number, it would be useful to dump
it in the regs since the bottom bits are important (to work out if
only a partial register set has been saved). That leaves orig_gpr3 and
result as the only pt_regs not dumped.

+       /* vr registers not used by kernel, leave zero */
+       ptr += 64;

Now that we use altivec in the kernel a bit, it might make sense to dump
these registers. Not sure yet.

Index: linux-2.6.13/arch/ppc64/mm/fault.c
@@ -306,6 +307,13 @@ void bad_page_fault(struct pt_regs *regs
                regs->nip = entry->fixup;
+       if (atomic_read(&debugger_active) && kgdb_may_fault) {
+               /* Restore our previous state. */
+               kgdb_fault_longjmp(kgdb_fault_jmp_regs);
+               /* Not reached. */
+       }

We might need a new notify_die hook to cover this case.

We could use hardware data breakpoint support in kgdb.

Eventually it would be nice to be able to select debuggers at


More information about the Linuxppc64-dev mailing list