/*--- Instrumentation ---*/
/*------------------------------------------------------------*/
+#if 0
static
BB_info* get_BB_info(UCodeBlock* cb_in, Addr orig_addr, Bool* bb_seen_before)
{
}
return bb_info;
}
+#endif
static
void do_details( instr_info* n, Bool bb_seen_before,
8 == data_size || 10 == data_size || MIN_LINE_SIZE == data_size);
}
+#if 0
// Instrumentation for the end of each x86 instruction.
static
void end_of_x86_instr(UCodeBlock* cb, instr_info* i_node, Bool bb_seen_before,
uCCall(cb, helper, argc, argc, False);
}
+#endif
+#if 0
UCodeBlock* TL_(instrument)(UCodeBlock* cb_in, Addr orig_addr)
{
UCodeBlock* cb;
#undef INVALID_DATA_SIZE
}
+#endif
+
+IRBB* TL_(instrument) ( IRBB* bb_in, VexGuestLayout* layout, IRType hWordTy )
+{
+ VG_(message)(Vg_DebugMsg, "Cachegrind is not yet ready to handle Vex IR");
+ VG_(exit)(1);
+}
/*------------------------------------------------------------*/
/*--- Cache configuration ---*/
VG_(needs_basic_block_discards)();
VG_(needs_command_line_options)();
- VG_(register_compact_helper)((Addr) & log_1I_0D_cache_access);
- VG_(register_compact_helper)((Addr) & log_1I_1Dr_cache_access);
- VG_(register_compact_helper)((Addr) & log_1I_1Dw_cache_access);
- VG_(register_compact_helper)((Addr) & log_1I_2D_cache_access);
-
/* Get working directory */
tl_assert( VG_(getcwd_alloc)(&base_dir) );
void init_nonvirgin_sword(Addr a)
{
shadow_word sword;
- ThreadId tid = VG_(get_current_or_recent_tid)();
+ ThreadId tid;
ThreadLifeSeg *tls;
+ // The tid must be passed in here now; this requires more events to be
+ // given the tid in the first place.
+ //
+ //tid = VG_(get_current_or_recent_tid)();
+ VG_(message)(Vg_DebugMsg, "tid needs to be passed in here");
+ VG_(exit)(1);
+
tl_assert(tid != VG_INVALID_THREADID);
tls = thread_seg[tid];
/* Allocate memory and note change in memory available */
static __inline__
-void* alloc_and_new_mem ( SizeT size, SizeT alignment, Bool is_zeroed )
+void* alloc_and_new_mem ( ThreadId tid, SizeT size, SizeT alignment,
+ Bool is_zeroed )
{
Addr p;
return NULL;
}
if (is_zeroed) VG_(memset)((void*)p, 0, size);
- add_HG_Chunk ( VG_(get_current_or_recent_tid)(), p, size );
+ add_HG_Chunk ( tid, p, size );
eraser_new_mem_heap( p, size, is_zeroed );
return (void*)p;
}
-void* TL_(malloc) ( SizeT n )
+void* TL_(malloc) ( ThreadId tid, SizeT n )
{
- return alloc_and_new_mem ( n, VG_(clo_alignment), /*is_zeroed*/False );
+ return alloc_and_new_mem ( tid, n, VG_(clo_alignment), /*is_zeroed*/False );
}
-void* TL_(__builtin_new) ( SizeT n )
+void* TL_(__builtin_new) ( ThreadId tid, SizeT n )
{
- return alloc_and_new_mem ( n, VG_(clo_alignment), /*is_zeroed*/False );
+ return alloc_and_new_mem ( tid, n, VG_(clo_alignment), /*is_zeroed*/False );
}
-void* TL_(__builtin_vec_new) ( SizeT n )
+void* TL_(__builtin_vec_new) ( ThreadId tid, SizeT n )
{
- return alloc_and_new_mem ( n, VG_(clo_alignment), /*is_zeroed*/False );
+ return alloc_and_new_mem ( tid, n, VG_(clo_alignment), /*is_zeroed*/False );
}
-void* TL_(memalign) ( SizeT align, SizeT n )
+void* TL_(memalign) ( ThreadId tid, SizeT align, SizeT n )
{
- return alloc_and_new_mem ( n, align, /*is_zeroed*/False );
+ return alloc_and_new_mem ( tid, n, align, /*is_zeroed*/False );
}
-void* TL_(calloc) ( SizeT nmemb, SizeT size )
+void* TL_(calloc) ( ThreadId tid, SizeT nmemb, SizeT size )
{
- return alloc_and_new_mem ( nmemb*size, VG_(clo_alignment),
+ return alloc_and_new_mem ( tid, nmemb*size, VG_(clo_alignment),
/*is_zeroed*/True );
}
static __inline__
-void handle_free ( void* p )
+void handle_free ( ThreadId tid, void* p )
{
HG_Chunk* hc;
HG_Chunk** prev_chunks_next_ptr;
if (hc == NULL) {
return;
}
- die_and_free_mem ( VG_(get_current_or_recent_tid)(),
- hc, prev_chunks_next_ptr );
+ die_and_free_mem ( tid, hc, prev_chunks_next_ptr );
}
-void TL_(free) ( void* p )
+void TL_(free) ( ThreadId tid, void* p )
{
- handle_free(p);
+ handle_free(tid, p);
}
-void TL_(__builtin_delete) ( void* p )
+void TL_(__builtin_delete) ( ThreadId tid, void* p )
{
- handle_free(p);
+ handle_free(tid, p);
}
-void TL_(__builtin_vec_delete) ( void* p )
+void TL_(__builtin_vec_delete) ( ThreadId tid, void* p )
{
- handle_free(p);
+ handle_free(tid, p);
}
-void* TL_(realloc) ( void* p, SizeT new_size )
+void* TL_(realloc) ( ThreadId tid, void* p, SizeT new_size )
{
HG_Chunk *hc;
HG_Chunk **prev_chunks_next_ptr;
Int i;
- ThreadId tid = VG_(get_current_or_recent_tid)();
/* First try and find the block. */
hc = (HG_Chunk*)VG_(HT_get_node) ( hg_malloc_list, (UWord)p,
static UInt stk_ld, nonstk_ld, stk_st, nonstk_st;
+#if 0
/* Create and return an instrumented version of cb_in. Free cb_in
before returning. */
UCodeBlock* TL_(instrument) ( UCodeBlock* cb_in, Addr not_used )
VG_(free_UCodeBlock)(cb_in);
return cb;
}
-
+#endif
+IRBB* TL_(instrument) ( IRBB* bb_in, VexGuestLayout* layout, IRType hWordTy )
+{
+ VG_(message)(Vg_DebugMsg, "Helgrind is not yet ready to handle Vex IR");
+ VG_(exit)(1);
+}
/*--------------------------------------------------------------------*/
/*--- Error and suppression handling ---*/
VG_(init_post_mutex_lock) (& eraser_post_mutex_lock);
VG_(init_post_mutex_unlock) (& eraser_post_mutex_unlock);
- VG_(register_compact_helper)((Addr) & eraser_mem_help_read_1);
- VG_(register_compact_helper)((Addr) & eraser_mem_help_read_2);
- VG_(register_compact_helper)((Addr) & eraser_mem_help_read_4);
- VG_(register_noncompact_helper)((Addr) & eraser_mem_help_read_N);
-
- VG_(register_compact_helper)((Addr) & eraser_mem_help_write_1);
- VG_(register_compact_helper)((Addr) & eraser_mem_help_write_2);
- VG_(register_compact_helper)((Addr) & eraser_mem_help_write_4);
- VG_(register_noncompact_helper)((Addr) & eraser_mem_help_write_N);
-
- VG_(register_noncompact_helper)((Addr) & bus_lock);
- VG_(register_noncompact_helper)((Addr) & bus_unlock);
-
- for(i = 0; i < LOCKSET_HASH_SZ; i++)
+ for (i = 0; i < LOCKSET_HASH_SZ; i++)
lockset_hash[i] = NULL;
empty = alloc_LockSet(0);