Skip to content

PPC: not honouring single stepping through branches and skips a nip

Host environment

  • Operating system: Windows 10 21H2
  • Architecture: x86
  • QEMU flavor: qemu-system-ppc
  • QEMU version: 8.1.0-rc1
  • QEMU command line:
    qemu-system-ppc -cpu "g4" ^
     -M mac99,via=pmu -m 512^
     -hda macos922.img^
     -device usb-kbd ^
     -boot c ^
     -netdev user,id=mynet0 ^
     -device sungem,netdev=mynet0 ^
     -monitor stdio

Emulated/Virtualized environment

  • Operating system: Mac OS 9.2.2
  • Architecture: PowerPC

Description of problem

When debugging in MacsBug, tracing/stepping over any branches (e.g. blt, bgt) will land on the instruction immediately passed the expected address. It appears that branches will execute the target instruction then single step to the next instruction in one go, instead of single stepping to the target instruction.

For example, if a blt should land on 13371234, stepping over the branch will land on 13371238. The instruction at 13371234 still executes, but this is not the behaviour on a baremetal Mac OS system.

Additional information

A screenshot before the branch. A screenshot after pressing 't' to step over the branch. Note that the PC is now 1E36CAB8 instead of the expected 1E36CAB4.

Edited by Siddhartha
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information