]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Rename VG_(tool_interface), which is overly general and a bit verbose, as
authorNicholas Nethercote <njn@valgrind.org>
Thu, 31 Mar 2005 04:52:26 +0000 (04:52 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Thu, 31 Mar 2005 04:52:26 +0000 (04:52 +0000)
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

coregrind/core.h
coregrind/gen_toolint.pl
coregrind/vg_needs.c
coregrind/vg_scheduler.c
coregrind/vg_translate.c

index 4bad7638e5d8c8d80b16970e080a3ea471c7c853..9a338b3a5656c224fa5c8eab96dc5fa38df09feb 100644 (file)
@@ -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;
index 62494f1b19b8e24b395ef6c608f20b9f9e99a36a..e6f629ce50a0c43d2d92cd0b93cea567670dbe9c 100644 (file)
@@ -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_",
index baa913f4ba675e15d6503c1d2a50abdfbf348b8b..a8418a8c6c32e0bdd73a1d31e28119bbff55fde0 100644 (file)
@@ -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 );
 }
index 29560eb86550453b9e318cf55500dc38742efb84..59f89b546350b2788ea45760a3b4f9e03e77ed36 100644 (file)
@@ -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);
index 854b8f51d82cf912c33f91db5eaef8b7eb824f96..8ec866322939c6e6fc1d0a33ae05e22c9fa3f286 100644 (file)
@@ -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;                                           \