From: Julian Seward Date: Mon, 14 Mar 2005 00:14:04 +0000 (+0000) Subject: Commit half-baked attempts to get memcheck and addrcheck to build. X-Git-Tag: svn/VALGRIND_3_0_0~968 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fcbbc8332b7d436354499fdfa848acf5d2cac57d;p=thirdparty%2Fvalgrind.git Commit half-baked attempts to get memcheck and addrcheck to build. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3350 --- diff --git a/addrcheck/ac_main.c b/addrcheck/ac_main.c index 91584cc502..a911741e95 100644 --- a/addrcheck/ac_main.c +++ b/addrcheck/ac_main.c @@ -169,11 +169,11 @@ static void init_shadow_memory ( void ) Int i, a; /* check construction of the distinguished secondaries */ - sk_assert(VGM_BIT_INVALID == 1); - sk_assert(VGM_BIT_VALID == 0); + tl_assert(VGM_BIT_INVALID == 1); + tl_assert(VGM_BIT_VALID == 0); for(a = 0; a <= 1; a++) - sk_assert(distinguished_secondary_maps[DSM_IDX(a)].abits[0] == BIT_EXPAND(a)); + tl_assert(distinguished_secondary_maps[DSM_IDX(a)].abits[0] == BIT_EXPAND(a)); /* These entries gradually get overwritten as the used address space expands. */ @@ -819,7 +819,7 @@ static void ac_ACCESS4_SLOWLY ( Addr a, Bool isWrite ) if (!MAC_(clo_partial_loads_ok) || ((a & 3) != 0) || (!a0ok && !a1ok && !a2ok && !a3ok)) { - MAC_(record_address_error)( VG_(get_VCPU_tid)(), a, 4, isWrite ); + MAC_(record_address_error)( VG_(get_running_tid)(), a, 4, isWrite ); return; } @@ -846,7 +846,7 @@ static void ac_ACCESS2_SLOWLY ( Addr a, Bool isWrite ) /* If an address error has happened, report it. */ if (aerr) { - MAC_(record_address_error)( VG_(get_VCPU_tid)(), a, 2, isWrite ); + MAC_(record_address_error)( VG_(get_running_tid)(), a, 2, isWrite ); } } @@ -860,7 +860,7 @@ static void ac_ACCESS1_SLOWLY ( Addr a, Bool isWrite) /* If an address error has happened, report it. */ if (aerr) { - MAC_(record_address_error)( VG_(get_VCPU_tid)(), a, 1, isWrite ); + MAC_(record_address_error)( VG_(get_running_tid)(), a, 1, isWrite ); } } @@ -977,7 +977,7 @@ void ac_fpu_ACCESS_check_SLOWLY ( Addr addr, SizeT size, Bool isWrite ) } if (aerr) { - MAC_(record_address_error)( VG_(get_VCPU_tid)(), addr, size, isWrite ); + MAC_(record_address_error)( VG_(get_running_tid)(), addr, size, isWrite ); } } diff --git a/memcheck/mac_leakcheck.c b/memcheck/mac_leakcheck.c index 745a7d76e7..3e9f37b06c 100644 --- a/memcheck/mac_leakcheck.c +++ b/memcheck/mac_leakcheck.c @@ -154,13 +154,13 @@ Int find_shadow_for ( Addr ptr, lo = mid+1; continue; } - sk_assert(ptr >= a_mid_lo && ptr <= a_mid_hi); + tl_assert(ptr >= a_mid_lo && ptr <= a_mid_hi); retVal = mid; break; } # if VG_DEBUG_LEAKCHECK - sk_assert(retVal == find_shadow_for_OLD ( ptr, shadows, n_shadows )); + tl_assert(retVal == find_shadow_for_OLD ( ptr, shadows, n_shadows )); # endif /* VG_(printf)("%d\n", retVal); */ return retVal; @@ -246,15 +246,15 @@ static void _lc_markstack_push(Addr ptr, Int clique) if (sh_no == -1) return; - sk_assert(sh_no >= 0 && sh_no < lc_n_shadows); - sk_assert(ptr <= lc_shadows[sh_no]->data + lc_shadows[sh_no]->size); + tl_assert(sh_no >= 0 && sh_no < lc_n_shadows); + tl_assert(ptr <= lc_shadows[sh_no]->data + lc_shadows[sh_no]->size); if (lc_markstack[sh_no].state == Unreached) { if (0) VG_(printf)("pushing %p-%p\n", lc_shadows[sh_no]->data, lc_shadows[sh_no]->data + lc_shadows[sh_no]->size); - sk_assert(lc_markstack[sh_no].next == -1); + tl_assert(lc_markstack[sh_no].next == -1); lc_markstack[sh_no].next = lc_markstack_top; lc_markstack_top = sh_no; } @@ -387,8 +387,8 @@ static void lc_do_leakcheck(Int clique) Int top; while((top = lc_markstack_pop()) != -1) { - sk_assert(top >= 0 && top < lc_n_shadows); - sk_assert(lc_markstack[top].state != Unreached); + tl_assert(top >= 0 && top < lc_n_shadows); + tl_assert(lc_markstack[top].state != Unreached); _lc_scan_memory(lc_shadows[top]->data, lc_shadows[top]->size, clique); } @@ -421,7 +421,7 @@ static void full_report() if (lc_markstack[i].state != Unreached) continue; - sk_assert(lc_markstack_top == -1); + tl_assert(lc_markstack_top == -1); if (VG_DEBUG_CLIQUE) VG_(printf)("%d: gathering clique %p\n", i, lc_shadows[i]->data); @@ -430,8 +430,8 @@ static void full_report() lc_do_leakcheck(i); - sk_assert(lc_markstack_top == -1); - sk_assert(lc_markstack[i].state == IndirectLeak); + tl_assert(lc_markstack_top == -1); + tl_assert(lc_markstack[i].state == IndirectLeak); lc_markstack[i].state = Unreached; /* Return to unreached state, to indicate its a clique @@ -480,7 +480,7 @@ static void full_report() p_min = p; } } - sk_assert(p_min != NULL); + tl_assert(p_min != NULL); /* Ok to have tst==NULL; it's only used if --gdb-attach=yes, and we disallow that when --leak-check=yes. @@ -491,7 +491,7 @@ static void full_report() print_record = ( MAC_(clo_show_reachable) || Unreached == p_min->loss_mode || Interior == p_min->loss_mode ); is_suppressed = - VG_(unique_error) ( VG_(get_VCPU_tid)(), LeakErr, (UInt)i+1, + VG_(unique_error) ( VG_(get_running_tid)(), LeakErr, (UInt)i+1, (Char*)n_lossrecords, (void*) p_min, p_min->allocated_at, print_record, /*allow_GDB_attach*/False, /*count_error*/False ); @@ -517,7 +517,7 @@ static void full_report() MAC_(bytes_reachable) += p_min->total_bytes; } else { - VG_(skin_panic)("generic_detect_memory_leaks: unknown loss mode"); + VG_(tool_panic)("generic_detect_memory_leaks: unknown loss mode"); } p_min->num_blocks = 0; } @@ -572,7 +572,7 @@ void MAC_(do_detect_memory_leaks) ( { Int i; - sk_assert(mode != LC_Off); + tl_assert(mode != LC_Off); /* VG_(HT_to_array) allocates storage for shadows */ lc_shadows = (MAC_Chunk**)VG_(HT_to_array)( MAC_(malloc_list), @@ -583,17 +583,17 @@ void MAC_(do_detect_memory_leaks) ( /* Sanity check; assert that the blocks are now in order */ for (i = 0; i < lc_n_shadows-1; i++) { - sk_assert( lc_shadows[i]->data <= lc_shadows[i+1]->data); + tl_assert( lc_shadows[i]->data <= lc_shadows[i+1]->data); } /* Sanity check -- make sure they don't overlap */ for (i = 0; i < lc_n_shadows-1; i++) { - sk_assert( lc_shadows[i]->data + lc_shadows[i]->size + tl_assert( lc_shadows[i]->data + lc_shadows[i]->size < lc_shadows[i+1]->data ); } if (lc_n_shadows == 0) { - sk_assert(lc_shadows == NULL); + tl_assert(lc_shadows == NULL); if (VG_(clo_verbosity) >= 1) { VG_(message)(Vg_UserMsg, "No malloc'd blocks -- no leaks are possible."); diff --git a/memcheck/mac_malloc_wrappers.c b/memcheck/mac_malloc_wrappers.c index 63f7eba91d..cb84181463 100644 --- a/memcheck/mac_malloc_wrappers.c +++ b/memcheck/mac_malloc_wrappers.c @@ -469,7 +469,7 @@ void MAC_(destroy_mempool)(Addr pool) (void*)&prev_next ); if (mp == NULL) { - ThreadId tid = VG_(get_current_tid)(); + ThreadId tid = VG_(get_running_tid)(); MAC_(record_illegal_mempool_error) ( tid, pool ); return; @@ -505,7 +505,7 @@ void MAC_(mempool_free)(Addr pool, Addr addr) MAC_Mempool** prev_pool; MAC_Chunk* mc; MAC_Chunk** prev_chunk; - ThreadId tid = VG_(get_current_tid)(); + ThreadId tid = VG_(get_running_tid)(); mp = (MAC_Mempool*)VG_(HT_get_node)(MAC_(mempool_list), (UWord)pool, (void*)&prev_pool);