/*--- 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);
/*--- Suppressions ---*/
/*------------------------------------------------------------*/
-Bool SK_(recognised_suppression) ( Char* name, Supp* su )
+Bool TL_(recognised_suppression) ( Char* name, Supp* su )
{
return MAC_(shared_recognised_suppression)(name, su);
}
/* 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);
}
/*--- 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
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 );
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 );
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;
/*--- 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 { \
/*--- 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)();
}
/*--- Setup ---*/
/*------------------------------------------------------------*/
-void SK_(pre_clo_init)(void)
+void TL_(pre_clo_init)(void)
{
VG_(details_name) ("Addrcheck");
VG_(details_version) (NULL);
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)
/*--------------------------------------------------------------------*/
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;
}
/*------------------------------------------------------------*/
-/*--- SK_(fini)() and related function ---*/
+/*--- TL_(fini)() and related function ---*/
/*------------------------------------------------------------*/
// Total reads/writes/misses. Calculated during CC traversal at the end.
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];
/*--------------------------------------------------------------------*/
// 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;
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="))
return True;
}
-void SK_(print_usage)(void)
+void TL_(print_usage)(void)
{
VG_(printf)(
" --I1=<size>,<assoc>,<line_size> set I1 cache manually\n"
);
}
-void SK_(print_debug_usage)(void)
+void TL_(print_debug_usage)(void)
{
VG_(printf)(
" (none)\n"
/*--- Setup ---*/
/*--------------------------------------------------------------------*/
-void SK_(pre_clo_init)(void)
+void TL_(pre_clo_init)(void)
{
Char* base_dir = NULL;
instr_info_table = VG_(HT_construct)();
}
-void SK_(post_clo_init)(void)
+void TL_(post_clo_init)(void)
{
cache_t I1c, D1c, L2c;
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 ---*/
#include "tool.h"
-void SK_(pre_clo_init)(void)
+void TL_(pre_clo_init)(void)
{
VG_(details_name) ("Coregrind");
VG_(details_version) (NULL);
/* 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)
{
}
#include "valgrind.h"
-#undef SK_
-#define SK_(x) vgSkinInternal_##x
+#undef TL_
+#define TL_(x) vgToolInternal_##x
/* ---------------------------------------------------------------------
// 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)()) { \
#define VG_TRACK(fn, args...) \
do { \
if (VG_(defined_##fn)()) \
- SK_(fn)(args); \
+ TL_(fn)(args); \
} while(0)
__attribute__ ((noreturn))
then loaded ahead of the core shared object <code>valgrind.so</code>, using the
dynamic linker's <code>LD_PRELOAD</code> variable. Any functions defined in
the tool that share the name with a function defined in core (such as
-the instrumentation function <code>SK_(instrument)()</code>) override the
+the instrumentation function <code>TL_(instrument)()</code>) override the
core's definition. Thus the core can call the necessary tool functions.<p>
This magic is all done for you; the shared object used is chosen with the
<li>Copy <code>none/nl_main.c</code> into
<code>foobar/</code>, renaming it as <code>fb_main.c</code>.
- Edit it by changing the lines in <code>SK_(pre_clo_init)()</code>
+ Edit it by changing the lines in <code>TL_(pre_clo_init)()</code>
to something appropriate for the tool. These fields are used in the
startup message, except for <code>bug_reports_to</code> which is used
if a tool assertion fails.
A tool must define at least these four functions:
<pre>
- SK_(pre_clo_init)()
- SK_(post_clo_init)()
- SK_(instrument)()
- SK_(fini)()
+ TL_(pre_clo_init)()
+ TL_(post_clo_init)()
+ TL_(instrument)()
+ TL_(fini)()
</pre>
Also, it must use the macro <code>VG_DETERMINE_INTERFACE_VERSION</code>
<a name="init"></a>
<h3>2.7 Initialisation</h3>
-Most of the initialisation should be done in <code>SK_(pre_clo_init)()</code>.
-Only use <code>SK_(post_clo_init)()</code> if a tool provides command line
+Most of the initialisation should be done in <code>TL_(pre_clo_init)()</code>.
+Only use <code>TL_(post_clo_init)()</code> if a tool provides command line
options and must do some initialisation after option processing takes place
(``<code>clo</code>'' stands for ``command line options'').<p>
<a name="instr"></a>
<h3>2.8 Instrumentation</h3>
-<code>SK_(instrument)()</code> is the interesting one. It allows you to
+<code>TL_(instrument)()</code> is the interesting one. It allows you to
instrument <i>UCode</i>, which is Valgrind's RISC-like intermediate language.
UCode is described in the <a href="mc_techdocs.html">technical docs</a> for
Memcheck.
distributed (Memcheck, Addrcheck, Cachegrind, Lackey, etc.) are probably the
best documentation of all, for the moment.<p>
-Note that the <code>VG_</code> and <code>SK_</code> macros are used heavily.
+Note that the <code>VG_</code> and <code>TL_</code> macros are used heavily.
These just prepend longer strings in front of names to avoid potential
-namespace clashes. We strongly recommend using the <code>SK_</code> macro for
+namespace clashes. We strongly recommend using the <code>TL_</code> macro for
any global functions and variables in your tool, or writing a similar macro.<p>
<a name="wordsofadvice"></a>
my $struct = "VG_(tool_interface)";
-my %pfxmap = ("track" => "SK_",
- "tool" => "SK_",
- "malloc"=> "SK_",
+my %pfxmap = ("track" => "TL_",
+ "tool" => "TL_",
+ "malloc"=> "TL_",
);
sub getargnames(@) {
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;
}
my $args = join ", ", getargtypes(@args);
print <<EOF;
- ret = dlsym(dlhandle, "vgSkin_$func");
+ ret = dlsym(dlhandle, "vgTool_$func");
if (ret != NULL)
VG_(init_$func)(($ret (*)($args))ret);
## Should fill in any details that could be postponed until after the
## decision whether to ignore the error (ie. details not affecting the
-## result of SK_(eq_Error)()). This saves time when errors are ignored.
+## result of TL_(eq_Error)()). This saves time when errors are ignored.
## Yuk.
## Return value: must be the size of the `extra' part in bytes -- used by
## This should return the suppression name, for --gen-suppressions, or NULL
## if that error type cannot be suppressed. This is the inverse of
-## SK_(recognised_suppression)().
+## TL_(recognised_suppression)().
Char*, get_error_name, Error* err
## This should print any extra info for the error, for --gen-suppressions,
## including the newline. This is the inverse of
-## SK_(read_extra_suppression_info)().
+## TL_(read_extra_suppression_info)().
void, print_extra_suppression_info, Error* err
## ---------------------------------------------------------------------
## VG_(needs).sanity_checks
-## Can be useful for ensuring a tool's correctness. SK_(cheap_sanity_check)
-## is called very frequently; SK_(expensive_sanity_check) is called less
+## Can be useful for ensuring a tool's correctness. TL_(cheap_sanity_check)
+## is called very frequently; TL_(expensive_sanity_check) is called less
## frequently and can be more involved.
Bool, cheap_sanity_check
Bool, expensive_sanity_check
VALGRIND_2.1 {
global:
vgPlain_*;
- vgSkin_*;
+ vgTool_*;
vgProf_*;
vgOff_*;
vgArch_*;
scheduler, for the USERREQ__MALLOC user request used by vg_libpthread.c.
(Nb: it cannot call glibc's malloc().) The lock variable ensures that the
scheduler is the only place this can be called from; this ensures that a
- malloc()-replacing tool cannot forget to implement SK_(malloc)() or
- SK_(free)(). */
+ malloc()-replacing tool cannot forget to implement TL_(malloc)() or
+ TL_(free)(). */
__attribute__ ((weak))
-void* SK_(malloc)( SizeT size )
+void* TL_(malloc)( SizeT size )
{
if (VG_(sk_malloc_called_by_scheduler))
return VG_(cli_malloc)(VG_MIN_MALLOC_SZB, size);
}
__attribute__ ((weak))
-void SK_(free)( void* p )
+void TL_(free)( void* p )
{
- /* see comment for SK_(malloc)() above */
+ /* see comment for TL_(malloc)() above */
if (VG_(sk_malloc_called_by_scheduler))
VG_(cli_free)(p);
else
return False;
default:
if (VG_(needs).tool_errors)
- return SK_(eq_Error)(res, e1, e2);
+ return TL_(eq_Error)(res, e1, e2);
else {
VG_(printf)("\nUnhandled error type: %u. VG_(needs).tool_errors\n"
"probably needs to be set.\n",
break;
default:
if (VG_(needs).tool_errors)
- SK_(pp_Error)( err );
+ TL_(pp_Error)( err );
else {
VG_(printf)("\nUnhandled error type: %u. VG_(needs).tool_errors\n"
"probably needs to be set?\n",
VG_(printf)(" core:PThread\n");
} else {
- Char* name = SK_(get_error_name)(err);
+ Char* name = TL_(get_error_name)(err);
if (NULL == name) {
VG_(message)(Vg_UserMsg,
"(tool does not allow error to be suppressed)");
return;
}
VG_(printf)(" %s:%s\n", VG_(details).name, name);
- SK_(print_extra_suppression_info)(err);
+ TL_(print_extra_suppression_info)(err);
}
/* This loop condensed from VG_(mini_stack_dump)() */
will disappear shortly, so we must copy it. First do the main
(non-`extra') part.
- Then SK_(update_extra) can update the `extra' part. This is for when
+ Then TL_(update_extra) can update the `extra' part. This is for when
there are more details to fill in which take time to work out but
don't affect our earlier decision to include the error -- by
postponing those details until now, we avoid the extra work in the
case where we ignore the error. Ugly.
Then, if there is an `extra' part, copy it too, using the size that
- SK_(update_extra) returned. Also allow for people using the void*
+ TL_(update_extra) returned. Also allow for people using the void*
extra field for a scalar value like an integer.
*/
/* update `extra', for non-core errors (core ones don't use 'extra') */
if (VG_(needs).tool_errors && PThreadErr != ekind) {
- extra_size = SK_(update_extra)(p);
+ extra_size = TL_(update_extra)(p);
/* copy block pointed to by `extra', if there is one */
if (NULL != p->extra && 0 != extra_size) {
/* 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)
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
}
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. */
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"
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 "
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;
}
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");
}
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");
}
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);
}
}
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);
}
if (VG_(needs).sanity_checks) {
VGP_PUSHCC(VgpToolExpensiveSanity);
- vg_assert(SK_(expensive_sanity_check)());
+ vg_assert(TL_(expensive_sanity_check)());
VGP_POPCC(VgpToolExpensiveSanity);
}
/*
}
process_cmd_line_options(client_auxv, tool);
- SK_(post_clo_init)();
+ TL_(post_clo_init)();
//--------------------------------------------------------------
// Build segment map (all segments)
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*/ );
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
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] */
/* 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;
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);
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;
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 );
}
}
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 );
}
}
}
/* 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);
}
*/
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);
}
}
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?",
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?",
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?",
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?",
}
/* 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 );
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;
-- 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);
}
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 );
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;
/*--- 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;
/* 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;
/* Updates the copy with address info if necessary. */
-UInt SK_(update_extra)(Error* err)
+UInt TL_(update_extra)(Error* err)
{
HelgrindError* extra;
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;
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];
}
-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);
}
-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. */
}
-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";
}
}
-extern void SK_(print_extra_suppression_info) ( Error* err )
+extern void TL_(print_extra_suppression_info) ( Error* err )
{
/* Do nothing */
}
/*--- 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;
/*--- Setup ---*/
/*--------------------------------------------------------------------*/
-void SK_(pre_clo_init)(void)
+void TL_(pre_clo_init)(void)
{
Int i;
LockSet *empty;
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;
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"
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);
}
-void SK_(fini)(Int exitcode)
+void TL_(fini)(Int exitcode)
{
if (DEBUG_LOCK_TABLE) {
pp_all_LockSets();
}
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",
}
/* 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 ---*/
/* 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, \
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
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 );
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 );
/* 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 );
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 );
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 */
#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
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)
{
n_Jccs_untaken++;
}
-void SK_(pre_clo_init)(void)
+void TL_(pre_clo_init)(void)
{
VG_(details_name) ("Lackey");
VG_(details_version) (NULL);
VG_(register_compact_helper)((Addr) & add_one_Jcc_untaken);
}
-void SK_(post_clo_init)(void)
+void TL_(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;
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);
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)
/*--------------------------------------------------------------------*/
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)
return True;
}
-void SK_(print_usage)(void)
+void TL_(print_usage)(void)
{
VG_(printf)(
" --heap=no|yes profile heap blocks [yes]\n"
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_(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;
/*--- 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: {
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);
tl_assert( VG_(getcwd_alloc)(&base_dir) );
}
-void SK_(post_clo_init)(void)
+void TL_(post_clo_init)(void)
{
ms_interval = 1;
/*--- Instrumentation ---*/
/*------------------------------------------------------------*/
-UCodeBlock* SK_(instrument)(UCodeBlock* cb_in, Addr orig_addr)
+UCodeBlock* TL_(instrument)(UCodeBlock* cb_in, Addr orig_addr)
{
return cb_in;
}
}
}
-void SK_(fini)(Int exit_status)
+void TL_(fini)(Int exit_status)
{
ULong total_ST = 0;
ULong heap_ST = 0;
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 ---*/
return (void*)p;
}
-void* SK_(malloc) ( SizeT n )
+void* TL_(malloc) ( SizeT n )
{
if (complain_about_silly_args(n, "malloc")) {
return NULL;
}
}
-void* SK_(__builtin_new) ( SizeT n )
+void* TL_(__builtin_new) ( SizeT n )
{
if (complain_about_silly_args(n, "__builtin_new")) {
return NULL;
}
}
-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;
}
}
-void* SK_(memalign) ( SizeT align, SizeT n )
+void* TL_(memalign) ( SizeT align, SizeT n )
{
if (complain_about_silly_args(n, "memalign")) {
return NULL;
}
}
-void* SK_(calloc) ( SizeT nmemb, SizeT size1 )
+void* TL_(calloc) ( SizeT nmemb, SizeT size1 )
{
if (complain_about_silly_args2(nmemb, size1)) {
return NULL;
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;
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);
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:
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)");
}
}
"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);
/* 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:
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;
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);
" 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)) {
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));
/*--- 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: ");
/*--- Printing errors ---*/
/*------------------------------------------------------------*/
-void SK_(pp_Error) ( Error* err )
+void TL_(pp_Error) ( Error* err )
{
MAC_Error* err_extra = VG_(get_error_extra)(err);
/*--- Suppressions ---*/
/*------------------------------------------------------------*/
-Bool SK_(recognised_suppression) ( Char* name, Supp* su )
+Bool TL_(recognised_suppression) ( Char* name, Supp* su )
{
SuppKind skind;
/*--- 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) {
/* 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);
}
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;
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))
return True;
}
-void SK_(print_usage)(void)
+void TL_(print_usage)(void)
{
MAC_(print_common_usage)();
VG_(printf)(
);
}
-void SK_(print_debug_usage)(void)
+void TL_(print_debug_usage)(void)
{
MAC_(print_common_debug_usage)();
VG_(printf)(
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;
/*--- Setup ---*/
/*------------------------------------------------------------*/
-void SK_(pre_clo_init)(void)
+void TL_(pre_clo_init)(void)
{
VG_(details_name) ("Memcheck");
VG_(details_version) (NULL);
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 );
}
}
-VG_DETERMINE_INTERFACE_VERSION(SK_(pre_clo_init), 9./8)
+VG_DETERMINE_INTERFACE_VERSION(TL_(pre_clo_init), 9./8)
/*--------------------------------------------------------------------*/
/*--- end mc_main.c ---*/
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)
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
}
-Char* SK_(name_XUOpcode)(Opcode opc)
+Char* TL_(name_XUOpcode)(Opcode opc)
{
switch (opc) {
case GETVF: return "GETVF";
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");
}
}
Debugging stuff.
------------------------------------------------------------------ */
-void SK_(pp_XUInstr)(UInstr* u)
+void TL_(pp_XUInstr)(UInstr* u)
{
switch (u->opcode) {
case TAG1:
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)
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;
/* 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)) {
#include "tool.h"
-void SK_(pre_clo_init)(void)
+void TL_(pre_clo_init)(void)
{
VG_(details_name) ("Nulgrind");
VG_(details_version) (NULL);
/* 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 ---*/