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/memcheck/mc_include.h b/memcheck/mc_include.h
index 9d97925..01fbbfe 100644
--- a/memcheck/mc_include.h
+++ b/memcheck/mc_include.h
@@ -119,7 +119,6 @@
 extern void MC_(helper_value_check1_fail) ( void );
 extern void MC_(helper_value_check0_fail) ( void );
 
-
 /* Functions defined in mc_main.c */
 extern REGPARM(2) void MC_(helperc_STOREV4) ( Addr, UInt );
 extern REGPARM(2) void MC_(helperc_STOREV2) ( Addr, UInt );
@@ -132,38 +131,15 @@
 extern REGPARM(2) void MC_(fpu_write_check) ( Addr addr, SizeT size );
 extern REGPARM(2) void MC_(fpu_read_check)  ( Addr addr, SizeT size );
 
-
-/* For client requests */
-extern void MC_(make_noaccess) ( Addr a, SizeT len );
-extern void MC_(make_readable) ( Addr a, SizeT len );
-extern void MC_(make_writable) ( Addr a, SizeT len );
-
-extern Bool MC_(check_writable) ( Addr a, SizeT len, Addr* bad_addr );
-extern Bool MC_(check_readable) ( Addr a, SizeT len, Addr* bad_addr );
-
-extern void MC_(detect_memory_leaks) ( void );
-
-extern Int  MC_(get_or_set_vbits_for_client) ( 
-               ThreadId tid,
-               Addr dataV, 
-               Addr vbitsV, 
-               SizeT size, 
-               Bool setting /* True <=> set vbits,  False <=> get vbits */ 
-            );
-
-/* Functions defined in mc_clientreqs.c */
-extern Bool MC_(client_perm_maybe_describe)( Addr a, AddrInfo* ai );
-extern void MC_(show_client_block_stats) ( void );
-
-
 /* Functions defined in mc_errcontext.c */
 extern void MC_(record_value_error)  ( ThreadId tid, Int size );
-extern void MC_(record_user_error)   ( ThreadId tid, Addr a, Bool isWrite );
+extern void MC_(record_user_error)   ( ThreadId tid, Addr a, Bool isWrite,
+                                       Bool isUnaddr );
 
 
 #endif
 
 /*--------------------------------------------------------------------*/
-/*--- end                                             mc_include.h ---*/
+/*--- end                                                          ---*/
 /*--------------------------------------------------------------------*/