[net.micro.mac] Macsbug bites programmer; MacNosy tells all

vishniac@wanginst.UUCP (Ephraim Vishniac) (09/04/85)

Long-time readers of this group have heard (read) me complaining about
problems involving Macsbug (and Maxbug, and all their kith and kin) and
my overweight Mac (1.5 meg).  Thanks to MacNosy, I now understand the
problem.

First, the plug.  MacNosy is a disassembler for the Mac.  I bought
it from the Programmer's Shop, in Hanover, MA, for $60 plus 5% tax plus
$3 P&H.  I imagine it's a competent disassembler, but it's definitely
oriented toward expert users, and has a long learning curve.  I have no
connection with anyone who would profit from sales of MacNosy; I'm just
an accidentally delighted customer.

Next, the problem.  My usual working configuration is a 512K system area
(low mem stuff, system heap, application heap) followed by a large
ramdisk, followed by the video ram, and misc high mem stuff.  With
Macsbug (or Maxbug) installed, the system would crash when the ramdisk
was about half-full.  Without macsbug, everything was fine, except that
I couldn't debug.

MacNosy comes with several sample "journal" files of disassemblies.  One
of these is Maxbug, by a happy coincidence.  A quick look at the output
showed that Maxbug makes some assumptions about the structure of memory:

	1. It assumes that top-of-memory-relative things can always be
	   got at with fixed high addresses and wrap-around.  For 
	   example, the screen is at 1A700 in a thin Mac, 7A700 in a 
	   fat one, and higher still in others.  If wraparound is 
	   reliable *and* only power-of-two memory sizes are used,
	   you can always hit it by using 1FA700 (the screen location
	   in a four-meg Mac).  Fortunately, Macsbug doesn't find the
	   screen this way, but it does find its internal data this 
	   way.
	2. It assumes a maximum of one meg.  Period.

Results: Macsbug will not work in any mac with more than 1 meg of memory.
It will also not work in 1 meg systems where the upper half-meg is not
recognized by the system.  More precisely, it will start to work on these
systems, but won't put its variables in the space reserved for them,
leading to conflicts with other programs.

The fix: Patch Macsbug for your real memory size.  This involves >100
patches, so a program to automatically find and apply the changes is
definitely indicated.

-- 
Ephraim Vishniac
  [apollo, bbncca, cadmus, decvax, harvard, linus, masscomp]!wanginst!vishniac
  vishniac%Wang-Inst@Csnet-Relay