Reinstated Memcheck.  Did the full merge from CVS, except for the
user-specified block stuff, which confused me because I wasn't sure whether
to use the code already in SVN, or the code in CVS.  Perhaps that code
doesn't need to be changed.

Unfortunately, Memcheck doesn't work entirely correctly -- I get some
spurious errors.  Nonetheless I'm checking it in as a starting point.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3353 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/memcheck/mac_leakcheck.c b/memcheck/mac_leakcheck.c
index 3e9f37b..fd55422 100644
--- a/memcheck/mac_leakcheck.c
+++ b/memcheck/mac_leakcheck.c
@@ -400,7 +400,7 @@
 static Int    blocks_reachable;
 static Int    blocks_suppressed;
 
-static void full_report()
+static void full_report(ThreadId tid)
 {
    Int i;
    Int    n_lossrecords;
@@ -491,7 +491,7 @@
       print_record = ( MAC_(clo_show_reachable) || 
 		       Unreached == p_min->loss_mode || Interior == p_min->loss_mode );
       is_suppressed = 
-         VG_(unique_error) ( VG_(get_running_tid)(), LeakErr, (UInt)i+1,
+         VG_(unique_error) ( tid, LeakErr, (UInt)i+1,
                              (Char*)n_lossrecords, (void*) p_min,
                              p_min->allocated_at, print_record,
                              /*allow_GDB_attach*/False, /*count_error*/False );
@@ -565,12 +565,12 @@
    reachable blocks should be shown.
 */
 void MAC_(do_detect_memory_leaks) (
-   LeakCheckMode mode,
+   ThreadId tid, LeakCheckMode mode,
    Bool (*is_valid_64k_chunk) ( UInt ),
    Bool (*is_valid_address)   ( Addr )
 )
 {
-   Int    i;
+   Int i;
    
    tl_assert(mode != LC_Off);
 
@@ -642,7 +642,7 @@
    blocks_suppressed = MAC_(bytes_suppressed) = 0;
 
    if (mode == LC_Full)
-      full_report();
+      full_report(tid);
    else
       make_summary();