How to trap unaligned accesses on Ultrix/MIPS?

Matt Thomas thomas at mipsbx.lkg.dec.com
Wed Feb 27 05:44:31 AEST 1991


In article <1991Feb25.221137.8462 at jarvis.csri.toronto.edu> cks at hawkwind.utcs.toronto.edu (Chris Siebenmann) writes:
>
> Unfortunately, Ultrix currently (as far as I'm aware) provides no
>support for making your programs always dump core when they do
>unaligned references that the kernel has to fix up. Personally, I think
>this is a gaping misfeature, and I wish DEC had fixed their kernel and
>uac to support this several releases ago (maybe then vendors would stop
>fixing third party software that fills up our error logs with "Fixing
>up unaligned references" messages).

#include <sys/syscall.h>
#include <sys/sysmips.h>
#include <stdio.h>

    syscall(SYS_sysmips, MIPS_FIXADE, 0, NULL, NULL, NULL);

Starting in ULTRIX V4.2, adding above line to your program will causes it
core dump (via a bus error) when an unaligned access is trapped.  Replacing
the 0 by a 1 will reenable fixups.
-- 
Matt Thomas                     Internet:   thomas at wrl.dec.com
DECnet-ULTRIX Development       UUCP:       ...!decwrl!thomas
Digital Equipment Corporation   Disclaimer: This message reflects my own
Littleton, MA                               warped views, etc.



More information about the Comp.unix.ultrix mailing list