From: Nicholas Nethercote Date: Mon, 22 Nov 2004 18:33:15 +0000 (+0000) Subject: Converted the SK_ prefix to TL_ everywhere. X-Git-Tag: svn/VALGRIND_3_0_0~1258 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=454ab569fec58fa84ef69b5779851cd880f2426f;p=thirdparty%2Fvalgrind.git Converted the SK_ prefix to TL_ everywhere. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3060 --- diff --git a/addrcheck/ac_main.c b/addrcheck/ac_main.c index 51f931af14..63fd5fbc00 100644 --- a/addrcheck/ac_main.c +++ b/addrcheck/ac_main.c @@ -39,7 +39,7 @@ /*--- Comparing and printing errors ---*/ /*------------------------------------------------------------*/ -void SK_(pp_Error) ( Error* err ) +void TL_(pp_Error) ( Error* err ) { MAC_Error* err_extra = VG_(get_error_extra)(err); @@ -75,7 +75,7 @@ void SK_(pp_Error) ( Error* err ) /*--- Suppressions ---*/ /*------------------------------------------------------------*/ -Bool SK_(recognised_suppression) ( Char* name, Supp* su ) +Bool TL_(recognised_suppression) ( Char* name, Supp* su ) { return MAC_(shared_recognised_suppression)(name, su); } @@ -350,7 +350,7 @@ void set_address_range_perms ( Addr a, SizeT len, UInt example_a_bit ) /* Check that zero page and highest page have not been written to -- this could happen with buggy syscall wrappers. Today (2001-04-26) had precisely such a problem with __NR_setitimer. */ - tl_assert(SK_(cheap_sanity_check)()); + tl_assert(TL_(cheap_sanity_check)()); VGP_POPCC(VgpSetMem); } @@ -949,7 +949,7 @@ void ac_fpu_ACCESS_check_SLOWLY ( Addr addr, SizeT size, Bool isWrite ) /*--- Our instrumenter ---*/ /*------------------------------------------------------------*/ -UCodeBlock* SK_(instrument)(UCodeBlock* cb_in, Addr orig_addr) +UCodeBlock* TL_(instrument)(UCodeBlock* cb_in, Addr orig_addr) { /* Use this rather than eg. -1 because it's a UInt. */ #define INVALID_DATA_SIZE 999999 @@ -980,7 +980,7 @@ UCodeBlock* SK_(instrument)(UCodeBlock* cb_in, Addr orig_addr) case 2: helper = (Addr)ac_helperc_LOAD2; break; case 1: helper = (Addr)ac_helperc_LOAD1; break; default: VG_(tool_panic) - ("addrcheck::SK_(instrument):LOAD"); + ("addrcheck::TL_(instrument):LOAD"); } uInstr1(cb, CCALL, 0, TempReg, u_in->val1); uCCall (cb, helper, 1, 1, False ); @@ -993,7 +993,7 @@ UCodeBlock* SK_(instrument)(UCodeBlock* cb_in, Addr orig_addr) case 2: helper = (Addr)ac_helperc_STORE2; break; case 1: helper = (Addr)ac_helperc_STORE1; break; default: VG_(tool_panic) - ("addrcheck::SK_(instrument):STORE"); + ("addrcheck::TL_(instrument):STORE"); } uInstr1(cb, CCALL, 0, TempReg, u_in->val2); uCCall (cb, helper, 1, 1, False ); @@ -1133,13 +1133,13 @@ static void ac_detect_memory_leaks ( void ) Sanity check machinery (permanently engaged). ------------------------------------------------------------------ */ -Bool SK_(cheap_sanity_check) ( void ) +Bool TL_(cheap_sanity_check) ( void ) { /* nothing useful we can rapidly check */ return True; } -Bool SK_(expensive_sanity_check) ( void ) +Bool TL_(expensive_sanity_check) ( void ) { Int i; @@ -1161,7 +1161,7 @@ Bool SK_(expensive_sanity_check) ( void ) /*--- Client requests ---*/ /*------------------------------------------------------------*/ -Bool SK_(handle_client_request) ( ThreadId tid, UWord* arg, UWord *ret ) +Bool TL_(handle_client_request) ( ThreadId tid, UWord* arg, UWord *ret ) { #define IGNORE(what) \ do { \ @@ -1230,17 +1230,17 @@ Bool SK_(handle_client_request) ( ThreadId tid, UWord* arg, UWord *ret ) /*--- Setup ---*/ /*------------------------------------------------------------*/ -Bool SK_(process_cmd_line_option)(Char* arg) +Bool TL_(process_cmd_line_option)(Char* arg) { return MAC_(process_common_cmd_line_option)(arg); } -void SK_(print_usage)(void) +void TL_(print_usage)(void) { MAC_(print_common_usage)(); } -void SK_(print_debug_usage)(void) +void TL_(print_debug_usage)(void) { MAC_(print_common_debug_usage)(); } @@ -1250,7 +1250,7 @@ void SK_(print_debug_usage)(void) /*--- Setup ---*/ /*------------------------------------------------------------*/ -void SK_(pre_clo_init)(void) +void TL_(pre_clo_init)(void) { VG_(details_name) ("Addrcheck"); VG_(details_version) (NULL); @@ -1325,16 +1325,16 @@ void SK_(pre_clo_init)(void) MAC_(common_pre_clo_init)(); } -void SK_(post_clo_init) ( void ) +void TL_(post_clo_init) ( void ) { } -void SK_(fini) ( Int exitcode ) +void TL_(fini) ( Int exitcode ) { MAC_(common_fini)( ac_detect_memory_leaks ); } -VG_DETERMINE_INTERFACE_VERSION(SK_(pre_clo_init), 1./8) +VG_DETERMINE_INTERFACE_VERSION(TL_(pre_clo_init), 1./8) /*--------------------------------------------------------------------*/ diff --git a/cachegrind/cg_main.c b/cachegrind/cg_main.c index 983260531f..1a028be8e5 100644 --- a/cachegrind/cg_main.c +++ b/cachegrind/cg_main.c @@ -491,7 +491,7 @@ void end_of_x86_instr(UCodeBlock* cb, instr_info* i_node, Bool bb_seen_before, uCCall(cb, helper, argc, argc, False); } -UCodeBlock* SK_(instrument)(UCodeBlock* cb_in, Addr orig_addr) +UCodeBlock* TL_(instrument)(UCodeBlock* cb_in, Addr orig_addr) { UCodeBlock* cb; UInstr* u_in; @@ -762,7 +762,7 @@ void configure_caches(cache_t* I1c, cache_t* D1c, cache_t* L2c) } /*------------------------------------------------------------*/ -/*--- SK_(fini)() and related function ---*/ +/*--- TL_(fini)() and related function ---*/ /*------------------------------------------------------------*/ // Total reads/writes/misses. Calculated during CC traversal at the end. @@ -901,7 +901,7 @@ void percentify(Int n, Int ex, Int field_width, char buf[]) for (i = 0; i < space; i++) buf[i] = ' '; } -void SK_(fini)(Int exitcode) +void TL_(fini)(Int exitcode) { static char buf1[128], buf2[128], buf3[128], fmt [128]; @@ -1024,7 +1024,7 @@ void SK_(fini)(Int exitcode) /*--------------------------------------------------------------------*/ // Called when a translation is invalidated due to code unloading. -void SK_(discard_basic_block_info) ( Addr a, SizeT size ) +void TL_(discard_basic_block_info) ( Addr a, SizeT size ) { VgHashNode** prev_next_ptr; VgHashNode* bb_info; @@ -1074,7 +1074,7 @@ static void parse_cache_opt ( cache_t* cache, char* opt ) VG_(bad_option)(opt); } -Bool SK_(process_cmd_line_option)(Char* arg) +Bool TL_(process_cmd_line_option)(Char* arg) { // 5 is length of "--I1=" if (VG_CLO_STREQN(5, arg, "--I1=")) @@ -1089,7 +1089,7 @@ Bool SK_(process_cmd_line_option)(Char* arg) return True; } -void SK_(print_usage)(void) +void TL_(print_usage)(void) { VG_(printf)( " --I1=,, set I1 cache manually\n" @@ -1098,7 +1098,7 @@ void SK_(print_usage)(void) ); } -void SK_(print_debug_usage)(void) +void TL_(print_debug_usage)(void) { VG_(printf)( " (none)\n" @@ -1109,7 +1109,7 @@ void SK_(print_debug_usage)(void) /*--- Setup ---*/ /*--------------------------------------------------------------------*/ -void SK_(pre_clo_init)(void) +void TL_(pre_clo_init)(void) { Char* base_dir = NULL; @@ -1141,7 +1141,7 @@ void SK_(pre_clo_init)(void) instr_info_table = VG_(HT_construct)(); } -void SK_(post_clo_init)(void) +void TL_(post_clo_init)(void) { cache_t I1c, D1c, L2c; @@ -1156,7 +1156,7 @@ void SK_(post_clo_init)(void) VGP_(register_profile_event)(VgpCacheResults, "cache-results"); } -VG_DETERMINE_INTERFACE_VERSION(SK_(pre_clo_init), 0) +VG_DETERMINE_INTERFACE_VERSION(TL_(pre_clo_init), 0) /*--------------------------------------------------------------------*/ /*--- end cg_main.c ---*/ diff --git a/corecheck/cc_main.c b/corecheck/cc_main.c index fc3e1c7d00..218d05575c 100644 --- a/corecheck/cc_main.c +++ b/corecheck/cc_main.c @@ -31,7 +31,7 @@ #include "tool.h" -void SK_(pre_clo_init)(void) +void TL_(pre_clo_init)(void) { VG_(details_name) ("Coregrind"); VG_(details_version) (NULL); @@ -45,18 +45,18 @@ void SK_(pre_clo_init)(void) /* No core events to track */ } -VG_DETERMINE_INTERFACE_VERSION(SK_(pre_clo_init), 0) +VG_DETERMINE_INTERFACE_VERSION(TL_(pre_clo_init), 0) -void SK_(post_clo_init)(void) +void TL_(post_clo_init)(void) { } -UCodeBlock* SK_(instrument)(UCodeBlock* cb, Addr a) +UCodeBlock* TL_(instrument)(UCodeBlock* cb, Addr a) { return cb; } -void SK_(fini)(Int exitcode) +void TL_(fini)(Int exitcode) { } diff --git a/coregrind/core.h b/coregrind/core.h index 4ad5b6c952..4988c03a14 100644 --- a/coregrind/core.h +++ b/coregrind/core.h @@ -96,8 +96,8 @@ typedef struct _ThreadState ThreadState; #include "valgrind.h" -#undef SK_ -#define SK_(x) vgSkinInternal_##x +#undef TL_ +#define TL_(x) vgToolInternal_##x /* --------------------------------------------------------------------- @@ -1649,10 +1649,10 @@ GEN_SYSCALL_WRAPPER(sys_mq_getsetattr); // * P? // Macros used in syscall wrappers #define PRRSN \ - SK_(pre_reg_read)(Vg_CoreSysCall, tid, "(syscallno)", \ + TL_(pre_reg_read)(Vg_CoreSysCall, tid, "(syscallno)", \ R_SYSCALL_NUM, sizeof(UWord)); #define PRRAn(n,s,t,a) \ - SK_(pre_reg_read)(Vg_CoreSysCall, tid, s"("#a")", \ + TL_(pre_reg_read)(Vg_CoreSysCall, tid, s"("#a")", \ R_SYSCALL_ARG##n, sizeof(t)); #define PRE_REG_READ0(tr, s) \ if (VG_(defined_pre_reg_read)()) { \ @@ -1772,7 +1772,7 @@ extern const Int VG_(tramp_syscall_offset); #define VG_TRACK(fn, args...) \ do { \ if (VG_(defined_##fn)()) \ - SK_(fn)(args); \ + TL_(fn)(args); \ } while(0) __attribute__ ((noreturn)) diff --git a/coregrind/docs/coregrind_tools.html b/coregrind/docs/coregrind_tools.html index 34b07ba3f9..90203ae7c2 100644 --- a/coregrind/docs/coregrind_tools.html +++ b/coregrind/docs/coregrind_tools.html @@ -294,7 +294,7 @@ This is achieved by packaging each tool into a separate shared object which is then loaded ahead of the core shared object valgrind.so, using the dynamic linker's LD_PRELOAD variable. Any functions defined in the tool that share the name with a function defined in core (such as -the instrumentation function SK_(instrument)()) override the +the instrumentation function TL_(instrument)()) override the core's definition. Thus the core can call the necessary tool functions.

This magic is all done for you; the shared object used is chosen with the @@ -360,7 +360,7 @@ In what follows, all filenames are relative to Valgrind's top-level directory

  • Copy none/nl_main.c into foobar/, renaming it as fb_main.c. - Edit it by changing the lines in SK_(pre_clo_init)() + Edit it by changing the lines in TL_(pre_clo_init)() to something appropriate for the tool. These fields are used in the startup message, except for bug_reports_to which is used if a tool assertion fails. @@ -420,10 +420,10 @@ interesting stuff... A tool must define at least these four functions:
    -    SK_(pre_clo_init)()
    -    SK_(post_clo_init)()
    -    SK_(instrument)()
    -    SK_(fini)()
    +    TL_(pre_clo_init)()
    +    TL_(post_clo_init)()
    +    TL_(instrument)()
    +    TL_(fini)()
     
    Also, it must use the macro VG_DETERMINE_INTERFACE_VERSION @@ -438,8 +438,8 @@ the core, it may have to define other functions.

    2.7  Initialisation

    -Most of the initialisation should be done in SK_(pre_clo_init)(). -Only use SK_(post_clo_init)() if a tool provides command line +Most of the initialisation should be done in TL_(pre_clo_init)(). +Only use TL_(post_clo_init)() if a tool provides command line options and must do some initialisation after option processing takes place (``clo'' stands for ``command line options'').

    @@ -483,7 +483,7 @@ found in include/tool.h.

    2.8  Instrumentation

    -SK_(instrument)() is the interesting one. It allows you to +TL_(instrument)() is the interesting one. It allows you to instrument UCode, which is Valgrind's RISC-like intermediate language. UCode is described in the technical docs for Memcheck. @@ -530,9 +530,9 @@ should hopefully be enough to get you going. But ultimately, the tools distributed (Memcheck, Addrcheck, Cachegrind, Lackey, etc.) are probably the best documentation of all, for the moment.

    -Note that the VG_ and SK_ macros are used heavily. +Note that the VG_ and TL_ macros are used heavily. These just prepend longer strings in front of names to avoid potential -namespace clashes. We strongly recommend using the SK_ macro for +namespace clashes. We strongly recommend using the TL_ macro for any global functions and variables in your tool, or writing a similar macro.

    diff --git a/coregrind/gen_toolint.pl b/coregrind/gen_toolint.pl index 95f93c1bf8..841396a906 100644 --- a/coregrind/gen_toolint.pl +++ b/coregrind/gen_toolint.pl @@ -36,9 +36,9 @@ my $generate; my $struct = "VG_(tool_interface)"; -my %pfxmap = ("track" => "SK_", - "tool" => "SK_", - "malloc"=> "SK_", +my %pfxmap = ("track" => "TL_", + "tool" => "TL_", + "malloc"=> "TL_", ); sub getargnames(@) { @@ -152,7 +152,7 @@ void VG_(init_$func)($ret (*func)($args)) func = missing_${pfx}_$func; if (VG_(defined_$func)()) VG_(printf)("Warning tool is redefining $func\\n"); - if (func == SK_($func)) + if (func == TL_($func)) VG_(printf)("Warning tool is defining $func recursively\\n"); $struct.${pfx}_$func = func; } @@ -183,7 +183,7 @@ EOF my $args = join ", ", getargtypes(@args); print <extra && 0 != extra_size) { @@ -578,10 +578,10 @@ Bool VG_(unique_error) ( ThreadId tid, ErrorKind ekind, Addr a, Char* s, /* Unless it's suppressed, we're going to show it. Don't need to make a copy, because it's only temporary anyway. - Then update the `extra' part with SK_(update_extra), because that can + Then update the `extra' part with TL_(update_extra), because that can have an affect on whether it's suppressed. Ignore the size return - value of SK_(update_extra), because we're not copying `extra'. */ - (void)SK_(update_extra)(&err); + value of TL_(update_extra), because we're not copying `extra'. */ + (void)TL_(update_extra)(&err); if (NULL == is_suppressible_error(&err)) { if (count_error) @@ -846,7 +846,7 @@ static void load_one_suppressions_file ( Char* filename ) else if (VG_(needs).tool_errors && tool_name_present(VG_(details).name, tool_names)) { - if (SK_(recognised_suppression)(supp_name, supp)) + if (TL_(recognised_suppression)(supp_name, supp)) { /* Do nothing, function fills in supp->skind */ } else @@ -865,7 +865,7 @@ static void load_one_suppressions_file ( Char* filename ) } if (VG_(needs).tool_errors && - !SK_(read_extra_suppression_info)(fd, buf, N_BUF, supp)) + !TL_(read_extra_suppression_info)(fd, buf, N_BUF, supp)) goto syntax_error; /* "i > 0" ensures at least one caller read. */ @@ -957,7 +957,7 @@ Bool supp_matches_error(Supp* su, Error* err) return (err->ekind == PThreadErr); default: if (VG_(needs).tool_errors) { - return SK_(error_matches_suppression)(err, su); + return TL_(error_matches_suppression)(err, su); } else { VG_(printf)( "\nUnhandled suppression type: %u. VG_(needs).tool_errors\n" diff --git a/coregrind/vg_from_ucode.c b/coregrind/vg_from_ucode.c index 5f1fcc7601..cf747cd123 100644 --- a/coregrind/vg_from_ucode.c +++ b/coregrind/vg_from_ucode.c @@ -4427,7 +4427,7 @@ static void emitUInstr ( UCodeBlock* cb, Int i, emit_put_sse_state(); *sselive = False; } - SK_(emit_XUInstr)(u, regs_live_before); + TL_(emit_XUInstr)(u, regs_live_before); } else { VG_(printf)("\nError:\n" " unhandled opcode: %u. Perhaps " diff --git a/coregrind/vg_main.c b/coregrind/vg_main.c index 5a69316b7a..b7797ea0fe 100644 --- a/coregrind/vg_main.c +++ b/coregrind/vg_main.c @@ -1265,10 +1265,10 @@ static void load_tool( const char *toolname, void** handle_out, goto bad_load; } - toolinfo = dlsym(handle, "vgSkin_tool_info"); + toolinfo = dlsym(handle, "vgTool_tool_info"); ok = (NULL != toolinfo); if (!ok) { - fprintf(stderr, "Tool \"%s\" doesn't define SK_(tool_info) - " + fprintf(stderr, "Tool \"%s\" doesn't define TL_(tool_info) - " "add VG_DETERMINE_INTERFACE_VERSION?\n", toolname); goto bad_load; } @@ -1606,7 +1606,7 @@ void usage ( Bool debug_help ) if (VG_(details).name) { VG_(printf)(" user options for %s:\n", VG_(details).name); if (VG_(needs).command_line_options) - SK_(print_usage)(); + TL_(print_usage)(); else VG_(printf)(" (none)\n"); } @@ -1617,7 +1617,7 @@ void usage ( Bool debug_help ) VG_(printf)(" debugging options for %s:\n", VG_(details).name); if (VG_(needs).command_line_options) - SK_(print_debug_usage)(); + TL_(print_debug_usage)(); else VG_(printf)(" (none)\n"); } @@ -1837,7 +1837,7 @@ static void process_cmd_line_options( UInt* client_auxv, const char* toolname ) VG_(clo_trace_pthread_level) = 2; else if ( ! VG_(needs).command_line_options - || ! SK_(process_cmd_line_option)(arg) ) { + || ! TL_(process_cmd_line_option)(arg) ) { VG_(bad_option)(arg); } } @@ -2428,7 +2428,7 @@ void VG_(sanity_check_general) ( Bool force_expensive ) last 16 pages of memory have become accessible [...] */ if (VG_(needs).sanity_checks) { VGP_PUSHCC(VgpToolCheapSanity); - vg_assert(SK_(cheap_sanity_check)()); + vg_assert(TL_(cheap_sanity_check)()); VGP_POPCC(VgpToolCheapSanity); } @@ -2453,7 +2453,7 @@ void VG_(sanity_check_general) ( Bool force_expensive ) if (VG_(needs).sanity_checks) { VGP_PUSHCC(VgpToolExpensiveSanity); - vg_assert(SK_(expensive_sanity_check)()); + vg_assert(TL_(expensive_sanity_check)()); VGP_POPCC(VgpToolExpensiveSanity); } /* @@ -2726,7 +2726,7 @@ int main(int argc, char **argv) } process_cmd_line_options(client_auxv, tool); - SK_(post_clo_init)(); + TL_(post_clo_init)(); //-------------------------------------------------------------- // Build segment map (all segments) @@ -2881,7 +2881,7 @@ int main(int argc, char **argv) if (VG_(needs).core_errors || VG_(needs).tool_errors) VG_(show_all_errors)(); - SK_(fini)( exitcode ); + TL_(fini)( exitcode ); VG_(sanity_check_general)( True /*include expensive checks*/ ); diff --git a/coregrind/vg_needs.c b/coregrind/vg_needs.c index 07a9342ece..cbf6fa4c33 100644 --- a/coregrind/vg_needs.c +++ b/coregrind/vg_needs.c @@ -121,7 +121,7 @@ void VG_(sanity_check_needs) ( void) else VG_(printf)("\nTool error: tool didn't allocate shadow memory, but apparently " "needs it.\n"); - VG_(tool_panic)("VG_(needs).shadow_memory need should be set to match SK_(shadow_ratio)\n"); + VG_(tool_panic)("VG_(needs).shadow_memory need should be set to match TL_(shadow_ratio)\n"); } #undef CHECK_NOT diff --git a/coregrind/vg_replace_malloc.c.base b/coregrind/vg_replace_malloc.c.base index ec8023ff26..10a5658f0b 100644 --- a/coregrind/vg_replace_malloc.c.base +++ b/coregrind/vg_replace_malloc.c.base @@ -38,7 +38,7 @@ This file can be linked into the injected so file for any tool that wishes to know about calls to malloc(). It should define functions - SK_(malloc) et al that will be called. + TL_(malloc) et al that will be called. ------------------------------------------------------------------ */ #include "valgrind.h" /* for VALGRIND_NON_SIMD_CALL[12] */ diff --git a/coregrind/vg_scheduler.c b/coregrind/vg_scheduler.c index d6e64fd463..a986e2b230 100644 --- a/coregrind/vg_scheduler.c +++ b/coregrind/vg_scheduler.c @@ -2933,23 +2933,23 @@ void do_client_request ( ThreadId tid, UWord* arg ) /* Note: for tools that replace malloc() et al, we want to call the replacement versions. For those that don't, we want to call - VG_(cli_malloc)() et al. We do this by calling SK_(malloc)(), which + VG_(cli_malloc)() et al. We do this by calling TL_(malloc)(), which malloc-replacing tools must replace, but have the default definition - of SK_(malloc)() call VG_(cli_malloc)(). */ + of TL_(malloc)() call VG_(cli_malloc)(). */ /* Note: for MALLOC and FREE, must set the appropriate "lock"... see - the comment in vg_defaults.c/SK_(malloc)() for why. */ + the comment in vg_defaults.c/TL_(malloc)() for why. */ case VG_USERREQ__MALLOC: VG_(sk_malloc_called_by_scheduler) = True; SET_PTHREQ_RETVAL( - tid, (Addr)SK_(malloc) ( arg[1] ) + tid, (Addr)TL_(malloc) ( arg[1] ) ); VG_(sk_malloc_called_by_scheduler) = False; break; case VG_USERREQ__FREE: VG_(sk_malloc_called_by_scheduler) = True; - SK_(free) ( (void*)arg[1] ); + TL_(free) ( (void*)arg[1] ); VG_(sk_malloc_called_by_scheduler) = False; SET_PTHREQ_RETVAL(tid, 0); /* irrelevant */ break; @@ -3190,15 +3190,15 @@ void do_client_request ( ThreadId tid, UWord* arg ) case VG_USERREQ__GET_MALLOCFUNCS: { struct vg_mallocfunc_info *info = (struct vg_mallocfunc_info *)arg[1]; - info->sk_malloc = (Addr)SK_(malloc); - info->sk_calloc = (Addr)SK_(calloc); - info->sk_realloc = (Addr)SK_(realloc); - info->sk_memalign = (Addr)SK_(memalign); - info->sk___builtin_new = (Addr)SK_(__builtin_new); - info->sk___builtin_vec_new = (Addr)SK_(__builtin_vec_new); - info->sk_free = (Addr)SK_(free); - info->sk___builtin_delete = (Addr)SK_(__builtin_delete); - info->sk___builtin_vec_delete = (Addr)SK_(__builtin_vec_delete); + info->sk_malloc = (Addr)TL_(malloc); + info->sk_calloc = (Addr)TL_(calloc); + info->sk_realloc = (Addr)TL_(realloc); + info->sk_memalign = (Addr)TL_(memalign); + info->sk___builtin_new = (Addr)TL_(__builtin_new); + info->sk___builtin_vec_new = (Addr)TL_(__builtin_vec_new); + info->sk_free = (Addr)TL_(free); + info->sk___builtin_delete = (Addr)TL_(__builtin_delete); + info->sk___builtin_vec_delete = (Addr)TL_(__builtin_vec_delete); info->arena_payload_szB = (Addr)VG_(arena_payload_szB); @@ -3235,7 +3235,7 @@ void do_client_request ( ThreadId tid, UWord* arg ) VG_(printf)("client request: code %x, addr %p, len %d\n", arg[0], (void*)arg[1], arg[2] ); - if (SK_(handle_client_request) ( tid, arg, &ret )) + if (TL_(handle_client_request) ( tid, arg, &ret )) SET_CLREQ_RETVAL(tid, ret); } else { static Bool whined = False; diff --git a/coregrind/vg_syscalls.c b/coregrind/vg_syscalls.c index c2898f77cc..36ab5956a8 100644 --- a/coregrind/vg_syscalls.c +++ b/coregrind/vg_syscalls.c @@ -858,7 +858,7 @@ void buf_and_len_pre_check( ThreadId tid, Addr buf_p, Addr buflen_p, if (VG_(defined_pre_mem_write)()) { UInt buflen_in = deref_UInt( tid, buflen_p, buflen_s); if (buflen_in > 0) { - SK_(pre_mem_write) ( Vg_CoreSysCall, + TL_(pre_mem_write) ( Vg_CoreSysCall, tid, buf_s, buf_p, buflen_in ); } } @@ -871,7 +871,7 @@ void buf_and_len_post_check( ThreadId tid, Int res, if (!VG_(is_kerror)(res) && VG_(defined_post_mem_write)()) { UInt buflen_out = deref_UInt( tid, buflen_p, s); if (buflen_out > 0 && buf_p != (Addr)NULL) { - SK_(post_mem_write) ( buf_p, buflen_out ); + TL_(post_mem_write) ( buf_p, buflen_out ); } } } @@ -5794,7 +5794,7 @@ Bool VG_(pre_syscall) ( ThreadId tid ) /* Do any pre-syscall actions */ if (VG_(needs).syscall_wrapper) { VGP_PUSHCC(VgpToolSysWrap); - tst->sys_pre_res = SK_(pre_syscall)(tid, syscallno, mayBlock); + tst->sys_pre_res = TL_(pre_syscall)(tid, syscallno, mayBlock); VGP_POPCC(VgpToolSysWrap); } @@ -5927,7 +5927,7 @@ void VG_(post_syscall) ( ThreadId tid, Bool restart ) */ if (VG_(needs).syscall_wrapper) { VGP_PUSHCC(VgpToolSysWrap); - SK_(post_syscall)(tid, syscallno, pre_res, res, /*isBlocking*/True); // did block + TL_(post_syscall)(tid, syscallno, pre_res, res, /*isBlocking*/True); // did block VGP_POPCC(VgpToolSysWrap); } } diff --git a/coregrind/vg_translate.c b/coregrind/vg_translate.c index 264a9da994..a652708b33 100644 --- a/coregrind/vg_translate.c +++ b/coregrind/vg_translate.c @@ -632,7 +632,7 @@ static Bool is_sane_UInstr ( UInstr* u ) return SZ48 && CC0 && TR1 && TR2 && N3 && XOTHER; default: if (VG_(needs).extended_UCode) - return SK_(sane_XUInstr)(beforeRA, beforeLiveness, u); + return TL_(sane_XUInstr)(beforeRA, beforeLiveness, u); else { VG_(printf)("unhandled opcode: %u. Perhaps " "VG_(needs).extended_UCode should be set?", @@ -989,7 +989,7 @@ Char* VG_(name_UOpcode) ( Bool upper, Opcode opc ) case SSE3ag_MemRd_RegWr: return "SSE3ag_MemRd_RegWr"; default: if (VG_(needs).extended_UCode) - return SK_(name_XUOpcode)(opc); + return TL_(name_XUOpcode)(opc); else { VG_(printf)("unhandled opcode: %u. Perhaps " "VG_(needs).extended_UCode should be set?", @@ -1297,7 +1297,7 @@ void pp_UInstrWorker ( Int instrNo, UInstr* u, Bool ppRegsLiveness ) default: if (VG_(needs).extended_UCode) - SK_(pp_XUInstr)(u); + TL_(pp_XUInstr)(u); else { VG_(printf)("unhandled opcode: %u. Perhaps " "VG_(needs).extended_UCode should be set?", @@ -1441,7 +1441,7 @@ Int VG_(get_reg_usage) ( UInstr* u, Tag tag, Int* regs, Bool* isWrites ) default: if (VG_(needs).extended_UCode) - return SK_(get_Xreg_usage)(u, tag, regs, isWrites); + return TL_(get_Xreg_usage)(u, tag, regs, isWrites); else { VG_(printf)("unhandled opcode: %u. Perhaps " "VG_(needs).extended_UCode should be set?", @@ -2525,10 +2525,10 @@ Bool VG_(translate) ( ThreadId tid, Addr orig_addr, } /* Tool's instrumentation (Nb: must set VG_(print_codegen) in case - SK_(instrument) looks at it. */ + TL_(instrument) looks at it. */ VG_(print_codegen) = DECIDE_IF_PRINTING_CODEGEN_FOR_PHASE(3); VGP_PUSHCC(VgpInstrument); - cb = SK_(instrument) ( cb, orig_addr ); + cb = TL_(instrument) ( cb, orig_addr ); if (VG_(print_codegen)) VG_(pp_UCodeBlock) ( cb, "Instrumented UCode:" ); sanity_check_UCodeBlock( cb ); diff --git a/coregrind/vg_transtab.c b/coregrind/vg_transtab.c index eaca9729b0..684952656e 100644 --- a/coregrind/vg_transtab.c +++ b/coregrind/vg_transtab.c @@ -656,7 +656,7 @@ void VG_(invalidate_translations) ( Addr start, UInt range, Bool unchain_blocks continue; if (VG_(needs).basic_block_discards) - SK_(discard_basic_block_info)( tce->orig_addr, + TL_(discard_basic_block_info)( tce->orig_addr, tce->orig_size ); vg_tt[i].orig_addr = VG_TTE_DELETED; diff --git a/helgrind/hg_main.c b/helgrind/hg_main.c index 36015f9b8c..a759edafae 100644 --- a/helgrind/hg_main.c +++ b/helgrind/hg_main.c @@ -1655,7 +1655,7 @@ void set_address_range_state ( Addr a, SizeT len /* in bytes */, -- this could happen with buggy syscall wrappers. Today (2001-04-26) had precisely such a problem with __NR_setitimer. */ - tl_assert(SK_(cheap_sanity_check)()); + tl_assert(TL_(cheap_sanity_check)()); VGP_POPCC(VgpSARP); } @@ -1842,27 +1842,27 @@ void* alloc_and_new_mem ( SizeT size, SizeT alignment, Bool is_zeroed ) return (void*)p; } -void* SK_(malloc) ( SizeT n ) +void* TL_(malloc) ( SizeT n ) { return alloc_and_new_mem ( n, VG_(clo_alignment), /*is_zeroed*/False ); } -void* SK_(__builtin_new) ( SizeT n ) +void* TL_(__builtin_new) ( SizeT n ) { return alloc_and_new_mem ( n, VG_(clo_alignment), /*is_zeroed*/False ); } -void* SK_(__builtin_vec_new) ( SizeT n ) +void* TL_(__builtin_vec_new) ( SizeT n ) { return alloc_and_new_mem ( n, VG_(clo_alignment), /*is_zeroed*/False ); } -void* SK_(memalign) ( SizeT align, SizeT n ) +void* TL_(memalign) ( SizeT align, SizeT n ) { return alloc_and_new_mem ( n, align, /*is_zeroed*/False ); } -void* SK_(calloc) ( SizeT nmemb, SizeT size ) +void* TL_(calloc) ( SizeT nmemb, SizeT size ) { return alloc_and_new_mem ( nmemb*size, VG_(clo_alignment), /*is_zeroed*/True ); @@ -1929,22 +1929,22 @@ void handle_free ( void* p ) hc, prev_chunks_next_ptr ); } -void SK_(free) ( void* p ) +void TL_(free) ( void* p ) { handle_free(p); } -void SK_(__builtin_delete) ( void* p ) +void TL_(__builtin_delete) ( void* p ) { handle_free(p); } -void SK_(__builtin_vec_delete) ( void* p ) +void TL_(__builtin_vec_delete) ( void* p ) { handle_free(p); } -void* SK_(realloc) ( void* p, SizeT new_size ) +void* TL_(realloc) ( void* p, SizeT new_size ) { HG_Chunk *hc; HG_Chunk **prev_chunks_next_ptr; @@ -2002,13 +2002,13 @@ void* SK_(realloc) ( void* p, SizeT new_size ) /*--- Machinery to support sanity checking ---*/ /*--------------------------------------------------------------*/ -Bool SK_(cheap_sanity_check) ( void ) +Bool TL_(cheap_sanity_check) ( void ) { /* nothing useful we can rapidly check */ return True; } -Bool SK_(expensive_sanity_check)(void) +Bool TL_(expensive_sanity_check)(void) { Int i; @@ -2030,7 +2030,7 @@ static UInt stk_ld, nonstk_ld, stk_st, nonstk_st; /* Create and return an instrumented version of cb_in. Free cb_in before returning. */ -UCodeBlock* SK_(instrument) ( UCodeBlock* cb_in, Addr not_used ) +UCodeBlock* TL_(instrument) ( UCodeBlock* cb_in, Addr not_used ) { UCodeBlock* cb; Int i; @@ -2462,7 +2462,7 @@ static void describe_addr ( Addr a, AddrInfo* ai ) /* Updates the copy with address info if necessary. */ -UInt SK_(update_extra)(Error* err) +UInt TL_(update_extra)(Error* err) { HelgrindError* extra; @@ -2536,7 +2536,7 @@ static void record_lockgraph_error(ThreadId tid, Mutex *mutex, VG_(maybe_record_error)(tid, LockGraphErr, mutex->mutexp, "", &err_extra); } -Bool SK_(eq_Error) ( VgRes not_used, Error* e1, Error* e2 ) +Bool TL_(eq_Error) ( VgRes not_used, Error* e1, Error* e2 ) { Char *e1s, *e2s; @@ -2645,7 +2645,7 @@ static Char *lockset_str(const Char *prefix, const LockSet *lockset) return buf; } -void SK_(pp_Error) ( Error* err ) +void TL_(pp_Error) ( Error* err ) { HelgrindError *extra = (HelgrindError *)VG_(get_error_extra)(err); Char buf[100]; @@ -2777,7 +2777,7 @@ void SK_(pp_Error) ( Error* err ) } -Bool SK_(recognised_suppression) ( Char* name, Supp *su ) +Bool TL_(recognised_suppression) ( Char* name, Supp *su ) { if (0 == VG_(strcmp)(name, "Eraser")) { VG_(set_supp_kind)(su, EraserSupp); @@ -2788,7 +2788,7 @@ Bool SK_(recognised_suppression) ( Char* name, Supp *su ) } -Bool SK_(read_extra_suppression_info) ( Int fd, Char* buf, Int nBuf, Supp* su ) +Bool TL_(read_extra_suppression_info) ( Int fd, Char* buf, Int nBuf, Supp* su ) { /* do nothing -- no extra suppression info present. Return True to indicate nothing bad happened. */ @@ -2796,14 +2796,14 @@ Bool SK_(read_extra_suppression_info) ( Int fd, Char* buf, Int nBuf, Supp* su ) } -Bool SK_(error_matches_suppression)(Error* err, Supp* su) +Bool TL_(error_matches_suppression)(Error* err, Supp* su) { tl_assert(VG_(get_supp_kind)(su) == EraserSupp); return (VG_(get_error_kind)(err) == EraserErr); } -extern Char* SK_(get_error_name) ( Error* err ) +extern Char* TL_(get_error_name) ( Error* err ) { if (EraserErr == VG_(get_error_kind)(err)) { return "Eraser"; @@ -2812,7 +2812,7 @@ extern Char* SK_(get_error_name) ( Error* err ) } } -extern void SK_(print_extra_suppression_info) ( Error* err ) +extern void TL_(print_extra_suppression_info) ( Error* err ) { /* Do nothing */ } @@ -3233,7 +3233,7 @@ static void bus_unlock(void) /*--- Client requests ---*/ /*--------------------------------------------------------------------*/ -Bool SK_(handle_client_request)(ThreadId tid, UWord *args, UWord *ret) +Bool TL_(handle_client_request)(ThreadId tid, UWord *args, UWord *ret) { if (!VG_IS_SKIN_USERREQ('H','G',args[0])) return False; @@ -3261,7 +3261,7 @@ Bool SK_(handle_client_request)(ThreadId tid, UWord *args, UWord *ret) /*--- Setup ---*/ /*--------------------------------------------------------------------*/ -void SK_(pre_clo_init)(void) +void TL_(pre_clo_init)(void) { Int i; LockSet *empty; @@ -3340,7 +3340,7 @@ void SK_(pre_clo_init)(void) hg_malloc_list = VG_(HT_construct)(); } -Bool SK_(process_cmd_line_option)(Char* arg) +Bool TL_(process_cmd_line_option)(Char* arg) { if (VG_CLO_STREQ(arg, "--show-last-access=no")) clo_execontext = EC_None; @@ -3357,7 +3357,7 @@ Bool SK_(process_cmd_line_option)(Char* arg) return True; } -void SK_(print_usage)(void) +void TL_(print_usage)(void) { VG_(printf)( " --private-stacks=yes|no assume thread stacks are used privately [no]\n" @@ -3367,12 +3367,12 @@ void SK_(print_usage)(void) VG_(replacement_malloc_print_usage)(); } -void SK_(print_debug_usage)(void) +void TL_(print_debug_usage)(void) { VG_(replacement_malloc_print_debug_usage)(); } -void SK_(post_clo_init)(void) +void TL_(post_clo_init)(void) { void (*stack_tracker)(Addr a, SizeT len); @@ -3391,7 +3391,7 @@ void SK_(post_clo_init)(void) } -void SK_(fini)(Int exitcode) +void TL_(fini)(Int exitcode) { if (DEBUG_LOCK_TABLE) { pp_all_LockSets(); @@ -3399,7 +3399,7 @@ void SK_(fini)(Int exitcode) } if (LOCKSET_SANITY) - sanity_check_locksets("SK_(fini)"); + sanity_check_locksets("TL_(fini)"); if (VG_(clo_verbosity) > 0) VG_(message)(Vg_UserMsg, "%u possible data races found; %u lock order problems", @@ -3413,7 +3413,7 @@ void SK_(fini)(Int exitcode) } /* Uses a 1:1 mapping */ -VG_DETERMINE_INTERFACE_VERSION(SK_(pre_clo_init), 1.0) +VG_DETERMINE_INTERFACE_VERSION(TL_(pre_clo_init), 1.0) /*--------------------------------------------------------------------*/ /*--- end hg_main.c ---*/ diff --git a/include/tool.h.base b/include/tool.h.base index 747ec88c11..6feb534a88 100644 --- a/include/tool.h.base +++ b/include/tool.h.base @@ -111,7 +111,7 @@ typedef struct _ToolInfo { /* Every tool must include this macro somewhere, exactly once. */ #define VG_DETERMINE_INTERFACE_VERSION(pre_clo_init, shadow) \ - const ToolInfo SK_(tool_info) = { \ + const ToolInfo TL_(tool_info) = { \ .sizeof_ToolInfo = sizeof(ToolInfo), \ .interface_major_version = VG_CORE_INTERFACE_MAJOR_VERSION, \ .interface_minor_version = VG_CORE_INTERFACE_MINOR_VERSION, \ @@ -236,9 +236,9 @@ extern int VG_(vmessage) ( VgMsgKind kind, Char* format, va_list vargs ); VGP_PAIR(VgpPreCloInit, "pre-clo-init"), \ VGP_PAIR(VgpPostCloInit, "post-clo-init"), \ VGP_PAIR(VgpInstrument, "instrument"), \ - VGP_PAIR(VgpSkinSysWrap, "tool-syscall-wrapper"), \ - VGP_PAIR(VgpSkinCheapSanity, "tool-cheap-sanity"), \ - VGP_PAIR(VgpSkinExpensiveSanity, "tool-expensive-sanity"), \ + VGP_PAIR(VgpToolSysWrap, "tool-syscall-wrapper"), \ + VGP_PAIR(VgpToolCheapSanity, "tool-cheap-sanity"), \ + VGP_PAIR(VgpToolExpensiveSanity, "tool-expensive-sanity"), \ VGP_PAIR(VgpFini, "fini") #define VGP_PAIR(n,name) n @@ -1432,7 +1432,7 @@ typedef struct _Supp Supp; -/* Useful in SK_(error_matches_suppression)() */ +/* Useful in TL_(error_matches_suppression)() */ SuppKind VG_(get_supp_kind) ( Supp* su ); Char* VG_(get_supp_string) ( Supp* su ); void* VG_(get_supp_extra) ( Supp* su ); @@ -1465,7 +1465,7 @@ typedef struct _Error Error; -/* Useful in SK_(error_matches_suppression)(), SK_(pp_Error)(), etc */ +/* Useful in TL_(error_matches_suppression)(), TL_(pp_Error)(), etc */ ExeContext* VG_(get_error_where) ( Error* err ); SuppKind VG_(get_error_kind) ( Error* err ); Addr VG_(get_error_address) ( Error* err ); @@ -1716,12 +1716,12 @@ extern void *VG_(SkipNode_Next) (const SkipList *l, void *data); /* Nb: make sure the shadow_regs 'need' is set before using these! */ /* This one lets you override the shadow of the return value register for a - syscall. Call it from SK_(post_syscall)() (not SK_(pre_syscall)()!) to + syscall. Call it from TL_(post_syscall)() (not TL_(pre_syscall)()!) to override the default shadow register value. */ extern void VG_(set_return_from_syscall_shadow) ( ThreadId tid, UInt ret_shadow ); -/* This can be called from SK_(fini)() to find the shadow of the argument +/* This can be called from TL_(fini)() to find the shadow of the argument to exit(), ie. the shadow of the program's return value. */ extern UInt VG_(get_exit_status_shadow) ( void ); @@ -1740,11 +1740,11 @@ extern UInt VG_(get_exit_status_shadow) ( void ); UInt VG_(vg_malloc_redzone_szB) = 4; - It can't be done from a function like SK_(pre_clo_init)(). So it can't, + It can't be done from a function like TL_(pre_clo_init)(). So it can't, for example, be controlled with a command line option, unfortunately. */ extern UInt VG_(vg_malloc_redzone_szB); -/* Can be called from SK_(malloc) et al to do the actual alloc/freeing. */ +/* Can be called from TL_(malloc) et al to do the actual alloc/freeing. */ extern void* VG_(cli_malloc) ( SizeT align, SizeT nbytes ); extern void VG_(cli_free) ( void* p ); @@ -1854,11 +1854,11 @@ extern void VG_(needs_sanity_checks) ( void ); extern void VG_(needs_data_syms) ( void ); /* Does the tool need shadow memory allocated (if you set this, you must also statically initialize - float SK_(shadow_ratio) = n./m; + float TL_(shadow_ratio) = n./m; to define how many shadow bits you need per client address space bit. */ extern void VG_(needs_shadow_memory)( void ); -extern float SK_(shadow_ratio); +extern float TL_(shadow_ratio); /* ------------------------------------------------------------------ */ /* Core events to track */ diff --git a/include/tool_asm.h b/include/tool_asm.h index 9e0ea2acb9..db36a85324 100644 --- a/include/tool_asm.h +++ b/include/tool_asm.h @@ -46,7 +46,7 @@ #define VGA_(str) VGAPPEND(vgArch_,str) /* Tool-specific ones. Note that final name still starts with "vg". */ -#define SK_(str) VGAPPEND(vgSkin_,str) +#define TL_(str) VGAPPEND(vgTool_,str) /* This is specifically for stringifying VG_(x) function names. We need to do two macroexpansions to get the VG_ macro expanded before diff --git a/lackey/lk_main.c b/lackey/lk_main.c index 3eb4457c1e..540cd094c3 100644 --- a/lackey/lk_main.c +++ b/lackey/lk_main.c @@ -44,7 +44,7 @@ static void add_one_dlrr_call(void) n_dlrr_calls++; } -/* See comment above SK_(instrument) for reason why n_machine_instrs is +/* See comment above TL_(instrument) for reason why n_machine_instrs is incremented here. */ static void add_one_BB(void) { @@ -72,7 +72,7 @@ static void add_one_Jcc_untaken(void) n_Jccs_untaken++; } -void SK_(pre_clo_init)(void) +void TL_(pre_clo_init)(void) { VG_(details_name) ("Lackey"); VG_(details_version) (NULL); @@ -90,7 +90,7 @@ void SK_(pre_clo_init)(void) VG_(register_compact_helper)((Addr) & add_one_Jcc_untaken); } -void SK_(post_clo_init)(void) +void TL_(post_clo_init)(void) { } @@ -136,7 +136,7 @@ void SK_(post_clo_init)(void) Which gives us the right answer. And just to avoid two C calls, we fold the basic-block-beginning call in with add_one_BB(). Phew. */ -UCodeBlock* SK_(instrument)(UCodeBlock* cb_in, Addr orig_addr) +UCodeBlock* TL_(instrument)(UCodeBlock* cb_in, Addr orig_addr) { UCodeBlock* cb; Int i; @@ -192,7 +192,7 @@ UCodeBlock* SK_(instrument)(UCodeBlock* cb_in, Addr orig_addr) return cb; } -void SK_(fini)(Int exitcode) +void TL_(fini)(Int exitcode) { VG_(message)(Vg_UserMsg, "Counted %d calls to _dl_runtime_resolve()", n_dlrr_calls); @@ -222,7 +222,7 @@ void SK_(fini)(Int exitcode) VG_(message)(Vg_UserMsg, "Exit code: %d", exitcode); } -VG_DETERMINE_INTERFACE_VERSION(SK_(pre_clo_init), 0) +VG_DETERMINE_INTERFACE_VERSION(TL_(pre_clo_init), 0) /*--------------------------------------------------------------------*/ diff --git a/massif/ms_main.c b/massif/ms_main.c index 1cd5d5fdcb..6b3770a445 100644 --- a/massif/ms_main.c +++ b/massif/ms_main.c @@ -288,7 +288,7 @@ static Bool clo_stacks = True; static Bool clo_depth = 3; static XFormat clo_format = XText; -Bool SK_(process_cmd_line_option)(Char* arg) +Bool TL_(process_cmd_line_option)(Char* arg) { VG_BOOL_CLO("--heap", clo_heap) else VG_BOOL_CLO("--stacks", clo_stacks) @@ -316,7 +316,7 @@ Bool SK_(process_cmd_line_option)(Char* arg) return True; } -void SK_(print_usage)(void) +void TL_(print_usage)(void) { VG_(printf)( " --heap=no|yes profile heap blocks [yes]\n" @@ -329,7 +329,7 @@ void SK_(print_usage)(void) VG_(replacement_malloc_print_usage)(); } -void SK_(print_debug_usage)(void) +void TL_(print_debug_usage)(void) { VG_(replacement_malloc_print_debug_usage)(); } @@ -738,47 +738,47 @@ void die_block ( void* p, Bool custom_free ) } -void* SK_(malloc) ( SizeT n ) +void* TL_(malloc) ( SizeT n ) { return new_block( NULL, n, VG_(clo_alignment), /*is_zeroed*/False ); } -void* SK_(__builtin_new) ( SizeT n ) +void* TL_(__builtin_new) ( SizeT n ) { return new_block( NULL, n, VG_(clo_alignment), /*is_zeroed*/False ); } -void* SK_(__builtin_vec_new) ( SizeT n ) +void* TL_(__builtin_vec_new) ( SizeT n ) { return new_block( NULL, n, VG_(clo_alignment), /*is_zeroed*/False ); } -void* SK_(calloc) ( SizeT m, SizeT size ) +void* TL_(calloc) ( SizeT m, SizeT size ) { return new_block( NULL, m*size, VG_(clo_alignment), /*is_zeroed*/True ); } -void *SK_(memalign)( SizeT align, SizeT n ) +void *TL_(memalign)( SizeT align, SizeT n ) { return new_block( NULL, n, align, False ); } -void SK_(free) ( void* p ) +void TL_(free) ( void* p ) { die_block( p, /*custom_free*/False ); } -void SK_(__builtin_delete) ( void* p ) +void TL_(__builtin_delete) ( void* p ) { die_block( p, /*custom_free*/False); } -void SK_(__builtin_vec_delete) ( void* p ) +void TL_(__builtin_vec_delete) ( void* p ) { die_block( p, /*custom_free*/False ); } -void* SK_(realloc) ( void* p_old, SizeT new_size ) +void* TL_(realloc) ( void* p_old, SizeT new_size ) { HP_Chunk* hc; HP_Chunk** remove_handle; @@ -1128,7 +1128,7 @@ static void die_mem_stack_signal(Addr a, SizeT len) /*--- Client Requests ---*/ /*------------------------------------------------------------*/ -Bool SK_(handle_client_request) ( ThreadId tid, UWord* argv, UWord* ret ) +Bool TL_(handle_client_request) ( ThreadId tid, UWord* argv, UWord* ret ) { switch (argv[0]) { case VG_USERREQ__MALLOCLIKE_BLOCK: { @@ -1161,7 +1161,7 @@ static Char* base_dir; UInt VG_(vg_malloc_redzone_szB) = 0; -void SK_(pre_clo_init)() +void TL_(pre_clo_init)() { VG_(details_name) ("Massif"); VG_(details_version) (NULL); @@ -1199,7 +1199,7 @@ void SK_(pre_clo_init)() tl_assert( VG_(getcwd_alloc)(&base_dir) ); } -void SK_(post_clo_init)(void) +void TL_(post_clo_init)(void) { ms_interval = 1; @@ -1211,7 +1211,7 @@ void SK_(post_clo_init)(void) /*--- Instrumentation ---*/ /*------------------------------------------------------------*/ -UCodeBlock* SK_(instrument)(UCodeBlock* cb_in, Addr orig_addr) +UCodeBlock* TL_(instrument)(UCodeBlock* cb_in, Addr orig_addr) { return cb_in; } @@ -1792,7 +1792,7 @@ print_summary(ULong total_ST, ULong heap_ST, ULong heap_admin_ST, } } -void SK_(fini)(Int exit_status) +void TL_(fini)(Int exit_status) { ULong total_ST = 0; ULong heap_ST = 0; @@ -1810,7 +1810,7 @@ void SK_(fini)(Int exit_status) print_summary ( total_ST, heap_ST, heap_admin_ST, stack_ST ); } -VG_DETERMINE_INTERFACE_VERSION(SK_(pre_clo_init), 0) +VG_DETERMINE_INTERFACE_VERSION(TL_(pre_clo_init), 0) /*--------------------------------------------------------------------*/ /*--- end ms_main.c ---*/ diff --git a/memcheck/mac_malloc_wrappers.c b/memcheck/mac_malloc_wrappers.c index 0bbe1a011a..1cc3575060 100644 --- a/memcheck/mac_malloc_wrappers.c +++ b/memcheck/mac_malloc_wrappers.c @@ -213,7 +213,7 @@ void* MAC_(new_block) ( Addr p, SizeT size, SizeT align, UInt rzB, return (void*)p; } -void* SK_(malloc) ( SizeT n ) +void* TL_(malloc) ( SizeT n ) { if (complain_about_silly_args(n, "malloc")) { return NULL; @@ -224,7 +224,7 @@ void* SK_(malloc) ( SizeT n ) } } -void* SK_(__builtin_new) ( SizeT n ) +void* TL_(__builtin_new) ( SizeT n ) { if (complain_about_silly_args(n, "__builtin_new")) { return NULL; @@ -235,7 +235,7 @@ void* SK_(__builtin_new) ( SizeT n ) } } -void* SK_(__builtin_vec_new) ( SizeT n ) +void* TL_(__builtin_vec_new) ( SizeT n ) { if (complain_about_silly_args(n, "__builtin_vec_new")) { return NULL; @@ -246,7 +246,7 @@ void* SK_(__builtin_vec_new) ( SizeT n ) } } -void* SK_(memalign) ( SizeT align, SizeT n ) +void* TL_(memalign) ( SizeT align, SizeT n ) { if (complain_about_silly_args(n, "memalign")) { return NULL; @@ -257,7 +257,7 @@ void* SK_(memalign) ( SizeT align, SizeT n ) } } -void* SK_(calloc) ( SizeT nmemb, SizeT size1 ) +void* TL_(calloc) ( SizeT nmemb, SizeT size1 ) { if (complain_about_silly_args2(nmemb, size1)) { return NULL; @@ -321,22 +321,22 @@ void MAC_(handle_free) ( Addr p, UInt rzB, MAC_AllocKind kind ) VGP_POPCC(VgpCliMalloc); } -void SK_(free) ( void* p ) +void TL_(free) ( void* p ) { MAC_(handle_free)((Addr)p, VG_(vg_malloc_redzone_szB), MAC_AllocMalloc); } -void SK_(__builtin_delete) ( void* p ) +void TL_(__builtin_delete) ( void* p ) { MAC_(handle_free)((Addr)p, VG_(vg_malloc_redzone_szB), MAC_AllocNew); } -void SK_(__builtin_vec_delete) ( void* p ) +void TL_(__builtin_vec_delete) ( void* p ) { MAC_(handle_free)((Addr)p, VG_(vg_malloc_redzone_szB), MAC_AllocNewVec); } -void* SK_(realloc) ( void* p, SizeT new_size ) +void* TL_(realloc) ( void* p, SizeT new_size ) { MAC_Chunk *mc; MAC_Chunk **prev_chunks_next_ptr; diff --git a/memcheck/mac_needs.c b/memcheck/mac_needs.c index 753f60271c..d6d431d917 100644 --- a/memcheck/mac_needs.c +++ b/memcheck/mac_needs.c @@ -137,7 +137,7 @@ static Bool eq_AddrInfo ( VgRes res, AddrInfo* ai1, AddrInfo* ai2 ) are otherwise the same, the faulting addrs and associated rwoffsets are allowed to be different. */ -Bool SK_(eq_Error) ( VgRes res, Error* e1, Error* e2 ) +Bool TL_(eq_Error) ( VgRes res, Error* e1, Error* e2 ) { MAC_Error* e1_extra = VG_(get_error_extra)(e1); MAC_Error* e2_extra = VG_(get_error_extra)(e2); @@ -193,7 +193,7 @@ Bool SK_(eq_Error) ( VgRes res, Error* e1, Error* e2 ) return True; case LeakErr: - VG_(tool_panic)("Shouldn't get LeakErr in SK_(eq_Error),\n" + VG_(tool_panic)("Shouldn't get LeakErr in TL_(eq_Error),\n" "since it's handled with VG_(unique_error)()!"); case IllegalMempoolErr: @@ -202,7 +202,7 @@ Bool SK_(eq_Error) ( VgRes res, Error* e1, Error* e2 ) default: VG_(printf)("Error:\n unknown error code %d\n", VG_(get_error_kind)(e1)); - VG_(tool_panic)("unknown error code in SK_(eq_Error)"); + VG_(tool_panic)("unknown error code in TL_(eq_Error)"); } } @@ -297,7 +297,7 @@ void MAC_(pp_shared_Error) ( Error* err ) "stated on the next line"); break; default: - VG_(tool_panic)("SK_(pp_shared_Error)(axskind)"); + VG_(tool_panic)("TL_(pp_shared_Error)(axskind)"); } VG_(pp_ExeContext)( VG_(get_error_where)(err) ); MAC_(pp_AddrInfo)(VG_(get_error_address)(err), &err_extra->addrinfo); @@ -522,7 +522,7 @@ void MAC_(record_overlap_error) ( Char* function, OverlapExtra* ov_extra ) /* Updates the copy with address info if necessary (but not for all errors). */ -UInt SK_(update_extra)( Error* err ) +UInt TL_(update_extra)( Error* err ) { switch (VG_(get_error_kind)(err)) { case ValueErr: @@ -574,7 +574,7 @@ Bool MAC_(shared_recognised_suppression) ( Char* name, Supp* su ) return True; } -Bool SK_(read_extra_suppression_info) ( Int fd, Char* buf, Int nBuf, Supp *su ) +Bool TL_(read_extra_suppression_info) ( Int fd, Char* buf, Int nBuf, Supp *su ) { Bool eof; @@ -586,7 +586,7 @@ Bool SK_(read_extra_suppression_info) ( Int fd, Char* buf, Int nBuf, Supp *su ) return True; } -Bool SK_(error_matches_suppression)(Error* err, Supp* su) +Bool TL_(error_matches_suppression)(Error* err, Supp* su) { Int su_size; MAC_Error* err_extra = VG_(get_error_extra)(err); @@ -637,11 +637,11 @@ Bool SK_(error_matches_suppression)(Error* err, Supp* su) " unknown suppression type %d\n", VG_(get_supp_kind)(su)); VG_(tool_panic)("unknown suppression type in " - "SK_(error_matches_suppression)"); + "TL_(error_matches_suppression)"); } } -Char* SK_(get_error_name) ( Error* err ) +Char* TL_(get_error_name) ( Error* err ) { Char* s; switch (VG_(get_error_kind)(err)) { @@ -678,7 +678,7 @@ Char* SK_(get_error_name) ( Error* err ) VG_(printf)(s); } -void SK_(print_extra_suppression_info) ( Error* err ) +void TL_(print_extra_suppression_info) ( Error* err ) { if (ParamErr == VG_(get_error_kind)(err)) { VG_(printf)(" %s\n", VG_(get_error_string)(err)); @@ -941,17 +941,17 @@ Bool MAC_(handle_common_client_requests)(ThreadId tid, UWord* arg, UWord* ret ) /*--- Syscall wrappers ---*/ /*------------------------------------------------------------*/ -void* SK_(pre_syscall) ( ThreadId tid, UInt syscallno, Bool isBlocking ) +void* TL_(pre_syscall) ( ThreadId tid, UInt syscallno, Bool isBlocking ) { - Int sane = SK_(cheap_sanity_check)(); + Int sane = TL_(cheap_sanity_check)(); return (void*)sane; } -void SK_(post_syscall) ( ThreadId tid, UInt syscallno, +void TL_(post_syscall) ( ThreadId tid, UInt syscallno, void* pre_result, Int res, Bool isBlocking ) { Int sane_before_call = (Int)pre_result; - Bool sane_after_call = SK_(cheap_sanity_check)(); + Bool sane_after_call = TL_(cheap_sanity_check)(); if ((Int)sane_before_call && (!sane_after_call)) { VG_(message)(Vg_DebugMsg, "post-syscall: "); diff --git a/memcheck/mc_errcontext.c b/memcheck/mc_errcontext.c index 9c2e43c12f..9fc2b6a5a8 100644 --- a/memcheck/mc_errcontext.c +++ b/memcheck/mc_errcontext.c @@ -35,7 +35,7 @@ /*--- Printing errors ---*/ /*------------------------------------------------------------*/ -void SK_(pp_Error) ( Error* err ) +void TL_(pp_Error) ( Error* err ) { MAC_Error* err_extra = VG_(get_error_extra)(err); @@ -125,7 +125,7 @@ void MC_(record_user_error) ( ThreadId tid, Addr a, Bool isWrite, /*--- Suppressions ---*/ /*------------------------------------------------------------*/ -Bool SK_(recognised_suppression) ( Char* name, Supp* su ) +Bool TL_(recognised_suppression) ( Char* name, Supp* su ) { SuppKind skind; diff --git a/memcheck/mc_from_ucode.c b/memcheck/mc_from_ucode.c index 7b7aa07e86..0680effc88 100644 --- a/memcheck/mc_from_ucode.c +++ b/memcheck/mc_from_ucode.c @@ -583,7 +583,7 @@ static void synth_TAG2_op ( TagOp op, Int regs, Int regd ) /*--- Generate code for a single UInstr. ---*/ /*----------------------------------------------------*/ -void SK_(emit_XUInstr) ( UInstr* u, RRegSet regs_live_before ) +void TL_(emit_XUInstr) ( UInstr* u, RRegSet regs_live_before ) { switch (u->opcode) { diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c index 1e786119aa..8d90ecc518 100644 --- a/memcheck/mc_main.c +++ b/memcheck/mc_main.c @@ -383,7 +383,7 @@ static void set_address_range_perms ( Addr a, SizeT len, /* Check that zero page and highest page have not been written to -- this could happen with buggy syscall wrappers. Today (2001-04-26) had precisely such a problem with __NR_setitimer. */ - tl_assert(SK_(cheap_sanity_check)()); + tl_assert(TL_(cheap_sanity_check)()); VGP_POPCC(VgpSetMem); } @@ -1508,13 +1508,13 @@ static void mc_detect_memory_leaks ( void ) Sanity check machinery (permanently engaged). ------------------------------------------------------------------ */ -Bool SK_(cheap_sanity_check) ( void ) +Bool TL_(cheap_sanity_check) ( void ) { /* nothing useful we can rapidly check */ return True; } -Bool SK_(expensive_sanity_check) ( void ) +Bool TL_(expensive_sanity_check) ( void ) { Int i; @@ -1637,7 +1637,7 @@ void show_bb ( Addr eip_next ) Bool MC_(clo_avoid_strlen_errors) = True; Bool MC_(clo_cleanup) = True; -Bool SK_(process_cmd_line_option)(Char* arg) +Bool TL_(process_cmd_line_option)(Char* arg) { VG_BOOL_CLO("--avoid-strlen-errors", MC_(clo_avoid_strlen_errors)) else VG_BOOL_CLO("--cleanup", MC_(clo_cleanup)) @@ -1647,7 +1647,7 @@ Bool SK_(process_cmd_line_option)(Char* arg) return True; } -void SK_(print_usage)(void) +void TL_(print_usage)(void) { MAC_(print_common_usage)(); VG_(printf)( @@ -1655,7 +1655,7 @@ void SK_(print_usage)(void) ); } -void SK_(print_debug_usage)(void) +void TL_(print_debug_usage)(void) { MAC_(print_common_debug_usage)(); VG_(printf)( @@ -1803,7 +1803,7 @@ static Bool client_perm_maybe_describe( Addr a, AddrInfo* ai ) return False; } -Bool SK_(handle_client_request) ( ThreadId tid, UWord* arg, UWord* ret ) +Bool TL_(handle_client_request) ( ThreadId tid, UWord* arg, UWord* ret ) { Int i; Bool ok; @@ -1919,7 +1919,7 @@ Bool SK_(handle_client_request) ( ThreadId tid, UWord* arg, UWord* ret ) /*--- Setup ---*/ /*------------------------------------------------------------*/ -void SK_(pre_clo_init)(void) +void TL_(pre_clo_init)(void) { VG_(details_name) ("Memcheck"); VG_(details_version) (NULL); @@ -2015,11 +2015,11 @@ void SK_(pre_clo_init)(void) MAC_(common_pre_clo_init)(); } -void SK_(post_clo_init) ( void ) +void TL_(post_clo_init) ( void ) { } -void SK_(fini) ( Int exitcode ) +void TL_(fini) ( Int exitcode ) { MAC_(common_fini)( mc_detect_memory_leaks ); @@ -2030,7 +2030,7 @@ void SK_(fini) ( Int exitcode ) } } -VG_DETERMINE_INTERFACE_VERSION(SK_(pre_clo_init), 9./8) +VG_DETERMINE_INTERFACE_VERSION(TL_(pre_clo_init), 9./8) /*--------------------------------------------------------------------*/ /*--- end mc_main.c ---*/ diff --git a/memcheck/mc_translate.c b/memcheck/mc_translate.c index 6a815c930d..8d03ed79bd 100644 --- a/memcheck/mc_translate.c +++ b/memcheck/mc_translate.c @@ -39,7 +39,7 @@ vg_translate.c:is_sane_UInstr(). Everything general said there applies here too. */ -Bool SK_(sane_XUInstr)(Bool beforeRA, Bool beforeLiveness, UInstr* u) +Bool TL_(sane_XUInstr)(Bool beforeRA, Bool beforeLiveness, UInstr* u) { // SSS: duplicating these macros really sucks # define LIT0 (u->lit32 == 0) @@ -93,7 +93,7 @@ Bool SK_(sane_XUInstr)(Bool beforeRA, Bool beforeLiveness, UInstr* u) case TAG2: return LIT0 && SZ0 && CC0 && TR1 && TR2 && Ls3 && XOTHER; default: VG_(printf)("unhandled opcode: %u\n", u->opcode); - VG_(tool_panic)("SK_(sane_XUInstr): unhandled opcode"); + VG_(tool_panic)("TL_(sane_XUInstr): unhandled opcode"); } # undef LIT0 # undef LIT1 @@ -159,7 +159,7 @@ static Char* nameOfTagOp ( TagOp h ) } -Char* SK_(name_XUOpcode)(Opcode opc) +Char* TL_(name_XUOpcode)(Opcode opc) { switch (opc) { case GETVF: return "GETVF"; @@ -174,7 +174,7 @@ Char* SK_(name_XUOpcode)(Opcode opc) case SETV: return "SETV"; default: VG_(printf)("unhandled opcode: %u\n", opc); - VG_(tool_panic)("SK_(name_XUOpcode): unhandled case"); + VG_(tool_panic)("TL_(name_XUOpcode): unhandled case"); } } @@ -182,7 +182,7 @@ Char* SK_(name_XUOpcode)(Opcode opc) Debugging stuff. ------------------------------------------------------------------ */ -void SK_(pp_XUInstr)(UInstr* u) +void TL_(pp_XUInstr)(UInstr* u) { switch (u->opcode) { case TAG1: @@ -223,12 +223,12 @@ void SK_(pp_XUInstr)(UInstr* u) default: VG_(printf)("unhandled opcode: %u\n", u->opcode); - VG_(tool_panic)("SK_(pp_XUInstr): unhandled opcode"); + VG_(tool_panic)("TL_(pp_XUInstr): unhandled opcode"); } } -Int SK_(get_Xreg_usage)(UInstr* u, Tag tag, Int* regs, Bool* isWrites) +Int TL_(get_Xreg_usage)(UInstr* u, Tag tag, Int* regs, Bool* isWrites) { # define RD(ono) VG_UINSTR_READS_REG(ono, regs, isWrites) # define WR(ono) VG_UINSTR_WRITES_REG(ono, regs, isWrites) @@ -248,7 +248,7 @@ Int SK_(get_Xreg_usage)(UInstr* u, Tag tag, Int* regs, Bool* isWrites) default: VG_(printf)("unhandled opcode: %u\n", u->opcode); - VG_(tool_panic)("SK_(get_Xreg_usage): unhandled opcode"); + VG_(tool_panic)("TL_(get_Xreg_usage): unhandled opcode"); } return n; @@ -1638,7 +1638,7 @@ static void vg_cleanup ( UCodeBlock* cb ) /* Caller will print out final instrumented code if necessary; we print out intermediate instrumented code here if necessary. */ -UCodeBlock* SK_(instrument) ( UCodeBlock* cb, Addr not_used ) +UCodeBlock* TL_(instrument) ( UCodeBlock* cb, Addr not_used ) { cb = memcheck_instrument ( cb ); if (MC_(clo_cleanup)) { diff --git a/none/nl_main.c b/none/nl_main.c index f9b2f466f3..1210ff46c9 100644 --- a/none/nl_main.c +++ b/none/nl_main.c @@ -30,7 +30,7 @@ #include "tool.h" -void SK_(pre_clo_init)(void) +void TL_(pre_clo_init)(void) { VG_(details_name) ("Nulgrind"); VG_(details_version) (NULL); @@ -42,20 +42,20 @@ void SK_(pre_clo_init)(void) /* No needs, no core events to track */ } -void SK_(post_clo_init)(void) +void TL_(post_clo_init)(void) { } -UCodeBlock* SK_(instrument)(UCodeBlock* cb, Addr a) +UCodeBlock* TL_(instrument)(UCodeBlock* cb, Addr a) { return cb; } -void SK_(fini)(Int exitcode) +void TL_(fini)(Int exitcode) { } -VG_DETERMINE_INTERFACE_VERSION(SK_(pre_clo_init), 0) +VG_DETERMINE_INTERFACE_VERSION(TL_(pre_clo_init), 0) /*--------------------------------------------------------------------*/ /*--- end ---*/