Trying to use DDB on powerpc64, I found that it throws a 0x400 exception. OK boot -d Booting... Kernel entry at 0x102620 ... KDB: debugger backends: ddb KDB: current backend: ddb KDB: enter: Boot flags requested debugger [ thread pid 0 tid 0 ] Stopped at .kdb_enter+0x60: ld r2, r1, 0x28 db> break platform_smp_start_cpu db> continue fatal kernel trap: exception = 0x400 (instruction storage interrupt) virtual address = 0x426f6f7420666c60 srr0 = 0x426f6f7420666c60 (0x426f6f7420666c60) srr1 = 0x8000000040001032 lr = 0x426f6f7420666c61 (0x426f6f7420666c61) curthread = 0x114a100 pid = 0, comm = [ thread pid 0 tid 0 ] Stopped at 0x426f6f7420666c60
0x426f6f7420666c60 Looks like a string: "Boot fl`" I don't think anyone in powerpc-land has tried breakpoints in DDB recently.
This issue already has a solution: https://reviews.freebsd.org/D14484, but need to be tested in a 32bit machine. If someone has access to a 32bit machine, please, could test it?
(In reply to Leonardo Bianconi from comment #2) At least on old PowerMac G5's, 32-bit powerpc FreeBSD can boot and run the 64-bit capable G5's. So some of the testing might be able to be done that way?
I was able to verify this fix on my (32-bit) iBook G4. (Built without vt so the keyboard would work in early ddb) Looks good here.
A commit references this bug: Author: luporl Date: Mon Feb 4 16:02:04 UTC 2019 New revision: 343744 URL: https://svnweb.freebsd.org/changeset/base/343744 Log: powerpc64: Add a trap stack area Currently, the trap code switches to the the temporary stack in the dbtrap section. It works in most cases, but in the beginning of the execution, the temp stack is being used, as starting in the powerpc_init() code. In this current scenario, the stack is being overwritten, which causes the return of breakpoint() to take abnormal execution. This current patchset create a small stack to use by the dbtrap: codepath avoiding the corruption of the temporary stack. PR: 224872 Submitted by: breno.leitao_gmail.com Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D14484 Changes: head/sys/powerpc/aim/locore32.S head/sys/powerpc/aim/locore64.S head/sys/powerpc/aim/trap_subr32.S head/sys/powerpc/aim/trap_subr64.S
A commit references this bug: Author: luporl Date: Wed Jun 5 14:19:55 UTC 2019 New revision: 348690 URL: https://svnweb.freebsd.org/changeset/base/348690 Log: MFC r343744: powerpc64: Add a trap stack area Currently, the trap code switches to the the temporary stack in the dbtrap section. It works in most cases, but in the beginning of the execution, the temp stack is being used, as starting in the powerpc_init() code. In this current scenario, the stack is being overwritten, which causes the return of breakpoint() to take abnormal execution. This current patchset create a small stack to use by the dbtrap: codepath avoiding the corruption of the temporary stack. PR: 224872 Submitted by: breno.leitao_gmail.com Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D14484 Changes: _U stable/12/ stable/12/sys/powerpc/aim/locore32.S stable/12/sys/powerpc/aim/locore64.S stable/12/sys/powerpc/aim/trap_subr32.S stable/12/sys/powerpc/aim/trap_subr64.S
From the comments it looks like this has been fixed. Please reopen if I'm wrong.