top | item 23303419

(no title)

mambodog | 5 years ago

The author mentions that they didn't have a debugger and couldn't get MacsBug to work inside the emulator. A useful technique here is to use the emulator itself as the debugger: most emulators have features for setting breakpoints and single stepping through emulation and directly reading memory values from the emulated system's memory (by absolute memory address). For example, here is the documentation for 'hardware'-level debugging in the PCE emulator: https://github.com/jsdf/pce/blob/pcejs/doc/monitor.txt

One 'nice' thing about working with old architectures like classic Macintosh is that there is basically no abstraction between the software and the hardware, so manipulating the behavior of the emulated hardware becomes a powerful debugging tool.

discuss

order

saagarjha|5 years ago

MacsBug has a number of interesting features that are a bit above what you'd normally want from a CPU-level emulator, like setting breakpoints and being able to use debugging information. (Funnily enough, I'm taking a quick Hacker News break from implementing ptrace support in a CPU-level emulator, in part because trying to debug code without it means I need to keep Ghidra open and single-step code execution from the closest system call…)

duskwuff|5 years ago

MacsBug also had a ton of MacOS-specific features, like transparent integration with the 68k emulator, the ability to display symbols for both application code and the system ROM, and a wide variety of tools for interacting with the Memory Manager and Resource Manager (including intrusive operations like compacting or purging memory).

It also had mouse support -- you could click any address on screen to view its contents and information about the memory region it was in, for instance -- and a menubar. :)

Macsbug won't run in the SheepShaver emulator, as it takes a number of shortcuts which are incompatible with MacsBug. It works fine under qemu-system-ppc, though!

monocasa|5 years ago

It's also not difficult to add them. Even in rtl style emulators like cen64, you just tap what's going on at the last pipeline stage or the ex stage, whichever is more convenient.