On Oct 11, 2018, at 12:57 PM, Mark Cave-Ayland mark.cave-ayland@ilande.co.uk wrote:
On 11/10/2018 12:12, Jd Lyons via OpenBIOS wrote:
I installed gdb-multiarch and started qemu with:
Qemu-system-ppc -s -S
The launched gdb-multiarch and connected to port 1234.
Is this the correct toolchain for debugging PPC code on an X86 host, or do I need to do something else?
I actually build gdb from source for the architectures I need (sparc32, sparc64 and ppc), so I can't really comment on how multi-arch works.
Can I build gdb for debugging ppc code on x86?
Any instructions on how to do that?
Or should I be using a PPC host for this?
I used Apple's PowerPC gdb.
Note that Apple have patched their gdb quite heavily, for example I couldn't even build it on Linux. On the plus side if you are able to do this, Apple's gdb is at least able to read symbols from Mach binaries.
My host system is X86, I was thinking Mark, or someone here once outlined a way to debug Openbios by installing some sort of powerpc debug tools on X86?
Ok, breakpoint not working with gdb-multiarch:
(gdb)target remote localhost:1234 (gdb)break CalcRAMSize (gdb)continue
It just boots the Mac OS and only waits before continue.
I'm sure I'm doing something wrong here, maybe I need some PPC Libs installed, my host is X86?
I normally allow gdb to detect correct arch before attaching to the remote with "target remote ..." by passing a relevant ELF file to gdb e.g.
power-linux-gdb openbios-ppc
Note that symbols such as CalcRAMSize are generally only visible in the guest, so you'll either need to take the executable from the guest and generate a gdb symbol file for it, or otherwise use breakpoints for routines based upon their address e.g.
break *0x12345678
ATB,
Mark.
-- OpenBIOS http://openbios.org/ Mailinglist: http://lists.openbios.org/mailman/listinfo Free your System - May the Forth be with you