home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ug!daniel
- Newsgroups: comp.unix.programmer
- Subject: Re: need help with UNIX/SPARC/ptrace() single stepping...
- Message-ID: <1993Jan28.003904.2840@ug.eds.com>
- From: daniel@ug.eds.com (Daniel Dignam)
- Date: 28 Jan 93 00:39:03 PDT
- References: <C1J6FL.4no@unccsun.uncc.edu>
- Nntp-Posting-Host: 134.244.153.166
- X-Newsreader: TIN [version 1.1 PL6]
- Lines: 26
-
- I hacked up something that did something simlar to this once. It provided a way
- of checking tah all writes and reads where to valid memory addresses. I took a
- different approach.
-
- Basically, you replace malloc with rou own written on top of memory mapping.
- Then write protect the pages. Then every time a write is made you get an access
- violation. Trap this, look at the data your given, the faulting address will be
- one of these. Once you've logged the reference, return from you signal handler to
- restart the faulting instruction.
-
- This seemed to work fine, it was however very slow in our application, so as a
- form of total paranoia it wasn't very useful. But it was an interesting hack.
-
- You should be able to read protect pages as well, so this should cover all
- references to allocated memory. It doesn't however cover references to stack,
- or program data. Although the later could be done in a similar manner to
- allocated memory.
-
- --
-
- Daniel Dignam
-
- Internet: daniel@sdl.ug.eds.com
- UUCP: {uunet,uupsi}!ug!daniel
-
-
-