Subject: MIPS stack traceback broken with UVM
To: None <port-mips@NetBSD.ORG>
From: Michael L. Hitch <mhitch@lightning.oscs.montana.edu>
List: port-mips
Date: 05/24/1998 22:40:45
  While trying to get more information on why my pmax UVM kernel,
I got wierd stack tracebacks.  I found that several UVM routines
allocate a local array using [MAXBSIZE/PAGE_SIZE].  Since PAGE_SIZE
is actually umvexp.page_size, gcc generates code to perform the
division upone entry to the procedure.  The MIPS has no hardware
detection of division by zero, so gcc generates an in-line check.
That check involves some conditional branches, which confuse the
stack traceback code that tries to compute the stackframe size.
[The conditional branch terminates the search for the stack pointer
adjustment instruction.]  Also, since the array size is variable,
the stack frame size has to be computed at run-time which also
confuses the stack traceback code.

  I've gotten around this problem by making PAGE_SIZE a constant,
so I can now get a good stack traceback.

Michael

-- 
Michael L. Hitch			mhitch@montana.edu
Computer Consultant
Information Technology Center
Montana State University	Bozeman, MT	USA