|
From: <sv...@va...> - 2005-03-31 04:52:52
|
Author: njn
Date: 2005-03-31 05:52:26 +0100 (Thu, 31 Mar 2005)
New Revision: 3488
Modified:
trunk/coregrind/core.h
trunk/coregrind/gen_toolint.pl
trunk/coregrind/vg_needs.c
trunk/coregrind/vg_scheduler.c
trunk/coregrind/vg_translate.c
Log:
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.
Modified: trunk/coregrind/core.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/core.h 2005-03-31 04:37:24 UTC (rev 3487)
+++ trunk/coregrind/core.h 2005-03-31 04:52:26 UTC (rev 3488)
@@ -481,17 +481,17 @@
=20
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;
+ 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);
=20
- Addr arena_payload_szB;
+ SizeT (*arena_payload_szB) (ArenaId aid, void* payload);
=20
Bool clo_sloppy_malloc;
Bool clo_trace_malloc;
Modified: trunk/coregrind/gen_toolint.pl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/gen_toolint.pl 2005-03-31 04:37:24 UTC (rev 3487)
+++ trunk/coregrind/gen_toolint.pl 2005-03-31 04:52:26 UTC (rev 3488)
@@ -34,7 +34,7 @@
my $post;
my $generate;
=20
-my $struct =3D "VG_(tool_interface)";
+my $struct =3D "VG_(tdict)";
=20
my %pfxmap =3D ("track" =3D> "TL_",
"tool" =3D> "TL_",
Modified: trunk/coregrind/vg_needs.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_needs.c 2005-03-31 04:37:24 UTC (rev 3487)
+++ trunk/coregrind/vg_needs.c 2005-03-31 04:52:26 UTC (rev 3488)
@@ -45,9 +45,9 @@
void(*fini)(Int)
)
{
- VG_(tool_interface).tool_post_clo_init =3D post_clo_init;
- VG_(tool_interface).tool_instrument =3D instrument;
- VG_(tool_interface).tool_fini =3D fini;
+ VG_(tdict).tool_post_clo_init =3D post_clo_init;
+ VG_(tdict).tool_instrument =3D instrument;
+ VG_(tdict).tool_fini =3D fini;
}
=20
/*--------------------------------------------------------------------*/
@@ -167,7 +167,7 @@
)
{
VG_(needs).basic_block_discards =3D True;
- VG_(tool_interface).tool_discard_basic_block_info =3D discard;
+ VG_(tdict).tool_discard_basic_block_info =3D discard;
}
=20
void VG_(needs_tool_errors)(
@@ -182,14 +182,14 @@
)
{
VG_(needs).tool_errors =3D True;
- VG_(tool_interface).tool_eq_Error =3D eq;
- VG_(tool_interface).tool_pp_Error =3D pp;
- VG_(tool_interface).tool_update_extra =3D update;
- VG_(tool_interface).tool_recognised_suppression =3D recog;
- VG_(tool_interface).tool_read_extra_suppression_info =3D read_extra;
- VG_(tool_interface).tool_error_matches_suppression =3D matches;
- VG_(tool_interface).tool_get_error_name =3D name;
- VG_(tool_interface).tool_print_extra_suppression_info =3D print_extra=
;
+ VG_(tdict).tool_eq_Error =3D eq;
+ VG_(tdict).tool_pp_Error =3D pp;
+ VG_(tdict).tool_update_extra =3D update;
+ VG_(tdict).tool_recognised_suppression =3D recog;
+ VG_(tdict).tool_read_extra_suppression_info =3D read_extra;
+ VG_(tdict).tool_error_matches_suppression =3D matches;
+ VG_(tdict).tool_get_error_name =3D name;
+ VG_(tdict).tool_print_extra_suppression_info =3D print_extra;
}
=20
void VG_(needs_command_line_options)(
@@ -199,9 +199,9 @@
)
{
VG_(needs).command_line_options =3D True;
- VG_(tool_interface).tool_process_cmd_line_option =3D process;
- VG_(tool_interface).tool_print_usage =3D usage;
- VG_(tool_interface).tool_print_debug_usage =3D debug_usage;
+ VG_(tdict).tool_process_cmd_line_option =3D process;
+ VG_(tdict).tool_print_usage =3D usage;
+ VG_(tdict).tool_print_debug_usage =3D debug_usage;
}
=20
void VG_(needs_client_requests)(
@@ -209,7 +209,7 @@
)
{
VG_(needs).client_requests =3D True;
- VG_(tool_interface).tool_handle_client_request =3D handle;
+ VG_(tdict).tool_handle_client_request =3D handle;
}
=20
void VG_(needs_syscall_wrapper)(
@@ -218,8 +218,8 @@
)
{
VG_(needs).syscall_wrapper =3D True;
- VG_(tool_interface).tool_pre_syscall =3D pre;
- VG_(tool_interface).tool_post_syscall =3D post;
+ VG_(tdict).tool_pre_syscall =3D pre;
+ VG_(tdict).tool_post_syscall =3D post;
}
=20
void VG_(needs_sanity_checks)(
@@ -228,8 +228,8 @@
)
{
VG_(needs).sanity_checks =3D True;
- VG_(tool_interface).tool_cheap_sanity_check =3D cheap;
- VG_(tool_interface).tool_expensive_sanity_check =3D expen;
+ VG_(tdict).tool_cheap_sanity_check =3D cheap;
+ VG_(tdict).tool_expensive_sanity_check =3D expen;
}
=20
=20
@@ -248,15 +248,15 @@
SizeT client_malloc_redzone_szB
)
{
- VG_(tool_interface).malloc_malloc =3D malloc;
- VG_(tool_interface).malloc___builtin_new =3D __builtin_new;
- VG_(tool_interface).malloc___builtin_vec_new =3D __builtin_vec_new=
;
- VG_(tool_interface).malloc_memalign =3D memalign;
- VG_(tool_interface).malloc_calloc =3D calloc;
- VG_(tool_interface).malloc_free =3D free;
- VG_(tool_interface).malloc___builtin_delete =3D __builtin_delete;
- VG_(tool_interface).malloc___builtin_vec_delete =3D __builtin_vec_del=
ete;
- VG_(tool_interface).malloc_realloc =3D realloc;
+ VG_(tdict).malloc_malloc =3D malloc;
+ VG_(tdict).malloc___builtin_new =3D __builtin_new;
+ VG_(tdict).malloc___builtin_vec_new =3D __builtin_vec_new;
+ VG_(tdict).malloc_memalign =3D memalign;
+ VG_(tdict).malloc_calloc =3D calloc;
+ VG_(tdict).malloc_free =3D free;
+ VG_(tdict).malloc___builtin_delete =3D __builtin_delete;
+ VG_(tdict).malloc___builtin_vec_delete =3D __builtin_vec_delete;
+ VG_(tdict).malloc_realloc =3D realloc;
=20
VG_(set_client_malloc_redzone_szB)( client_malloc_redzone_szB );
}
Modified: trunk/coregrind/vg_scheduler.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_scheduler.c 2005-03-31 04:37:24 UTC (rev 3487)
+++ trunk/coregrind/vg_scheduler.c 2005-03-31 04:52:26 UTC (rev 3488)
@@ -1026,17 +1026,17 @@
case VG_USERREQ__GET_MALLOCFUNCS: {
struct vg_mallocfunc_info *info =3D (struct vg_mallocfunc_info *)arg[1=
];
=20
- info->tl_malloc =3D (Addr)TL_(malloc);
- info->tl_calloc =3D (Addr)TL_(calloc);
- info->tl_realloc =3D (Addr)TL_(realloc);
- info->tl_memalign =3D (Addr)TL_(memalign);
- info->tl___builtin_new =3D (Addr)TL_(__builtin_new);
- info->tl___builtin_vec_new =3D (Addr)TL_(__builtin_vec_new);
- info->tl_free =3D (Addr)TL_(free);
- info->tl___builtin_delete =3D (Addr)TL_(__builtin_delete);
- info->tl___builtin_vec_delete =3D (Addr)TL_(__builtin_vec_delete);
+ info->tl_malloc =3D VG_(tdict).malloc_malloc;
+ info->tl_calloc =3D VG_(tdict).malloc_calloc;
+ info->tl_realloc =3D VG_(tdict).malloc_realloc;
+ info->tl_memalign =3D VG_(tdict).malloc_memalign;
+ info->tl___builtin_new =3D VG_(tdict).malloc___builtin_new;
+ info->tl___builtin_vec_new =3D VG_(tdict).malloc___builtin_vec_new;
+ info->tl_free =3D VG_(tdict).malloc_free;
+ info->tl___builtin_delete =3D VG_(tdict).malloc___builtin_delete;
+ info->tl___builtin_vec_delete =3D VG_(tdict).malloc___builtin_vec_dele=
te;
=20
- info->arena_payload_szB =3D (Addr)VG_(arena_payload_szB);
+ info->arena_payload_szB =3D VG_(arena_payload_szB);
=20
info->clo_sloppy_malloc =3D VG_(clo_sloppy_malloc);
info->clo_trace_malloc =3D VG_(clo_trace_malloc);
Modified: trunk/coregrind/vg_translate.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_translate.c 2005-03-31 04:37:24 UTC (rev 3487)
+++ trunk/coregrind/vg_translate.c 2005-03-31 04:52:26 UTC (rev 3488)
@@ -100,8 +100,7 @@
dcall =3D 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 =3D 1; =
\
|