"qemu-ppc -g 1234 foo" emulating the 32-bit PowerPC instruction 0x7c800008 ("tweq r0,r0") terminates with "fatal: Tried to call a TRAP". Instead, when co-operating with gdbserver (-g <port>) then qemu-ppc should generate a SIGTRAP, just like real execution under gdb.
The "tweq r0,r0" and others are useful as compiled-in breakpoints, particularly when the location is within just-in-time compiled code. They also can be used without gdb (in which case execution aborts if the trap is true), and even with gdb if the condition is false then they are thousands of times faster than a gdb breakpoint that has a conditional stop. -- John