From: Nicholas Nethercote Date: Thu, 31 Mar 2005 04:52:26 +0000 (+0000) Subject: Rename VG_(tool_interface), which is overly general and a bit verbose, as X-Git-Tag: svn/VALGRIND_3_0_0~830 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3075ee0682ed77f234b6834fe5dd1cae1f18fe28;p=thirdparty%2Fvalgrind.git Rename VG_(tool_interface), which is overly general and a bit verbose, as VG_(tdict). Also make the typing more meaningful in vg_mallocfuncs_info. And (barely) start removing the use of "TL_" names in the core. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3488 --- diff --git a/coregrind/core.h b/coregrind/core.h index 4bad7638e5..9a338b3a56 100644 --- a/coregrind/core.h +++ b/coregrind/core.h @@ -481,17 +481,17 @@ extern void VG_(print_all_arena_stats) ( void ); struct vg_mallocfunc_info { /* things vg_replace_malloc.o needs to know about */ - Addr tl_malloc; - Addr tl_calloc; - Addr tl_realloc; - Addr tl_memalign; - Addr tl___builtin_new; - Addr tl___builtin_vec_new; - Addr tl_free; - Addr tl___builtin_delete; - Addr tl___builtin_vec_delete; - - Addr arena_payload_szB; + void* (*tl_malloc) (ThreadId tid, SizeT n); + void* (*tl___builtin_new) (ThreadId tid, SizeT n); + void* (*tl___builtin_vec_new) (ThreadId tid, SizeT n); + void* (*tl_memalign) (ThreadId tid, SizeT align, SizeT n); + void* (*tl_calloc) (ThreadId tid, SizeT nmemb, SizeT n); + void (*tl_free) (ThreadId tid, void* p); + void (*tl___builtin_delete) (ThreadId tid, void* p); + void (*tl___builtin_vec_delete)(ThreadId tid, void* p); + void* (*tl_realloc) (ThreadId tid, void* p, SizeT size); + + SizeT (*arena_payload_szB) (ArenaId aid, void* payload); Bool clo_sloppy_malloc; Bool clo_trace_malloc; diff --git a/coregrind/gen_toolint.pl b/coregrind/gen_toolint.pl index 62494f1b19..e6f629ce50 100644 --- a/coregrind/gen_toolint.pl +++ b/coregrind/gen_toolint.pl @@ -34,7 +34,7 @@ my $pre; my $post; my $generate; -my $struct = "VG_(tool_interface)"; +my $struct = "VG_(tdict)"; my %pfxmap = ("track" => "TL_", "tool" => "TL_", diff --git a/coregrind/vg_needs.c b/coregrind/vg_needs.c index baa913f4ba..a8418a8c6c 100644 --- a/coregrind/vg_needs.c +++ b/coregrind/vg_needs.c @@ -45,9 +45,9 @@ void VG_(basic_tool_funcs)( void(*fini)(Int) ) { - VG_(tool_interface).tool_post_clo_init = post_clo_init; - VG_(tool_interface).tool_instrument = instrument; - VG_(tool_interface).tool_fini = fini; + VG_(tdict).tool_post_clo_init = post_clo_init; + VG_(tdict).tool_instrument = instrument; + VG_(tdict).tool_fini = fini; } /*--------------------------------------------------------------------*/ @@ -167,7 +167,7 @@ void VG_(needs_basic_block_discards)( ) { VG_(needs).basic_block_discards = True; - VG_(tool_interface).tool_discard_basic_block_info = discard; + VG_(tdict).tool_discard_basic_block_info = discard; } void VG_(needs_tool_errors)( @@ -182,14 +182,14 @@ void VG_(needs_tool_errors)( ) { VG_(needs).tool_errors = True; - VG_(tool_interface).tool_eq_Error = eq; - VG_(tool_interface).tool_pp_Error = pp; - VG_(tool_interface).tool_update_extra = update; - VG_(tool_interface).tool_recognised_suppression = recog; - VG_(tool_interface).tool_read_extra_suppression_info = read_extra; - VG_(tool_interface).tool_error_matches_suppression = matches; - VG_(tool_interface).tool_get_error_name = name; - VG_(tool_interface).tool_print_extra_suppression_info = print_extra; + VG_(tdict).tool_eq_Error = eq; + VG_(tdict).tool_pp_Error = pp; + VG_(tdict).tool_update_extra = update; + VG_(tdict).tool_recognised_suppression = recog; + VG_(tdict).tool_read_extra_suppression_info = read_extra; + VG_(tdict).tool_error_matches_suppression = matches; + VG_(tdict).tool_get_error_name = name; + VG_(tdict).tool_print_extra_suppression_info = print_extra; } void VG_(needs_command_line_options)( @@ -199,9 +199,9 @@ void VG_(needs_command_line_options)( ) { VG_(needs).command_line_options = True; - VG_(tool_interface).tool_process_cmd_line_option = process; - VG_(tool_interface).tool_print_usage = usage; - VG_(tool_interface).tool_print_debug_usage = debug_usage; + VG_(tdict).tool_process_cmd_line_option = process; + VG_(tdict).tool_print_usage = usage; + VG_(tdict).tool_print_debug_usage = debug_usage; } void VG_(needs_client_requests)( @@ -209,7 +209,7 @@ void VG_(needs_client_requests)( ) { VG_(needs).client_requests = True; - VG_(tool_interface).tool_handle_client_request = handle; + VG_(tdict).tool_handle_client_request = handle; } void VG_(needs_syscall_wrapper)( @@ -218,8 +218,8 @@ void VG_(needs_syscall_wrapper)( ) { VG_(needs).syscall_wrapper = True; - VG_(tool_interface).tool_pre_syscall = pre; - VG_(tool_interface).tool_post_syscall = post; + VG_(tdict).tool_pre_syscall = pre; + VG_(tdict).tool_post_syscall = post; } void VG_(needs_sanity_checks)( @@ -228,8 +228,8 @@ void VG_(needs_sanity_checks)( ) { VG_(needs).sanity_checks = True; - VG_(tool_interface).tool_cheap_sanity_check = cheap; - VG_(tool_interface).tool_expensive_sanity_check = expen; + VG_(tdict).tool_cheap_sanity_check = cheap; + VG_(tdict).tool_expensive_sanity_check = expen; } @@ -248,15 +248,15 @@ extern void VG_(malloc_funcs)( SizeT client_malloc_redzone_szB ) { - VG_(tool_interface).malloc_malloc = malloc; - VG_(tool_interface).malloc___builtin_new = __builtin_new; - VG_(tool_interface).malloc___builtin_vec_new = __builtin_vec_new; - VG_(tool_interface).malloc_memalign = memalign; - VG_(tool_interface).malloc_calloc = calloc; - VG_(tool_interface).malloc_free = free; - VG_(tool_interface).malloc___builtin_delete = __builtin_delete; - VG_(tool_interface).malloc___builtin_vec_delete = __builtin_vec_delete; - VG_(tool_interface).malloc_realloc = realloc; + VG_(tdict).malloc_malloc = malloc; + VG_(tdict).malloc___builtin_new = __builtin_new; + VG_(tdict).malloc___builtin_vec_new = __builtin_vec_new; + VG_(tdict).malloc_memalign = memalign; + VG_(tdict).malloc_calloc = calloc; + VG_(tdict).malloc_free = free; + VG_(tdict).malloc___builtin_delete = __builtin_delete; + VG_(tdict).malloc___builtin_vec_delete = __builtin_vec_delete; + VG_(tdict).malloc_realloc = realloc; VG_(set_client_malloc_redzone_szB)( client_malloc_redzone_szB ); } diff --git a/coregrind/vg_scheduler.c b/coregrind/vg_scheduler.c index 29560eb865..59f89b5463 100644 --- a/coregrind/vg_scheduler.c +++ b/coregrind/vg_scheduler.c @@ -1026,17 +1026,17 @@ void do_client_request ( ThreadId tid ) case VG_USERREQ__GET_MALLOCFUNCS: { struct vg_mallocfunc_info *info = (struct vg_mallocfunc_info *)arg[1]; - info->tl_malloc = (Addr)TL_(malloc); - info->tl_calloc = (Addr)TL_(calloc); - info->tl_realloc = (Addr)TL_(realloc); - info->tl_memalign = (Addr)TL_(memalign); - info->tl___builtin_new = (Addr)TL_(__builtin_new); - info->tl___builtin_vec_new = (Addr)TL_(__builtin_vec_new); - info->tl_free = (Addr)TL_(free); - info->tl___builtin_delete = (Addr)TL_(__builtin_delete); - info->tl___builtin_vec_delete = (Addr)TL_(__builtin_vec_delete); - - info->arena_payload_szB = (Addr)VG_(arena_payload_szB); + info->tl_malloc = VG_(tdict).malloc_malloc; + info->tl_calloc = VG_(tdict).malloc_calloc; + info->tl_realloc = VG_(tdict).malloc_realloc; + info->tl_memalign = VG_(tdict).malloc_memalign; + info->tl___builtin_new = VG_(tdict).malloc___builtin_new; + info->tl___builtin_vec_new = VG_(tdict).malloc___builtin_vec_new; + info->tl_free = VG_(tdict).malloc_free; + info->tl___builtin_delete = VG_(tdict).malloc___builtin_delete; + info->tl___builtin_vec_delete = VG_(tdict).malloc___builtin_vec_delete; + + info->arena_payload_szB = VG_(arena_payload_szB); info->clo_sloppy_malloc = VG_(clo_sloppy_malloc); info->clo_trace_malloc = VG_(clo_trace_malloc); diff --git a/coregrind/vg_translate.c b/coregrind/vg_translate.c index 854b8f51d8..8ec8663229 100644 --- a/coregrind/vg_translate.c +++ b/coregrind/vg_translate.c @@ -100,8 +100,7 @@ IRBB* vg_SP_update_pass ( IRBB* bb_in, VexGuestLayout* layout, dcall = unsafeIRDirty_0_N( \ 1/*regparms*/, \ "track_" #kind "_mem_stack_" #syze, \ - VG_(tool_interface) \ - .track_##kind##_mem_stack_##syze, \ + VG_(tdict).track_##kind##_mem_stack_##syze, \ mkIRExprVec_1(IRExpr_Tmp(curr)) \ ); \ dcall->nFxState = 1; \