Improved Memcheck's error checking messages in two significant ways:

- All memory-related errors are now clear whether they are caused by
  unaddressable or uninitialised memory.  (Previously, writes were
  clearly addressability errors, but reads could be either.)  Mostly
  done by replacing the 'isWrite' field in MAC_Error with 'isUnaddr'.
  Also, mc_check_readable() now indicates not just if an error occurred,
  but what kind of error (ie. addressability or definedness).

- Put machinery into place in the core to inform tools when registers
  are being read by the core -- ie. a 'pre_reg_read' event.  Most
  notably, this facilitates syscall scalar arg definedness checking for
  Memcheck.  Currently this is only working for read(), write(), exit()
  and exit_group(), but it will be extended as the syscalls are
  overhauled as part of the arch-abstraction work.

  A consequence of this is that the ParamErr messages have changed.  This:

    Syscall param write(buf) contains uninitialised byte(s)

  now means that the pointer 'buf' is partially undefined.  If the memory
  pointed to by 'buf' is partially undefined or unaddressable, it says one of:

    Syscall param write(buf) points to uninitialised byte(s)
    Syscall param write(buf) points to unaddressable byte(s)

  The docs have been updated accordingly.

  I also added a couple of regression tests.

These two change sare notable for being the first improvements to
Memcheck's checking/errors in a long time.

I also folded mc_clientreqs.c into mc_main.c, which saves exporting a
whole bunch of things that are not used anywhere else.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2949 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/addrcheck/ac_main.c b/addrcheck/ac_main.c
index 117675c..ea90b0a 100644
--- a/addrcheck/ac_main.c
+++ b/addrcheck/ac_main.c
@@ -545,14 +545,15 @@
    if (!ok) {
       switch (part) {
       case Vg_CoreSysCall:
-         MAC_(record_param_error) ( tid, bad_addr, isWrite, s );
+         MAC_(record_param_error) ( tid, bad_addr, /*isReg*/False,
+                                    /*isUnaddr*/True, s );
          break;
 
       case Vg_CoreSignal:
          sk_assert(isWrite);     /* Should only happen with isWrite case */
          /* fall through */
       case Vg_CorePThread:
-         MAC_(record_core_mem_error)( tid, isWrite, s );
+         MAC_(record_core_mem_error)( tid, /*isUnaddr*/True, s );
          break;
 
       /* If we're being asked to jump to a silly address, record an error 
@@ -590,14 +591,14 @@
 {
    Bool ok = True;
    Addr bad_addr;
-   /* VG_(message)(Vg_DebugMsg,"check is readable asciiz: 0x%x",str); */
 
    VGP_PUSHCC(VgpCheckMem);
 
    sk_assert(part == Vg_CoreSysCall);
    ok = ac_check_readable_asciiz ( (Addr)str, &bad_addr );
    if (!ok) {
-      MAC_(record_param_error) ( tid, bad_addr, /*is_writable =*/False, s );
+      MAC_(record_param_error) ( tid, bad_addr, /*IsReg*/False,
+                                 /*IsUnaddr*/True, s );
    }
 
    VGP_POPCC(VgpCheckMem);