A big commit size-wise, but small concept-wise:  removed the ThreadState type
from skin's view, replacing all instances with ThreadId.  Much cleaner.  Had to
change the way VG_(get_ExeContext)() worked a little.  Changed the core/skin
major interface because this breaks the old version.  Also fixed a few minor
related things here and there.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1782 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/addrcheck/ac_main.c b/addrcheck/ac_main.c
index e4f2a6b..2efaa3a 100644
--- a/addrcheck/ac_main.c
+++ b/addrcheck/ac_main.c
@@ -561,7 +561,7 @@
 /*------------------------------------------------------------*/
 
 static __inline__
-void ac_check_is_accessible ( CorePart part, ThreadState* tst,
+void ac_check_is_accessible ( CorePart part, ThreadId tid,
                               Char* s, Addr base, UInt size, Bool isWrite )
 {
    Bool ok;
@@ -573,21 +573,21 @@
    if (!ok) {
       switch (part) {
       case Vg_CoreSysCall:
-         MAC_(record_param_error) ( tst, bad_addr, isWrite, s );
+         MAC_(record_param_error) ( tid, bad_addr, isWrite, s );
          break;
 
       case Vg_CoreSignal:
          sk_assert(isWrite);     /* Should only happen with isWrite case */
          /* fall through */
       case Vg_CorePThread:
-         MAC_(record_core_mem_error)( tst, isWrite, s );
+         MAC_(record_core_mem_error)( tid, isWrite, s );
          break;
 
       /* If we're being asked to jump to a silly address, record an error 
          message before potentially crashing the entire system. */
       case Vg_CoreTranslate:
          sk_assert(!isWrite);    /* Should only happen with !isWrite case */
-         MAC_(record_jump_error)( tst, bad_addr );
+         MAC_(record_jump_error)( tid, bad_addr );
          break;
 
       default:
@@ -599,21 +599,21 @@
 }
 
 static
-void ac_check_is_writable ( CorePart part, ThreadState* tst,
+void ac_check_is_writable ( CorePart part, ThreadId tid,
                             Char* s, Addr base, UInt size )
 {
-   ac_check_is_accessible ( part, tst, s, base, size, /*isWrite*/True );
+   ac_check_is_accessible ( part, tid, s, base, size, /*isWrite*/True );
 }
 
 static
-void ac_check_is_readable ( CorePart part, ThreadState* tst,
+void ac_check_is_readable ( CorePart part, ThreadId tid,
                             Char* s, Addr base, UInt size )
 {     
-   ac_check_is_accessible ( part, tst, s, base, size, /*isWrite*/False );
+   ac_check_is_accessible ( part, tid, s, base, size, /*isWrite*/False );
 }
 
 static
-void ac_check_is_readable_asciiz ( CorePart part, ThreadState* tst,
+void ac_check_is_readable_asciiz ( CorePart part, ThreadId tid,
                                    Char* s, Addr str )
 {
    Bool ok = True;
@@ -625,7 +625,7 @@
    sk_assert(part == Vg_CoreSysCall);
    ok = ac_check_readable_asciiz ( (Addr)str, &bad_addr );
    if (!ok) {
-      MAC_(record_param_error) ( tst, bad_addr, /*is_writable =*/False, s );
+      MAC_(record_param_error) ( tid, bad_addr, /*is_writable =*/False, s );
    }
 
    VGP_POPCC(VgpCheckMem);
@@ -781,7 +781,7 @@
    if (!MAC_(clo_partial_loads_ok) 
        || ((a & 3) != 0)
        || (!a0ok && !a1ok && !a2ok && !a3ok)) {
-      MAC_(record_address_error)( /*tst*/NULL, a, 4, False );
+      MAC_(record_address_error)( VG_(get_current_tid)(), a, 4, False );
       return;
    }
 
@@ -808,7 +808,7 @@
 
    /* If an address error has happened, report it. */
    if (aerr) {
-      MAC_(record_address_error)( /*tst*/NULL, a, 2, False );
+      MAC_(record_address_error)( VG_(get_current_tid)(), a, 2, False );
    }
 }
 
@@ -822,7 +822,7 @@
 
    /* If an address error has happened, report it. */
    if (aerr) {
-      MAC_(record_address_error)( /*tst*/NULL, a, 1, False );
+      MAC_(record_address_error)( VG_(get_current_tid)(), a, 1, False );
    }
 }
 
@@ -927,7 +927,7 @@
    }
 
    if (aerr) {
-      MAC_(record_address_error)( /*tst*/NULL, addr, size, False );
+      MAC_(record_address_error)( VG_(get_current_tid)(), addr, size, False );
    }
 }
 
@@ -1147,7 +1147,7 @@
 /*--- Client requests                                      ---*/
 /*------------------------------------------------------------*/
 
-Bool SK_(handle_client_request) ( ThreadState* tst, UInt* arg_block, UInt *ret )
+Bool SK_(handle_client_request) ( ThreadId tid, UInt* arg_block, UInt *ret )
 {
 #define IGNORE(what)                                                    \
    do {                                                                 \
@@ -1193,7 +1193,7 @@
          return False;
 
       default:
-         if (MAC_(handle_common_client_requests)(tst, arg_block, ret )) {
+         if (MAC_(handle_common_client_requests)(tid, arg_block, ret )) {
             return True;
          } else {
             VG_(message)(Vg_UserMsg,