I'm running QEMU 8.1.0-rc1, but this problem has been around for at least a couple of years. Using MacsBug 6.6.3, there is a problem when stepping through PPC code. Note that 68k code does not have this bug. Whenever a branch is reached, MacsBug will jump to the address after the intended branch address. For example, if there is a BNE to 13370000, MacsBug will instead jump to 13370004. This happens whether or not the branch is taken, meaning that the result of any branch condition will cause MacsBug to always break on the following address. This also happens under a clean install of Mac OS 9.1 as well as a clean install of Mac OS 9.2.2. This does not happen, however, on a baremetal machine in Classic mode (also 9.2.2 with MacsBug 6.6.3). This also does not happen on baremetal OS 9 machines.
There is also an additional bug that happens when tracing (stepping over) a branch and link (BL) to a subroutine. On
some routines, tracing over will resume execution of the program instead of breaking on the following instruction. This does not usually happen if a NOP instruction follows the BL, but I cannot be certain. I was unable to reproduce this on baremetal, so I suspect it might be related to the bug above.
My QEMU settings are:
Code: Select all
-cpu "g4" ^
-M mac99,via=pmu -m 512^
-device usb-kbd
This also happens with bare settings like:
Is it possible that QEMU is the source of this bug? Perhaps something related to prefetching?