Overview:
- Factored out a lot of commonality between AddrCheck and MemCheck. Basic
idea is that common code goes into a single file in MemCheck, and AddrCheck
peeks in and "borrows" it.
More or less, only identical code or identical-with-respect-to-subtypes
code was factored out.
Identical-with-respect-to-subtypes means that some enum types (SuppKind,
ErrorKind, etc) were merged because they were identical except that
MemCheck had some extra constants. So some of the code borrowed by
AddrCheck contains cases it never needs. But that's not so bad, avoiding
the duplication is IMHO more important.
Removed:
- ac_include.h, it wasn't necessary
- All the old debugging stuff from ac_main.c (printing shadow regs, not
applicable for AddrCheck).
- MANUAL_DEPS from memcheck/Makefile.am because it wasn't doing anything
- Some unnecessary crud from addrcheck/Makefile.am
Added:
- memcheck/mc_common.{c,h}
- memcheck/mc_constants.h
- addrcheck/ac_common.c, which simply #includes memcheck/mc_common.c. This
hack was required because there is no way (that I could work out) to tell
Automake that it should build ../memcheck/mc_common.o before building
AddrCheck.
Changed:
- a lot of prefixes from SK_ to MC_; only core/skin interface functions are
prefixed with SK_ now. This makes it clear which functions are from the
core/skin interface, and for AddrCheck it's clear which functions are
shared with/borrowed from MemCheck. Changed some related prefixes for
consistency.
- Also factored out some duplication within AddrCheck -- some accessibility
checking was needlessly split up into separate read and write checks that
did the same thing.
Unchanged:
- I considered moving the leak detector out of core into mc_common.c, but
didn't, because it constantly accesses ShadowChunk fields and converting to
get/set methods would have been a total pain.
- Left old debugging stuff in for MemCheck, although I seriously doubt it
would still work.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1325 a5019735-40e9-0310-863c-91ae7b9d1cf9
15 files changed