cebix / macemu

Basilisk II and SheepShaver Macintosh emulators
1.4k stars 291 forks source link

[Proposal] Run cxmon at will with Basilisk II suspended #126

Closed rickyzhang82 closed 7 years ago

rickyzhang82 commented 7 years ago

Goal

Suspend Basilisk II at will in guest OS and trigger to run cxmon.

Idea

Create a new illegal instruction exception: use MOVEC instruction to trap into cxmon in host OS. In Macintosh guest OS, craft a program to execute MOVEC instruction.

Once in cxmon, create a step instruction to step through guest OS M68k instruction.

I want to implement new feature above but I want to confirm if someone or somewhere had done this in Basilisk II. If so, I won't reinvent the wheel.

rickyzhang82 commented 7 years ago

I investigated BII ROM patch and found that it used unimplemented M68k instruction 0x71xx to extend M68k instruction set.

It does has a break point EMUL_OP. But it just stop and exits. I will prefer to implement the following story:

  1. Enter cxmon at will by running a program in Macintosh guest OS.
  2. Add a set of break points at any specific address.
  3. Exit from cxmon and resume emulated CPU execution.
  4. If emulated CPU PC reaches break point, stop emulated CPU and enter into cxmon.

The current cxmon is quite limited for debugging segfault problem.