From: Julian Seward Date: Thu, 23 Jun 2005 01:02:53 +0000 (+0000) Subject: For symbols which have C-level global scope but which we regard as X-Git-Tag: svn/VALGRIND_3_0_0~318 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9cb06966412834e89d82966f18fa8e403170f115;p=thirdparty%2Fvalgrind.git For symbols which have C-level global scope but which we regard as module-local, use the new ML_ prefix instead of VG_. This makes it trivial to see which names are those exported from public module interfaces: precisely those using VG_. /* VG_ is for symbols exported from modules. ML_ (module-local) is for symbols which are not intended to be visible outside modules, but which cannot be declared as C 'static's since they need to be visible across C files within a given module. It is a mistake for a ML_ name to appear in a pub_core_*.h or pub_tool_*.h file. Likewise it is a mistake for a VG_ name to appear in a priv_*.h file. */ git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4000 --- diff --git a/coregrind/m_debuginfo/dwarf.c b/coregrind/m_debuginfo/dwarf.c index 46203a2c3d..ffc11bbc68 100644 --- a/coregrind/m_debuginfo/dwarf.c +++ b/coregrind/m_debuginfo/dwarf.c @@ -317,7 +317,7 @@ Int process_extended_line_op( SegInfo* si, if (state_machine_regs.is_stmt) { if (state_machine_regs.last_address) - VG_(addLineInfo) ( + ML_(addLineInfo) ( si, (Char*)index_WordArray(filenames, state_machine_regs.last_file), @@ -339,7 +339,7 @@ Int process_extended_line_op( SegInfo* si, case DW_LNE_define_file: name = data; - addto_WordArray( filenames, (Word)VG_(addStr)(si,name,-1) ); + addto_WordArray( filenames, (Word)ML_(addStr)(si,name,-1) ); data += VG_(strlen) ((char *) data) + 1; read_leb128 (data, & bytes_read, 0); data += bytes_read; @@ -420,9 +420,9 @@ void read_dwarf2_lineblock ( SegInfo* si, addto_WordArray( &filenames, (Word)NULL ); if (ui->compdir) - addto_WordArray( &dirnames, (Word)VG_(addStr)(si, ui->compdir, -1) ); + addto_WordArray( &dirnames, (Word)ML_(addStr)(si, ui->compdir, -1) ); else - addto_WordArray( &dirnames, (Word)VG_(addStr)(si, ".", -1) ); + addto_WordArray( &dirnames, (Word)ML_(addStr)(si, ".", -1) ); addto_WordArray( &fnidx2dir, (Word)0 ); /* compilation dir */ @@ -433,12 +433,12 @@ void read_dwarf2_lineblock ( SegInfo* si, info.li_length = * ((UInt *)(external->li_length)); if (info.li_length == 0xffffffff) { - VG_(symerr)("64-bit DWARF line info is not supported yet."); + ML_(symerr)("64-bit DWARF line info is not supported yet."); goto out; } if (info.li_length + sizeof (external->li_length) > noLargerThan) { - VG_(symerr)("DWARF line info appears to be corrupt " + ML_(symerr)("DWARF line info appears to be corrupt " "- the section is too small"); goto out; } @@ -446,7 +446,7 @@ void read_dwarf2_lineblock ( SegInfo* si, /* Check its version number. */ info.li_version = * ((UShort *) (external->li_version)); if (info.li_version != 2) { - VG_(symerr)("Only DWARF version 2 line info " + ML_(symerr)("Only DWARF version 2 line info " "is currently supported."); goto out; } @@ -519,11 +519,11 @@ void read_dwarf2_lineblock ( SegInfo* si, VG_(strcat)(buf, "/"); VG_(strcat)(buf, data); vg_assert(VG_(strlen)(buf) < NBUF); - addto_WordArray( &dirnames, (Word)VG_(addStr)(si,buf,-1) ); + addto_WordArray( &dirnames, (Word)ML_(addStr)(si,buf,-1) ); if (0) VG_(printf)("rel path %s\n", buf); } else { /* just use 'data'. */ - addto_WordArray( &dirnames, (Word)VG_(addStr)(si,data,-1) ); + addto_WordArray( &dirnames, (Word)ML_(addStr)(si,data,-1) ); if (0) VG_(printf)("abs path %s\n", data); } @@ -532,7 +532,7 @@ void read_dwarf2_lineblock ( SegInfo* si, # undef NBUF } if (*data != 0) { - VG_(symerr)("can't find NUL at end of DWARF2 directory table"); + ML_(symerr)("can't find NUL at end of DWARF2 directory table"); goto out; } data ++; @@ -553,12 +553,12 @@ void read_dwarf2_lineblock ( SegInfo* si, read_leb128 (data, & bytes_read, 0); data += bytes_read; - addto_WordArray( &filenames, (Word)VG_(addStr)(si,name,-1) ); + addto_WordArray( &filenames, (Word)ML_(addStr)(si,name,-1) ); addto_WordArray( &fnidx2dir, (Word)diridx ); if (0) VG_(printf)("file %s diridx %d\n", name, diridx ); } if (*data != 0) { - VG_(symerr)("can't find NUL at end of DWARF2 file name table"); + ML_(symerr)("can't find NUL at end of DWARF2 file name table"); goto out; } data ++; @@ -592,7 +592,7 @@ void read_dwarf2_lineblock ( SegInfo* si, if (state_machine_regs.is_stmt) { /* only add a statement if there was a previous boundary */ if (state_machine_regs.last_address) - VG_(addLineInfo)( + ML_(addLineInfo)( si, (Char*)index_WordArray( &filenames, state_machine_regs.last_file ), @@ -624,7 +624,7 @@ void read_dwarf2_lineblock ( SegInfo* si, if (state_machine_regs.is_stmt) { /* only add a statement if there was a previous boundary */ if (state_machine_regs.last_address) - VG_(addLineInfo)( + ML_(addLineInfo)( si, (Char*)index_WordArray( &filenames, state_machine_regs.last_file ), @@ -901,7 +901,7 @@ void read_unitinfo_dwarf2( /*OUT*/UnitInfo* ui, * Inputs: given .debug_xxx sections * Output: update si to contain all the dwarf2 debug infos */ -void VG_(read_debuginfo_dwarf2) +void ML_(read_debuginfo_dwarf2) ( SegInfo* si, UChar* debuginfo, Int debug_info_sz, /* .debug_info */ UChar* debugabbrev, /* .debug_abbrev */ @@ -922,13 +922,13 @@ void VG_(read_debuginfo_dwarf2) blklen = *((UInt*)block); /* This block length */ if ( block + blklen + 4 > end ) { - VG_(symerr)( "Last block truncated in .debug_info; ignoring" ); + ML_(symerr)( "Last block truncated in .debug_info; ignoring" ); return; } ver = *((UShort*)(block + 4)); /* version should be 2 */ if ( ver != 2 ) { - VG_(symerr)( "Ignoring non-dwarf2 block in .debug_info" ); + ML_(symerr)( "Ignoring non-dwarf2 block in .debug_info" ); continue; } @@ -1109,7 +1109,7 @@ enum dwarf_attribute { /* end of enums taken from gdb-6.0 sources */ -void VG_(read_debuginfo_dwarf1) ( +void ML_(read_debuginfo_dwarf1) ( SegInfo* si, UChar* dwarf1d, Int dwarf1d_sz, UChar* dwarf1l, Int dwarf1l_sz ) @@ -1215,7 +1215,7 @@ void VG_(read_debuginfo_dwarf1) ( UChar* ptr; UInt prev_line, prev_delta; - curr_filenm = VG_(addStr) ( si, src_filename, -1 ); + curr_filenm = ML_(addStr) ( si, src_filename, -1 ); prev_line = prev_delta = 0; ptr = dwarf1l + stmt_list; @@ -1236,7 +1236,7 @@ void VG_(read_debuginfo_dwarf1) ( if (delta > 0 && prev_line > 0) { if (0) VG_(printf) (" %d %d-%d\n", prev_line, prev_delta, delta-1); - VG_(addLineInfo) ( si, curr_filenm, NULL, + ML_(addLineInfo) ( si, curr_filenm, NULL, base + prev_delta, base + delta, prev_line, 0 ); } @@ -1457,7 +1457,7 @@ static void initUnwindContext ( /*OUT*/UnwindContext* ctx ) /* ------------ Deal with summary-info records ------------ */ -void VG_(ppCfiSI) ( CfiSI* si ) +void ML_(ppCfiSI) ( CfiSI* si ) { # define SHOW_HOW(_how, _off) \ do { \ @@ -2125,9 +2125,9 @@ Bool run_CF_instructions ( SegInfo* si, if (loc_prev != ctx->loc && si) { summ_ok = summarise_context ( &cfisi, loc_prev, ctx ); if (summ_ok) { - VG_(addCfiSI)(si, &cfisi); + ML_(addCfiSI)(si, &cfisi); if (VG_(clo_trace_cfi)) - VG_(ppCfiSI)(&cfisi); + ML_(ppCfiSI)(&cfisi); } } } @@ -2137,9 +2137,9 @@ Bool run_CF_instructions ( SegInfo* si, if (si) { summ_ok = summarise_context ( &cfisi, loc_prev, ctx ); if (summ_ok) { - VG_(addCfiSI)(si, &cfisi); + ML_(addCfiSI)(si, &cfisi); if (VG_(clo_trace_cfi)) - VG_(ppCfiSI)(&cfisi); + ML_(ppCfiSI)(&cfisi); } } } @@ -2184,7 +2184,7 @@ static void init_CIE ( CIE* cie ) static CIE the_CIEs[N_CIEs]; -void VG_(read_callframe_info_dwarf2) +void ML_(read_callframe_info_dwarf2) ( /*OUT*/SegInfo* si, UChar* ehframe, Int ehframe_sz, Addr ehframe_addr ) { diff --git a/coregrind/m_debuginfo/priv_symtab.h b/coregrind/m_debuginfo/priv_symtab.h index 961eccc1e6..72a72f7f70 100644 --- a/coregrind/m_debuginfo/priv_symtab.h +++ b/coregrind/m_debuginfo/priv_symtab.h @@ -163,7 +163,7 @@ typedef } CfiSI; -extern void VG_(ppCfiSI) ( CfiSI* ); +extern void ML_(ppCfiSI) ( CfiSI* ); /* A structure which contains information pertaining to one mapped @@ -232,29 +232,29 @@ struct _SegInfo { }; extern -Char *VG_(addStr) ( SegInfo* si, Char* str, Int len ); +Char *ML_(addStr) ( SegInfo* si, Char* str, Int len ); extern -void VG_(addScopeInfo) ( SegInfo* si, Addr this, Addr next, Scope *scope); +void ML_(addScopeInfo) ( SegInfo* si, Addr this, Addr next, Scope *scope); extern -void VG_(addLineInfo) ( SegInfo* si, +void ML_(addLineInfo) ( SegInfo* si, Char* filename, Char* dirname, /* NULL is allowable */ Addr this, Addr next, Int lineno, Int entry); extern -void VG_(addCfiSI) ( SegInfo* si, CfiSI* cfisi ); +void ML_(addCfiSI) ( SegInfo* si, CfiSI* cfisi ); /* Non-fatal -- use vg_panic if terminal. */ extern -void VG_(symerr) ( Char* msg ); +void ML_(symerr) ( Char* msg ); /* -------------------- Stabs reader -------------------- */ extern -void VG_(read_debuginfo_stabs) ( SegInfo* si, +void ML_(read_debuginfo_stabs) ( SegInfo* si, UChar* stabC, Int stab_sz, UChar* stabstr, Int stabstr_sz ); @@ -262,7 +262,7 @@ void VG_(read_debuginfo_stabs) ( SegInfo* si, DWARF2 reader -------------------- */ extern -void VG_(read_debuginfo_dwarf2) +void ML_(read_debuginfo_dwarf2) ( SegInfo* si, UChar* debuginfo, Int debug_info_sz, /* .debug_info */ UChar* debugabbrev, /* .debug_abbrev */ @@ -273,7 +273,7 @@ void VG_(read_debuginfo_dwarf2) DWARF1 reader -------------------- */ extern -void VG_(read_debuginfo_dwarf1) ( SegInfo* si, +void ML_(read_debuginfo_dwarf1) ( SegInfo* si, UChar* dwarf1d, Int dwarf1d_sz, UChar* dwarf1l, Int dwarf1l_sz ); @@ -281,7 +281,7 @@ void VG_(read_debuginfo_dwarf1) ( SegInfo* si, CFI reader -------------------- */ extern -void VG_(read_callframe_info_dwarf2) +void ML_(read_callframe_info_dwarf2) ( /*OUT*/SegInfo* si, UChar* ehframe, Int ehframe_sz, Addr ehframe_addr ); diff --git a/coregrind/m_debuginfo/priv_symtypes.h b/coregrind/m_debuginfo/priv_symtypes.h index ddc008bf0f..5eac6113de 100644 --- a/coregrind/m_debuginfo/priv_symtypes.h +++ b/coregrind/m_debuginfo/priv_symtypes.h @@ -43,49 +43,49 @@ typedef struct _SymType SymType; unresolved symbols. If type is not a typedef, then this is just returns type. */ -SymType *VG_(st_basetype)(SymType *type, Bool resolve); +SymType *ML_(st_basetype)(SymType *type, Bool resolve); -void VG_(st_setname)(SymType *ty, Char *name); +void ML_(st_setname)(SymType *ty, Char *name); typedef void (SymResolver)(SymType *, void *); /* Create an unresolved type */ -SymType *VG_(st_mkunresolved)(SymType *, SymResolver *resolve, void *data); +SymType *ML_(st_mkunresolved)(SymType *, SymResolver *resolve, void *data); /* update an unresolved type's data */ -void VG_(st_unresolved_setdata)(SymType *, SymResolver *resolve, void *data); +void ML_(st_unresolved_setdata)(SymType *, SymResolver *resolve, void *data); -Bool VG_(st_isresolved)(SymType *); -UInt VG_(st_sizeof)(SymType *); +Bool ML_(st_isresolved)(SymType *); +UInt ML_(st_sizeof)(SymType *); /* Unknown type (unparsable) */ -SymType *VG_(st_mkunknown)(SymType *); +SymType *ML_(st_mkunknown)(SymType *); -SymType *VG_(st_mkvoid)(SymType *); +SymType *ML_(st_mkvoid)(SymType *); -SymType *VG_(st_mkint)(SymType *, UInt size, Bool isSigned); -SymType *VG_(st_mkbool)(SymType *, UInt size); -SymType *VG_(st_mkchar)(SymType *, Bool isSigned); -SymType *VG_(st_mkfloat)(SymType *, UInt size); -SymType *VG_(st_mkdouble)(SymType *, UInt size); +SymType *ML_(st_mkint)(SymType *, UInt size, Bool isSigned); +SymType *ML_(st_mkbool)(SymType *, UInt size); +SymType *ML_(st_mkchar)(SymType *, Bool isSigned); +SymType *ML_(st_mkfloat)(SymType *, UInt size); +SymType *ML_(st_mkdouble)(SymType *, UInt size); -SymType *VG_(st_mkpointer)(SymType *, SymType *); -SymType *VG_(st_mkrange)(SymType *, SymType *, Int min, Int max); +SymType *ML_(st_mkpointer)(SymType *, SymType *); +SymType *ML_(st_mkrange)(SymType *, SymType *, Int min, Int max); -SymType *VG_(st_mkstruct)(SymType *, UInt size, UInt nfields); -SymType *VG_(st_mkunion)(SymType *, UInt size, UInt nfields); -void VG_(st_addfield)(SymType *, Char *name, SymType *, UInt off, UInt size); +SymType *ML_(st_mkstruct)(SymType *, UInt size, UInt nfields); +SymType *ML_(st_mkunion)(SymType *, UInt size, UInt nfields); +void ML_(st_addfield)(SymType *, Char *name, SymType *, UInt off, UInt size); -SymType *VG_(st_mkenum)(SymType *, UInt ntags); -SymType *VG_(st_addtag)(SymType *, Char *name, Int val); +SymType *ML_(st_mkenum)(SymType *, UInt ntags); +SymType *ML_(st_addtag)(SymType *, Char *name, Int val); -SymType *VG_(st_mkarray)(SymType *, SymType *idxtype, SymType *artype); +SymType *ML_(st_mkarray)(SymType *, SymType *idxtype, SymType *artype); -SymType *VG_(st_mktypedef)(SymType *, Char *name, SymType *type); +SymType *ML_(st_mktypedef)(SymType *, Char *name, SymType *type); -Bool VG_(st_isstruct)(SymType *); -Bool VG_(st_isunion)(SymType *); -Bool VG_(st_isenum)(SymType *); +Bool ML_(st_isstruct)(SymType *); +Bool ML_(st_isunion)(SymType *); +Bool ML_(st_isenum)(SymType *); /* ------------------------------------------------------------ Interface with symtab.c @@ -104,7 +104,7 @@ struct _Variable { Variable *container; }; -Variable *VG_(get_scope_variables)(ThreadId tid); +Variable *ML_(get_scope_variables)(ThreadId tid); #endif // __PRIV_SYMTYPES_H diff --git a/coregrind/m_debuginfo/stabs.c b/coregrind/m_debuginfo/stabs.c index db0816b12e..f1be29a743 100644 --- a/coregrind/m_debuginfo/stabs.c +++ b/coregrind/m_debuginfo/stabs.c @@ -153,11 +153,11 @@ static SymType *structRef(StabTypeTab *tab, SymType *def, Bool isstruct, Char *n sl = VG_(arena_malloc)(VG_AR_SYMTAB, sizeof(*sl)); if (isstruct) - ty = VG_(st_mkstruct)(def, 0, 0); + ty = ML_(st_mkstruct)(def, 0, 0); else - ty = VG_(st_mkunion)(def, 0, 0); + ty = ML_(st_mkunion)(def, 0, 0); - VG_(st_setname)(ty, name); + ML_(st_setname)(ty, name); sl->isstruct = isstruct; sl->type = ty; sl->name = name; @@ -190,9 +190,9 @@ static SymType *structDef(StabTypeTab *tab, SymType *def, Bool isstruct, Char *n VG_(printf)("defining %s ref for %s %p -> %p\n", isstruct ? "struct" : "union", name, ref, def); - def = VG_(st_mktypedef)(ref, name, VG_(st_basetype)(def, False)); + def = ML_(st_mktypedef)(ref, name, ML_(st_basetype)(def, False)); } - VG_(st_setname)(def, name); + ML_(st_setname)(def, name); return def; } @@ -484,7 +484,7 @@ static void stab_resolve(SymType *st, void *data) { static const Bool debug = False || stabs_debug; Char *str = (Char *)data; - vg_assert(!VG_(st_isresolved)(st)); + vg_assert(!ML_(st_isresolved)(st)); if (debug) VG_(printf)("stab_resolve: failing to do anything useful with symtype %p=%s\n", @@ -555,7 +555,7 @@ static SymType *stabtype_parser(SegInfo *si, SymType *def, Char **pp) } if (stabtype->type == NULL) { - stabtype->type = VG_(st_mkunresolved)(def, stab_resolve, NULL); + stabtype->type = ML_(st_mkunresolved)(def, stab_resolve, NULL); if (debug) VG_(printf)("making (%d,%d) %p unresolved\n", file, sym, stabtype->type); } @@ -567,16 +567,16 @@ static SymType *stabtype_parser(SegInfo *si, SymType *def, Char **pp) /* a type definition */ p++; - if (VG_(st_isresolved)(symtype)) { + if (ML_(st_isresolved)(symtype)) { /* a redefinition; clear the old type out */ StabType *stabtype = getStabType(tab, file, sym); - symtype = stabtype->type = VG_(st_mkunresolved)(NULL, stab_resolve, NULL); + symtype = stabtype->type = ML_(st_mkunresolved)(NULL, stab_resolve, NULL); if (debug) VG_(printf)("creating new type %p for definition (%d,%d)\n", symtype, file, sym); } else - VG_(st_unresolved_setdata)(symtype, stab_resolve, p); + ML_(st_unresolved_setdata)(symtype, stab_resolve, p); if (debug) VG_(printf)("defining type %p (%d,%d) = %s\n", symtype, file, sym, p); @@ -600,23 +600,23 @@ static SymType *stabtype_parser(SegInfo *si, SymType *def, Char **pp) vg_assert(stabtype->type != NULL); if (0) { /* XXX bogus */ - vg_assert(!VG_(st_isresolved)(stabtype->type)); + vg_assert(!ML_(st_isresolved)(stabtype->type)); VG_(arena_free)(VG_AR_SYMTAB, stabtype->type); /* XXX proper free method? */ } stabtype->type = type; - } else if (!VG_(st_isresolved)(type)) { + } else if (!ML_(st_isresolved)(type)) { /* If type is defined in terms of itself, and is therefore not resolved, it is void */ if (debug) VG_(printf)("type %p is defined in terms of self - making void\n", type); - type = VG_(st_mkvoid)(type); + type = ML_(st_mkvoid)(type); } } else { /* just a type reference */ type = symtype; - if ((0 || debug) && !VG_(st_isresolved)(type)) + if ((0 || debug) && !ML_(st_isresolved)(type)) VG_(printf)("type %p (%d,%d) is unresolved\n", type, file, sym); - if ((0 || debug) && VG_(st_isresolved)(type)) + if ((0 || debug) && ML_(st_isresolved)(type)) VG_(printf)("reference (%d,%d) -> %p\n", file, sym, type); } break; @@ -627,35 +627,35 @@ static SymType *stabtype_parser(SegInfo *si, SymType *def, Char **pp) p--; n = atoi(&p, 0); switch(n) { - case -1: type = VG_(st_mkint)(def, 4, True); break; - case -2: type = VG_(st_mkint)(def, 1, True); break; - case -3: type = VG_(st_mkint)(def, 2, True); break; - case -4: type = VG_(st_mkint)(def, 4, True); break; - case -5: type = VG_(st_mkint)(def, 1, False); break; - case -6: type = VG_(st_mkint)(def, 1, True); break; - case -7: type = VG_(st_mkint)(def, 2, False); break; - case -8: type = VG_(st_mkint)(def, 4, False); break; - case -9: type = VG_(st_mkint)(def, 4, False); break; - case -10: type = VG_(st_mkint)(def, 4, False); break; - case -11: type = VG_(st_mkvoid)(def); break; - case -12: type = VG_(st_mkfloat)(def, 4); break; - case -13: type = VG_(st_mkfloat)(def, 8); break; - case -15: type = VG_(st_mkint)(def, 4, True); break; - case -16: type = VG_(st_mkbool)(def, 4); break; - case -17: type = VG_(st_mkfloat)(def, 4); break; - case -18: type = VG_(st_mkfloat)(def, 8); break; - case -20: type = VG_(st_mkint)(def, 1, False); break; - case -21: type = VG_(st_mkint)(def, 1, False); break; - case -22: type = VG_(st_mkint)(def, 2, False); break; - case -23: type = VG_(st_mkint)(def, 4, False); break; - case -24: type = VG_(st_mkint)(def, 4, False); break; - case -27: type = VG_(st_mkint)(def, 1, True); break; - case -28: type = VG_(st_mkint)(def, 2, True); break; - case -29: type = VG_(st_mkint)(def, 4, True); break; - case -31: type = VG_(st_mkint)(def, 8, True); break; - case -32: type = VG_(st_mkint)(def, 8, False); break; - case -33: type = VG_(st_mkint)(def, 8, False); break; - case -34: type = VG_(st_mkint)(def, 8, True); break; + case -1: type = ML_(st_mkint)(def, 4, True); break; + case -2: type = ML_(st_mkint)(def, 1, True); break; + case -3: type = ML_(st_mkint)(def, 2, True); break; + case -4: type = ML_(st_mkint)(def, 4, True); break; + case -5: type = ML_(st_mkint)(def, 1, False); break; + case -6: type = ML_(st_mkint)(def, 1, True); break; + case -7: type = ML_(st_mkint)(def, 2, False); break; + case -8: type = ML_(st_mkint)(def, 4, False); break; + case -9: type = ML_(st_mkint)(def, 4, False); break; + case -10: type = ML_(st_mkint)(def, 4, False); break; + case -11: type = ML_(st_mkvoid)(def); break; + case -12: type = ML_(st_mkfloat)(def, 4); break; + case -13: type = ML_(st_mkfloat)(def, 8); break; + case -15: type = ML_(st_mkint)(def, 4, True); break; + case -16: type = ML_(st_mkbool)(def, 4); break; + case -17: type = ML_(st_mkfloat)(def, 4); break; + case -18: type = ML_(st_mkfloat)(def, 8); break; + case -20: type = ML_(st_mkint)(def, 1, False); break; + case -21: type = ML_(st_mkint)(def, 1, False); break; + case -22: type = ML_(st_mkint)(def, 2, False); break; + case -23: type = ML_(st_mkint)(def, 4, False); break; + case -24: type = ML_(st_mkint)(def, 4, False); break; + case -27: type = ML_(st_mkint)(def, 1, True); break; + case -28: type = ML_(st_mkint)(def, 2, True); break; + case -29: type = ML_(st_mkint)(def, 4, True); break; + case -31: type = ML_(st_mkint)(def, 8, True); break; + case -32: type = ML_(st_mkint)(def, 8, False); break; + case -33: type = ML_(st_mkint)(def, 8, False); break; + case -34: type = ML_(st_mkint)(def, 8, True); break; default: VG_(printf)(" @@ unrecognized negative type %d\n", n); @@ -673,7 +673,7 @@ static SymType *stabtype_parser(SegInfo *si, SymType *def, Char **pp) case 't': { /* typedef: 't' TYPE */ SymType *td = stabtype_parser(si, NULL, &p); - type = VG_(st_mktypedef)(def, NULL, td); + type = ML_(st_mktypedef)(def, NULL, td); break; } @@ -685,7 +685,7 @@ static SymType *stabtype_parser(SegInfo *si, SymType *def, Char **pp) bytes = atoi(&p, 0); EXPECT(';', "FP-TYPE bytes"); - type = VG_(st_mkfloat)(def, bytes); + type = ML_(st_mkfloat)(def, bytes); break; } @@ -710,16 +710,16 @@ static SymType *stabtype_parser(SegInfo *si, SymType *def, Char **pp) if (rtype == def) { if (debug) VG_(printf)("type %p is subrange of self - making int\n", def); - type = VG_(st_mkint)(def, sizeof(int), False); + type = ML_(st_mkint)(def, sizeof(int), False); } else if (min > max && max == 0) { if (debug) VG_(printf)("type %p has backwards range %d - %d: making float\n", def, min, max); - type = VG_(st_mkfloat)(def, min); + type = ML_(st_mkfloat)(def, min); } else - type = VG_(st_mkrange)(def, rtype, min, max); + type = ML_(st_mkrange)(def, rtype, min, max); - vg_assert(VG_(st_isresolved)(type)); + vg_assert(ML_(st_isresolved)(type)); break; } @@ -727,7 +727,7 @@ static SymType *stabtype_parser(SegInfo *si, SymType *def, Char **pp) case '*': { /* pointer */ /* ('*' | '&') TYPE */ type = stabtype_parser(si, NULL, &p); - type = VG_(st_mkpointer)(def, type); + type = ML_(st_mkpointer)(def, type); break; } @@ -746,7 +746,7 @@ static SymType *stabtype_parser(SegInfo *si, SymType *def, Char **pp) p = templ_name(name); EXPECT(':', "struct/union/enum ref"); - name = VG_(addStr)(si, name, p-1-name); + name = ML_(addStr)(si, name, p-1-name); switch (kind) { case 's': /* struct */ @@ -755,7 +755,7 @@ static SymType *stabtype_parser(SegInfo *si, SymType *def, Char **pp) break; case 'e': /* enum */ - type = VG_(st_mkenum)(def, 0); + type = ML_(st_mkenum)(def, 0); break; default: @@ -772,7 +772,7 @@ static SymType *stabtype_parser(SegInfo *si, SymType *def, Char **pp) typeinfo = stabtype_parser(si, NULL, &p); - type = VG_(st_mkarray)(def, typeinfo, VG_(st_mkint)(NULL, 1, True)); + type = ML_(st_mkarray)(def, typeinfo, ML_(st_mkint)(NULL, 1, True)); break; } @@ -785,7 +785,7 @@ static SymType *stabtype_parser(SegInfo *si, SymType *def, Char **pp) idxtype = stabtype_parser(si, NULL, &p); artype = stabtype_parser(si, NULL, &p); - type = VG_(st_mkarray)(def, idxtype, artype); + type = ML_(st_mkarray)(def, idxtype, artype); break; } @@ -793,7 +793,7 @@ static SymType *stabtype_parser(SegInfo *si, SymType *def, Char **pp) case 'e': { /* enum */ /* 'e' ( NAME ':' N ',' )* ';' */ - type = VG_(st_mkenum)(def, 0); + type = ML_(st_mkenum)(def, 0); /* don't really care about tags; just skip them */ while(*p != ';') { @@ -826,7 +826,7 @@ static SymType *stabtype_parser(SegInfo *si, SymType *def, Char **pp) Bool method = False; size = atou(&p, 0); - type = (t == 's' ? VG_(st_mkstruct) : VG_(st_mkunion))(def, size, 0); + type = (t == 's' ? ML_(st_mkstruct) : ML_(st_mkunion))(def, size, 0); if (*p == '!') { /* base classes */ @@ -866,10 +866,10 @@ static SymType *stabtype_parser(SegInfo *si, SymType *def, Char **pp) appear as "operator==::" */ end = SKIPPAST(end, '.', "op$ name"); } - name = VG_(addStr)(si, p, end-p); + name = ML_(addStr)(si, p, end-p); p = end+2; } else { - name = VG_(addStr)(si, p, end-p); + name = ML_(addStr)(si, p, end-p); p = end+1; } @@ -941,7 +941,7 @@ static SymType *stabtype_parser(SegInfo *si, SymType *def, Char **pp) } if (fieldty != NULL) - VG_(st_addfield)(type, name, fieldty, off, sz); + ML_(st_addfield)(type, name, fieldty, off, sz); EXPECT(';', "struct field end"); } @@ -961,7 +961,7 @@ static SymType *stabtype_parser(SegInfo *si, SymType *def, Char **pp) case 'f': /* function */ /* 'f' TYPE */ - type = VG_(st_mkvoid)(def); /* approximate functions as void */ + type = ML_(st_mkvoid)(def); /* approximate functions as void */ stabtype_parser(si, NULL, &p); break; @@ -970,7 +970,7 @@ static SymType *stabtype_parser(SegInfo *si, SymType *def, Char **pp) CLASS-TYPE ',' RET-TYPE ',' ( ARG-TYPE ( ',' ARG-TYPE )* )? ) ';' */ - type = VG_(st_mkvoid)(def); /* methods are really void */ + type = ML_(st_mkvoid)(def); /* methods are really void */ if (*p == '#') { p++; /* skip '#' */ @@ -996,7 +996,7 @@ static SymType *stabtype_parser(SegInfo *si, SymType *def, Char **pp) case '@': /* pointer to member */ /* '@' CLASS-TYPE ',' MEMBER-TYPE */ - type = VG_(st_mkint)(def, sizeof(int), False); /* make it an int for our use */ + type = ML_(st_mkint)(def, sizeof(int), False); /* make it an int for our use */ stabtype_parser(si, NULL, &p); /* CLASS-TYPE */ EXPECT(',', "member-pointer CLASS-TYPE"); @@ -1057,7 +1057,7 @@ static Bool initSym(SegInfo *si, Sym *sym, stab_types kind, Char **namep, Int va if (*ty != ':') { /* no type info */ - sym->type = VG_(st_mkvoid)(NULL); + sym->type = ML_(st_mkvoid)(NULL); } else { ty++; /* skip ':' */ @@ -1090,19 +1090,19 @@ static Bool initSym(SegInfo *si, Sym *sym, stab_types kind, Char **namep, Int va out: sym->type = stabtype_parser(si, NULL, &ty); - base = VG_(st_basetype)(sym->type, False); - if (isStruct && (VG_(st_isstruct)(base) || VG_(st_isunion)(base))) { - Char *sname = VG_(addStr)(si, name, len); - structDef(si->stab_typetab, base, VG_(st_isstruct)(base), sname); + base = ML_(st_basetype)(sym->type, False); + if (isStruct && (ML_(st_isstruct)(base) || ML_(st_isunion)(base))) { + Char *sname = ML_(addStr)(si, name, len); + structDef(si->stab_typetab, base, ML_(st_isstruct)(base), sname); } if (isTypedef) { - Char *tname = VG_(addStr)(si, name, len); + Char *tname = ML_(addStr)(si, name, len); vg_assert(sym->type != base); if (debug) VG_(printf)(" typedef %p \"%s\"\n", sym->type, tname); - VG_(st_setname)(sym->type, tname); - VG_(st_setname)(base, tname); + ML_(st_setname)(sym->type, tname); + ML_(st_setname)(base, tname); } } *namep = ty; @@ -1147,7 +1147,7 @@ static Bool initSym(SegInfo *si, Sym *sym, stab_types kind, Char **namep, Int va if (isStruct || isTypedef) { return True; /* skip */ } else { - sym->name = VG_(addStr)(si, name, len); + sym->name = ML_(addStr)(si, name, len); return False; /* don't skip */ } } @@ -1205,7 +1205,7 @@ static Scope *addSymsToScope(Scope *sc, struct symlist *list, Int nsyms, Scope * /* Read stabs-format debug info. This is all rather horrible because stabs is a underspecified, kludgy hack. */ -void VG_(read_debuginfo_stabs) ( SegInfo* si, +void ML_(read_debuginfo_stabs) ( SegInfo* si, UChar* stabC, Int stab_sz, UChar* stabstr, Int stabstr_sz ) { @@ -1264,7 +1264,7 @@ void VG_(read_debuginfo_stabs) ( SegInfo* si, Finding the instruction address range covered by an N_SLINE is complicated; see the N_SLINE case below. */ - file.name = VG_(addStr)(si,"???", -1); + file.name = ML_(addStr)(si,"???", -1); n_stab_entries = stab_sz/(int)sizeof(struct nlist); @@ -1354,7 +1354,7 @@ void VG_(read_debuginfo_stabs) ( SegInfo* si, if (buf != NULL) { i--; /* overstepped */ - string = VG_(addStr)(si, buf, idx); + string = ML_(addStr)(si, buf, idx); VG_(arena_free)(VG_AR_SYMTAB, buf); if (contdebug) VG_(printf)("made composite: \"%s\"\n", string); @@ -1415,7 +1415,7 @@ void VG_(read_debuginfo_stabs) ( SegInfo* si, if (line.addr != 0) { /* finish off previous line */ - VG_(addLineInfo)(si, file.name, NULL, line.addr, + ML_(addLineInfo)(si, file.name, NULL, line.addr, addr, line.no + line.ovf * LINENO_OVERFLOW, i); } @@ -1427,7 +1427,7 @@ void VG_(read_debuginfo_stabs) ( SegInfo* si, line.jump = True; if (len > 0 && nm[len-1] != '/') { - file.name = VG_(addStr)(si, nm, -1); + file.name = ML_(addStr)(si, nm, -1); if (debug) VG_(printf)("new source: %s\n", file.name); if (st->n_type == N_SO) { @@ -1435,7 +1435,7 @@ void VG_(read_debuginfo_stabs) ( SegInfo* si, clearStabFiles(tab); } } else if (len == 0) - file.name = VG_(addStr)(si, "?1\0", -1); + file.name = ML_(addStr)(si, "?1\0", -1); if (func.start != 0) line.jump = True; @@ -1447,7 +1447,7 @@ void VG_(read_debuginfo_stabs) ( SegInfo* si, if (line.addr != 0) { /* there was a previous */ - VG_(addLineInfo)(si, file.name, NULL, line.addr, + ML_(addLineInfo)(si, file.name, NULL, line.addr, addr, line.no + line.ovf * LINENO_OVERFLOW, i); } @@ -1521,7 +1521,7 @@ void VG_(read_debuginfo_stabs) ( SegInfo* si, if (scope.addr != 0) { /* finish any previous scope range */ - VG_(addScopeInfo)(si, scope.addr, addr, scope.scope); + ML_(addScopeInfo)(si, scope.addr, addr, scope.scope); } /* tidy up arg scope */ @@ -1556,14 +1556,14 @@ void VG_(read_debuginfo_stabs) ( SegInfo* si, } if (line.addr) { - VG_(addLineInfo)(si, file.name, NULL, line.addr, + ML_(addLineInfo)(si, file.name, NULL, line.addr, addr, line.no + line.ovf * LINENO_OVERFLOW, i); line.addr = 0; } if (scope.addr) { /* finish any previous scope range */ - VG_(addScopeInfo)(si, scope.addr, addr, scope.scope); + ML_(addScopeInfo)(si, scope.addr, addr, scope.scope); } if (newfunc) { @@ -1571,7 +1571,7 @@ void VG_(read_debuginfo_stabs) ( SegInfo* si, Scope *sc; if (scope.addr) { /* finish any previous scope range */ - VG_(addScopeInfo)(si, scope.addr, addr, scope.scope); + ML_(addScopeInfo)(si, scope.addr, addr, scope.scope); } sc = addSymsToScope(NULL, scope.symlist, scope.nsyms, scope.scope); @@ -1590,7 +1590,7 @@ void VG_(read_debuginfo_stabs) ( SegInfo* si, if (scope.addr) { /* end previous range */ - VG_(addScopeInfo)(si, scope.addr, addr, scope.scope); + ML_(addScopeInfo)(si, scope.addr, addr, scope.scope); } scope.addr = addr; @@ -1626,7 +1626,7 @@ void VG_(read_debuginfo_stabs) ( SegInfo* si, } vg_assert(scope.addr != 0); - VG_(addScopeInfo)(si, scope.addr, addr, scope.scope); + ML_(addScopeInfo)(si, scope.addr, addr, scope.scope); /* XXX LEAK: free scope if it or any of its inner scopes was never added to a scope range */ diff --git a/coregrind/m_debuginfo/symtab.c b/coregrind/m_debuginfo/symtab.c index 49738f2df0..8624f12108 100644 --- a/coregrind/m_debuginfo/symtab.c +++ b/coregrind/m_debuginfo/symtab.c @@ -130,7 +130,7 @@ static void freeSegInfo ( SegInfo* si ) pointers are stable. */ -Char *VG_(addStr) ( SegInfo* si, Char* str, Int len ) +Char* ML_(addStr) ( SegInfo* si, Char* str, Int len ) { struct strchunk *chunk; Int space_needed; @@ -219,7 +219,7 @@ void addLoc ( SegInfo* si, RiLoc* loc ) /* Top-level place to call to add a source-location mapping entry. */ -void VG_(addLineInfo) ( SegInfo* si, +void ML_(addLineInfo) ( SegInfo* si, Char* filename, Char* dirname, /* NULL == directory is unknown */ Addr this, @@ -329,7 +329,7 @@ void addScopeRange ( SegInfo* si, ScopeRange *range ) /* Top-level place to call to add a source-location mapping entry. */ -void VG_(addScopeInfo) ( SegInfo* si, +void ML_(addScopeInfo) ( SegInfo* si, Addr this, Addr next, Scope *scope) @@ -359,13 +359,13 @@ void VG_(addScopeInfo) ( SegInfo* si, /* Top-level place to call to add a CFI summary record. The supplied CfiSI is copied. */ -void VG_(addCfiSI) ( SegInfo* si, CfiSI* cfisi ) +void ML_(addCfiSI) ( SegInfo* si, CfiSI* cfisi ) { static const Bool debug = False; if (debug) { VG_(printf)("adding CfiSI: "); - VG_(ppCfiSI)(cfisi); + ML_(ppCfiSI)(cfisi); } vg_assert(cfisi->len > 0 && cfisi->len < 2000000); @@ -392,7 +392,7 @@ void VG_(addCfiSI) ( SegInfo* si, CfiSI* cfisi ) ); } if (VG_(clo_trace_cfi)) - VG_(ppCfiSI)(cfisi); + ML_(ppCfiSI)(cfisi); } return; } @@ -421,7 +421,7 @@ void VG_(addCfiSI) ( SegInfo* si, CfiSI* cfisi ) /*------------------------------------------------------------*/ /* Non-fatal -- use vg_panic if terminal. */ -void VG_(symerr) ( Char* msg ) +void ML_(symerr) ( Char* msg ) { if (VG_(clo_verbosity) > 1) VG_(message)(Vg_DebugMsg,"%s", msg ); @@ -996,7 +996,7 @@ void read_symtab( SegInfo* si, Char* tab_name, Bool do_intercepts, Char buf[80]; vg_assert(VG_(strlen)(tab_name) < 40); VG_(sprintf)(buf, " object doesn't have a %s", tab_name); - VG_(symerr)(buf); + ML_(symerr)(buf); return; } @@ -1040,7 +1040,7 @@ void read_symtab( SegInfo* si, Char* tab_name, Bool do_intercepts, if ( is_interesting_symbol(si, sym, sym_name, sym_addr) ) { vg_assert(sym->st_name != 0); vg_assert(sym_name[0] != 0); - name = VG_(addStr) ( si, sym_name, -1 ); + name = ML_(addStr) ( si, sym_name, -1 ); vg_assert(name != NULL); /* @@ -1239,14 +1239,14 @@ Bool read_lib_symbols ( SegInfo* si ) i = VG_(stat)(si->filename, &stat_buf); if (i != 0) { - VG_(symerr)("Can't stat .so/.exe (to determine its size)?!"); + ML_(symerr)("Can't stat .so/.exe (to determine its size)?!"); return False; } n_oimage = stat_buf.st_size; fd = VG_(open)(si->filename, VKI_O_RDONLY, 0); if (fd < 0) { - VG_(symerr)("Can't open .so/.exe to read symbols?!"); + ML_(symerr)("Can't open .so/.exe to read symbols?!"); return False; } @@ -1273,7 +1273,7 @@ Bool read_lib_symbols ( SegInfo* si ) ok &= VG_(is_object_file)(ehdr); if (!ok) { - VG_(symerr)("Invalid ELF header, or missing stringtab/sectiontab."); + ML_(symerr)("Invalid ELF header, or missing stringtab/sectiontab."); goto out; } @@ -1282,7 +1282,7 @@ Bool read_lib_symbols ( SegInfo* si ) bss memory. Also computes correct symbol offset value for this ELF file. */ if (ehdr->e_phoff + ehdr->e_phnum*sizeof(ElfXX_Phdr) > n_oimage) { - VG_(symerr)("ELF program header is beyond image end?!"); + ML_(symerr)("ELF program header is beyond image end?!"); goto out; } { @@ -1332,7 +1332,7 @@ Bool read_lib_symbols ( SegInfo* si ) } if (o_phdr->p_vaddr < prev_addr) { - VG_(symerr)("ELF Phdrs are out of order!?"); + ML_(symerr)("ELF Phdrs are out of order!?"); goto out; } prev_addr = o_phdr->p_vaddr; @@ -1400,7 +1400,7 @@ Bool read_lib_symbols ( SegInfo* si ) ehdr->e_shoff, ehdr->e_shnum, sizeof(ElfXX_Shdr), n_oimage ); if (ehdr->e_shoff + ehdr->e_shnum*sizeof(ElfXX_Shdr) > n_oimage) { - VG_(symerr)("ELF section header is beyond image end?!"); + ML_(symerr)("ELF section header is beyond image end?!"); goto out; } @@ -1463,7 +1463,7 @@ Bool read_lib_symbols ( SegInfo* si ) TRACE_SYMTAB( "%18s: %p .. %p\n", \ sec_name, sec_data, sec_data + sec_size - 1); \ if ( shdr[i].sh_offset + sec_size > n_oimage ) { \ - VG_(symerr)(" section beyond image end?!"); \ + ML_(symerr)(" section beyond image end?!"); \ goto out; \ } \ } @@ -1529,7 +1529,7 @@ Bool read_lib_symbols ( SegInfo* si ) TRACE_SYMTAB( "%18s: %p .. %p\n", \ sec_name, sec_data, sec_data + sec_size - 1); \ if ( shdr[i].sh_offset + sec_size > n_dimage ) { \ - VG_(symerr)(" section beyond image end?!"); \ + ML_(symerr)(" section beyond image end?!"); \ goto out; \ } \ } @@ -1562,7 +1562,7 @@ Bool read_lib_symbols ( SegInfo* si ) /* Read .eh_frame (call-frame-info) if any */ if (ehframe) { - VG_(read_callframe_info_dwarf2) ( si, ehframe, ehframe_sz, ehframe_addr ); + ML_(read_callframe_info_dwarf2) ( si, ehframe, ehframe_sz, ehframe_addr ); } /* Read the stabs and/or dwarf2 debug information, if any. It @@ -1571,13 +1571,13 @@ Bool read_lib_symbols ( SegInfo* si ) # if !defined(VGP_amd64_linux) if (stab != NULL && stabstr != NULL) { has_debuginfo = True; - VG_(read_debuginfo_stabs) ( si, stab, stab_sz, + ML_(read_debuginfo_stabs) ( si, stab, stab_sz, stabstr, stabstr_sz ); } # endif if (debug_line) { has_debuginfo = True; - VG_(read_debuginfo_dwarf2) ( si, + ML_(read_debuginfo_dwarf2) ( si, debug_info, debug_info_sz, debug_abbv, debug_line, debug_line_sz, @@ -1585,11 +1585,11 @@ Bool read_lib_symbols ( SegInfo* si ) } if (dwarf1d && dwarf1l) { has_debuginfo = True; - VG_(read_debuginfo_dwarf1) ( si, dwarf1d, dwarf1d_sz, + ML_(read_debuginfo_dwarf1) ( si, dwarf1d, dwarf1d_sz, dwarf1l, dwarf1l_sz ); } if (!has_debuginfo) { - VG_(symerr)(" object doesn't have any line number info"); + ML_(symerr)(" object doesn't have any line number info"); goto out; } } @@ -2233,7 +2233,7 @@ static Addr regaddr(ThreadId tid, Int regno) /* Get a list of all variables in scope, working out from the directly current one */ -Variable *VG_(get_scope_variables)(ThreadId tid) +Variable* ML_(get_scope_variables)(ThreadId tid) { static const Bool debug = False; Variable *list, *end; @@ -2291,10 +2291,10 @@ Variable *VG_(get_scope_variables)(ThreadId tid) v->next = NULL; v->distance = distance; - v->type = VG_(st_basetype)(sym->type, False); + v->type = ML_(st_basetype)(sym->type, False); v->name = VG_(arena_strdup)(VG_AR_SYMTAB, sym->name); v->container = NULL; - v->size = VG_(st_sizeof)(sym->type); + v->size = ML_(st_sizeof)(sym->type); if (debug && 0) VG_(printf)("sym->name=%s sym->kind=%d offset=%d\n", sym->name, sym->kind, sym->u.offset); @@ -2516,7 +2516,7 @@ Bool VG_(use_CFI_info) ( /*MOD*/Addr* ipP, if (0) { VG_(printf)("found cfisi: "); - VG_(ppCfiSI)(cfisi); + ML_(ppCfiSI)(cfisi); } ipPrev = spPrev = fpPrev = 0; diff --git a/coregrind/m_debuginfo/symtypes.c b/coregrind/m_debuginfo/symtypes.c index fcf7f61d26..6cc4786ae8 100644 --- a/coregrind/m_debuginfo/symtypes.c +++ b/coregrind/m_debuginfo/symtypes.c @@ -166,17 +166,17 @@ struct _SymType { }; -Bool VG_(st_isstruct)(SymType *ty) +Bool ML_(st_isstruct)(SymType *ty) { return ty->kind == TyStruct; } -Bool VG_(st_isunion)(SymType *ty) +Bool ML_(st_isunion)(SymType *ty) { return ty->kind == TyUnion; } -Bool VG_(st_isenum)(SymType *ty) +Bool ML_(st_isenum)(SymType *ty) { return ty->kind == TyEnum; } @@ -203,7 +203,7 @@ static void resolve(SymType *st) st->kind = TyError; } -SymType *VG_(st_mkunresolved)(SymType *st, SymResolver *resolver, void *data) +SymType *ML_(st_mkunresolved)(SymType *st, SymResolver *resolver, void *data) { st = alloc(st); @@ -217,7 +217,7 @@ SymType *VG_(st_mkunresolved)(SymType *st, SymResolver *resolver, void *data) return st; } -void VG_(st_unresolved_setdata)(SymType *st, SymResolver *resolver, void *data) +void ML_(st_unresolved_setdata)(SymType *st, SymResolver *resolver, void *data) { if (st->kind != TyUnresolved) return; @@ -226,18 +226,18 @@ void VG_(st_unresolved_setdata)(SymType *st, SymResolver *resolver, void *data) st->u.t_unresolved.data = data; } -Bool VG_(st_isresolved)(SymType *st) +Bool ML_(st_isresolved)(SymType *st) { return st->kind != TyUnresolved; } -void VG_(st_setname)(SymType *st, Char *name) +void ML_(st_setname)(SymType *st, Char *name) { if (st->name != NULL) st->name = name; } -SymType *VG_(st_mkvoid)(SymType *st) +SymType *ML_(st_mkvoid)(SymType *st) { st = alloc(st); @@ -249,7 +249,7 @@ SymType *VG_(st_mkvoid)(SymType *st) return st; } -SymType *VG_(st_mkint)(SymType *st, UInt size, Bool isSigned) +SymType *ML_(st_mkint)(SymType *st, UInt size, Bool isSigned) { st = alloc(st); @@ -262,7 +262,7 @@ SymType *VG_(st_mkint)(SymType *st, UInt size, Bool isSigned) return st; } -SymType *VG_(st_mkfloat)(SymType *st, UInt size) +SymType *ML_(st_mkfloat)(SymType *st, UInt size) { st = alloc(st); @@ -275,7 +275,7 @@ SymType *VG_(st_mkfloat)(SymType *st, UInt size) return st; } -SymType *VG_(st_mkbool)(SymType *st, UInt size) +SymType *ML_(st_mkbool)(SymType *st, UInt size) { st = alloc(st); @@ -288,7 +288,7 @@ SymType *VG_(st_mkbool)(SymType *st, UInt size) } -SymType *VG_(st_mkpointer)(SymType *st, SymType *ptr) +SymType *ML_(st_mkpointer)(SymType *st, SymType *ptr) { st = alloc(st); @@ -301,7 +301,7 @@ SymType *VG_(st_mkpointer)(SymType *st, SymType *ptr) return st; } -SymType *VG_(st_mkrange)(SymType *st, SymType *ty, Int min, Int max) +SymType *ML_(st_mkrange)(SymType *st, SymType *ty, Int min, Int max) { st = alloc(st); @@ -316,7 +316,7 @@ SymType *VG_(st_mkrange)(SymType *st, SymType *ty, Int min, Int max) return st; } -SymType *VG_(st_mkstruct)(SymType *st, UInt size, UInt nfields) +SymType *ML_(st_mkstruct)(SymType *st, UInt size, UInt nfields) { st = alloc(st); @@ -336,7 +336,7 @@ SymType *VG_(st_mkstruct)(SymType *st, UInt size, UInt nfields) return st; } -SymType *VG_(st_mkunion)(SymType *st, UInt size, UInt nfields) +SymType *ML_(st_mkunion)(SymType *st, UInt size, UInt nfields) { st = alloc(st); @@ -356,7 +356,7 @@ SymType *VG_(st_mkunion)(SymType *st, UInt size, UInt nfields) return st; } -void VG_(st_addfield)(SymType *st, Char *name, SymType *type, UInt off, UInt size) +void ML_(st_addfield)(SymType *st, Char *name, SymType *type, UInt off, UInt size) { StField *f; @@ -380,7 +380,7 @@ void VG_(st_addfield)(SymType *st, Char *name, SymType *type, UInt off, UInt siz } -SymType *VG_(st_mkenum)(SymType *st, UInt ntags) +SymType *ML_(st_mkenum)(SymType *st, UInt ntags) { st = alloc(st); @@ -393,7 +393,7 @@ SymType *VG_(st_mkenum)(SymType *st, UInt ntags) return st; } -SymType *VG_(st_mkarray)(SymType *st, SymType *idxtype, SymType *type) +SymType *ML_(st_mkarray)(SymType *st, SymType *idxtype, SymType *type) { st = alloc(st); @@ -406,7 +406,7 @@ SymType *VG_(st_mkarray)(SymType *st, SymType *idxtype, SymType *type) return st; } -SymType *VG_(st_mktypedef)(SymType *st, Char *name, SymType *type) +SymType *ML_(st_mktypedef)(SymType *st, Char *name, SymType *type) { st = alloc(st); @@ -423,7 +423,7 @@ SymType *VG_(st_mktypedef)(SymType *st, Char *name, SymType *type) } -SymType *VG_(st_basetype)(SymType *type, Bool do_resolve) +SymType *ML_(st_basetype)(SymType *type, Bool do_resolve) { while (type->kind == TyTypedef || (do_resolve && type->kind == TyUnresolved)) { if (do_resolve) @@ -436,7 +436,7 @@ SymType *VG_(st_basetype)(SymType *type, Bool do_resolve) return type; } -UInt VG_(st_sizeof)(SymType *ty) +UInt ML_(st_sizeof)(SymType *ty) { return ty->size; } @@ -725,7 +725,7 @@ Char *VG_(describe_addr)(ThreadId tid, Addr addr) keeplist = NULL; eip = VG_(get_IP)(tid); - list = VG_(get_scope_variables)(tid); + list = ML_(get_scope_variables)(tid); if (memaccount) { Variable *v; @@ -785,7 +785,7 @@ Char *VG_(describe_addr)(ThreadId tid, Addr addr) v->name = VG_(arena_strdup)(VG_AR_SYMTAB, name); else v->name = NULL; - v->type = VG_(st_basetype)(ty, False); + v->type = ML_(st_basetype)(ty, False); v->valuep = valuep; v->size = size == -1 ? ty->size : size; v->container = var; @@ -835,7 +835,7 @@ Char *VG_(describe_addr)(ThreadId tid, Addr addr) break; } - type = VG_(st_basetype)(type, True); + type = ML_(st_basetype)(type, True); switch(type->kind) { case TyUnion: diff --git a/coregrind/m_scheduler/priv_sema.h b/coregrind/m_scheduler/priv_sema.h index 00b002d761..d6c52a8850 100644 --- a/coregrind/m_scheduler/priv_sema.h +++ b/coregrind/m_scheduler/priv_sema.h @@ -40,10 +40,10 @@ typedef struct { // Nb: this may be OS-specific, but let's not factor it out until we // implement an OS port for which this isn't ok. -void VG_(sema_init) ( vg_sema_t *sema ); -void VG_(sema_deinit) ( vg_sema_t *sema ); -void VG_(sema_down) ( vg_sema_t *sema ); -void VG_(sema_up) ( vg_sema_t *sema ); +void ML_(sema_init) ( vg_sema_t *sema ); +void ML_(sema_deinit) ( vg_sema_t *sema ); +void ML_(sema_down) ( vg_sema_t *sema ); +void ML_(sema_up) ( vg_sema_t *sema ); #endif // __PRIV_SEMA_H diff --git a/coregrind/m_scheduler/scheduler.c b/coregrind/m_scheduler/scheduler.c index b450203f70..c7b3a508c3 100644 --- a/coregrind/m_scheduler/scheduler.c +++ b/coregrind/m_scheduler/scheduler.c @@ -194,7 +194,7 @@ void VG_(set_running)(ThreadId tid) tst->status = VgTs_Runnable; - VG_(sema_down)(&run_sema); + ML_(sema_down)(&run_sema); if (VG_(running_tid) != VG_INVALID_THREADID) VG_(printf)("tid %d found %d running\n", tid, VG_(running_tid)); vg_assert(VG_(running_tid) == VG_INVALID_THREADID); @@ -227,7 +227,7 @@ void VG_(set_sleeping)(ThreadId tid, ThreadStatus sleepstate) /* Release the run_sema; this will reschedule any runnable thread. */ - VG_(sema_up)(&run_sema); + ML_(sema_up)(&run_sema); if (VG_(clo_trace_sched)) { Char buf[50]; @@ -252,7 +252,7 @@ void VG_(exit_thread)(ThreadId tid) /* There should still be a valid exitreason for this thread */ vg_assert(VG_(threads)[tid].exitreason != VgSrc_None); - VG_(sema_up)(&run_sema); + ML_(sema_up)(&run_sema); } /* Kill a thread. This interrupts whatever a thread is doing, and @@ -500,9 +500,9 @@ static void sched_fork_cleanup(ThreadId me) } /* re-init and take the sema */ - VG_(sema_deinit)(&run_sema); - VG_(sema_init)(&run_sema); - VG_(sema_down)(&run_sema); + ML_(sema_deinit)(&run_sema); + ML_(sema_init)(&run_sema); + ML_(sema_down)(&run_sema); } @@ -516,7 +516,7 @@ void VG_(scheduler_init) ( void ) Int i; ThreadId tid_main; - VG_(sema_init)(&run_sema); + ML_(sema_init)(&run_sema); for (i = 0 /* NB; not 1 */; i < VG_N_THREADS; i++) { diff --git a/coregrind/m_scheduler/sema.c b/coregrind/m_scheduler/sema.c index d3d30cf3c2..7171b14a37 100644 --- a/coregrind/m_scheduler/sema.c +++ b/coregrind/m_scheduler/sema.c @@ -39,7 +39,7 @@ pipe-based token passing scheme. */ -void VG_(sema_init)(vg_sema_t *sema) +void ML_(sema_init)(vg_sema_t *sema) { VG_(pipe)(sema->pipe); sema->pipe[0] = VG_(safe_fd)(sema->pipe[0]); @@ -51,7 +51,7 @@ void VG_(sema_init)(vg_sema_t *sema) VG_(write)(sema->pipe[1], "T", 1); } -void VG_(sema_deinit)(vg_sema_t *sema) +void ML_(sema_deinit)(vg_sema_t *sema) { VG_(close)(sema->pipe[0]); VG_(close)(sema->pipe[1]); @@ -59,7 +59,7 @@ void VG_(sema_deinit)(vg_sema_t *sema) } /* get a token */ -void VG_(sema_down)(vg_sema_t *sema) +void ML_(sema_down)(vg_sema_t *sema) { Char buf[2] = { 'x' }; Int ret; @@ -80,7 +80,7 @@ void VG_(sema_down)(vg_sema_t *sema) } /* put token back */ -void VG_(sema_up)(vg_sema_t *sema) +void ML_(sema_up)(vg_sema_t *sema) { Int ret; diff --git a/coregrind/m_syswrap/priv_syswrap-generic.h b/coregrind/m_syswrap/priv_syswrap-generic.h index e151c1b846..eed37b4f49 100644 --- a/coregrind/m_syswrap/priv_syswrap-generic.h +++ b/coregrind/m_syswrap/priv_syswrap-generic.h @@ -37,27 +37,27 @@ // Return true if address range entirely contained within client // address space. extern -Bool VG_(valid_client_addr)(Addr start, SizeT size, ThreadId tid, +Bool ML_(valid_client_addr)(Addr start, SizeT size, ThreadId tid, const Char *syscallname); // Returns True if the signal is OK for the client to use. -extern Bool VG_(client_signal_OK)(Int sigNo); +extern Bool ML_(client_signal_OK)(Int sigNo); // Return true if we're allowed to use or create this fd. extern -Bool VG_(fd_allowed)(Int fd, const Char *syscallname, ThreadId tid, Bool soft); +Bool ML_(fd_allowed)(Int fd, const Char *syscallname, ThreadId tid, Bool soft); extern -void VG_(record_fd_open)(ThreadId tid, Int fd, char *pathname); +void ML_(record_fd_open)(ThreadId tid, Int fd, char *pathname); // Used when killing threads -- we must not kill a thread if it's the thread // that would do Valgrind's final cleanup and output. extern -Bool VG_(do_sigkill)(Int pid, Int tgid); +Bool ML_(do_sigkill)(Int pid, Int tgid); /* So that it can be seen from syswrap-x86-linux.c. */ extern -void VG_(mmap_segment) ( Addr a, SizeT len, UInt prot, +void ML_(mmap_segment) ( Addr a, SizeT len, UInt prot, UInt mm_flags, Int fd, ULong offset ); @@ -269,45 +269,45 @@ DECL_TEMPLATE(generic, sys_mq_getsetattr); // * P? #define UW UWord #define SR SysRes -extern void VG_(generic_PRE_sys_socketpair) ( TId, UW, UW, UW, UW ); -extern SysRes VG_(generic_POST_sys_socketpair) ( TId, SR, UW, UW, UW, UW ); -extern SysRes VG_(generic_POST_sys_socket) ( TId, SR ); -extern void VG_(generic_PRE_sys_bind) ( TId, UW, UW, UW ); -extern void VG_(generic_PRE_sys_accept) ( TId, UW, UW, UW ); -extern SysRes VG_(generic_POST_sys_accept) ( TId, SR, UW, UW, UW ); -extern void VG_(generic_PRE_sys_sendto) ( TId, UW, UW, UW, UW, UW, UW ); -extern void VG_(generic_PRE_sys_send) ( TId, UW, UW, UW ); -extern void VG_(generic_PRE_sys_recvfrom) ( TId, UW, UW, UW, UW, UW, UW ); -extern void VG_(generic_POST_sys_recvfrom) ( TId, SR, UW, UW, UW, UW, UW, UW ); -extern void VG_(generic_PRE_sys_recv) ( TId, UW, UW, UW ); -extern void VG_(generic_POST_sys_recv) ( TId, UW, UW, UW, UW ); -extern void VG_(generic_PRE_sys_connect) ( TId, UW, UW, UW ); -extern void VG_(generic_PRE_sys_setsockopt) ( TId, UW, UW, UW, UW, UW ); -extern void VG_(generic_PRE_sys_getsockopt) ( TId, UW, UW, UW, UW, UW ); -extern void VG_(generic_POST_sys_getsockopt) ( TId, SR, UW, UW, UW, UW, UW ); -extern void VG_(generic_PRE_sys_getsockname) ( TId, UW, UW, UW ); -extern void VG_(generic_POST_sys_getsockname) ( TId, SR, UW, UW, UW ); -extern void VG_(generic_PRE_sys_getpeername) ( TId, UW, UW, UW ); -extern void VG_(generic_POST_sys_getpeername) ( TId, SR, UW, UW, UW ); -extern void VG_(generic_PRE_sys_sendmsg) ( TId, UW, UW ); -extern void VG_(generic_PRE_sys_recvmsg) ( TId, UW, UW ); -extern void VG_(generic_POST_sys_recvmsg) ( TId, UW, UW ); - -extern void VG_(generic_PRE_sys_semop) ( TId, UW, UW, UW ); -extern void VG_(generic_PRE_sys_semtimedop) ( TId, UW, UW, UW, UW ); -extern void VG_(generic_PRE_sys_semctl) ( TId, UW, UW, UW, UW ); -extern void VG_(generic_POST_sys_semctl) ( TId, UW, UW, UW, UW, UW ); -extern void VG_(generic_PRE_sys_msgsnd) ( TId, UW, UW, UW, UW ); -extern void VG_(generic_PRE_sys_msgrcv) ( TId, UW, UW, UW, UW, UW ); -extern void VG_(generic_POST_sys_msgrcv) ( TId, UW, UW, UW, UW, UW, UW ); -extern void VG_(generic_PRE_sys_msgctl) ( TId, UW, UW, UW ); -extern void VG_(generic_POST_sys_msgctl) ( TId, UW, UW, UW, UW ); -extern UWord VG_(generic_PRE_sys_shmat) ( TId, UW, UW, UW ); -extern void VG_(generic_POST_sys_shmat) ( TId, UW, UW, UW, UW ); -extern Bool VG_(generic_PRE_sys_shmdt) ( TId, UW ); -extern void VG_(generic_POST_sys_shmdt) ( TId, UW, UW ); -extern void VG_(generic_PRE_sys_shmctl) ( TId, UW, UW, UW ); -extern void VG_(generic_POST_sys_shmctl) ( TId, UW, UW, UW, UW ); +extern void ML_(generic_PRE_sys_socketpair) ( TId, UW, UW, UW, UW ); +extern SysRes ML_(generic_POST_sys_socketpair) ( TId, SR, UW, UW, UW, UW ); +extern SysRes ML_(generic_POST_sys_socket) ( TId, SR ); +extern void ML_(generic_PRE_sys_bind) ( TId, UW, UW, UW ); +extern void ML_(generic_PRE_sys_accept) ( TId, UW, UW, UW ); +extern SysRes ML_(generic_POST_sys_accept) ( TId, SR, UW, UW, UW ); +extern void ML_(generic_PRE_sys_sendto) ( TId, UW, UW, UW, UW, UW, UW ); +extern void ML_(generic_PRE_sys_send) ( TId, UW, UW, UW ); +extern void ML_(generic_PRE_sys_recvfrom) ( TId, UW, UW, UW, UW, UW, UW ); +extern void ML_(generic_POST_sys_recvfrom) ( TId, SR, UW, UW, UW, UW, UW, UW ); +extern void ML_(generic_PRE_sys_recv) ( TId, UW, UW, UW ); +extern void ML_(generic_POST_sys_recv) ( TId, UW, UW, UW, UW ); +extern void ML_(generic_PRE_sys_connect) ( TId, UW, UW, UW ); +extern void ML_(generic_PRE_sys_setsockopt) ( TId, UW, UW, UW, UW, UW ); +extern void ML_(generic_PRE_sys_getsockopt) ( TId, UW, UW, UW, UW, UW ); +extern void ML_(generic_POST_sys_getsockopt) ( TId, SR, UW, UW, UW, UW, UW ); +extern void ML_(generic_PRE_sys_getsockname) ( TId, UW, UW, UW ); +extern void ML_(generic_POST_sys_getsockname) ( TId, SR, UW, UW, UW ); +extern void ML_(generic_PRE_sys_getpeername) ( TId, UW, UW, UW ); +extern void ML_(generic_POST_sys_getpeername) ( TId, SR, UW, UW, UW ); +extern void ML_(generic_PRE_sys_sendmsg) ( TId, UW, UW ); +extern void ML_(generic_PRE_sys_recvmsg) ( TId, UW, UW ); +extern void ML_(generic_POST_sys_recvmsg) ( TId, UW, UW ); + +extern void ML_(generic_PRE_sys_semop) ( TId, UW, UW, UW ); +extern void ML_(generic_PRE_sys_semtimedop) ( TId, UW, UW, UW, UW ); +extern void ML_(generic_PRE_sys_semctl) ( TId, UW, UW, UW, UW ); +extern void ML_(generic_POST_sys_semctl) ( TId, UW, UW, UW, UW, UW ); +extern void ML_(generic_PRE_sys_msgsnd) ( TId, UW, UW, UW, UW ); +extern void ML_(generic_PRE_sys_msgrcv) ( TId, UW, UW, UW, UW, UW ); +extern void ML_(generic_POST_sys_msgrcv) ( TId, UW, UW, UW, UW, UW, UW ); +extern void ML_(generic_PRE_sys_msgctl) ( TId, UW, UW, UW ); +extern void ML_(generic_POST_sys_msgctl) ( TId, UW, UW, UW, UW ); +extern UWord ML_(generic_PRE_sys_shmat) ( TId, UW, UW, UW ); +extern void ML_(generic_POST_sys_shmat) ( TId, UW, UW, UW, UW ); +extern Bool ML_(generic_PRE_sys_shmdt) ( TId, UW ); +extern void ML_(generic_POST_sys_shmdt) ( TId, UW, UW ); +extern void ML_(generic_PRE_sys_shmctl) ( TId, UW, UW, UW ); +extern void ML_(generic_POST_sys_shmctl) ( TId, UW, UW, UW, UW ); #undef TId #undef UW diff --git a/coregrind/m_syswrap/priv_syswrap-linux.h b/coregrind/m_syswrap/priv_syswrap-linux.h index 8648000b66..770b5e5ce1 100644 --- a/coregrind/m_syswrap/priv_syswrap-linux.h +++ b/coregrind/m_syswrap/priv_syswrap-linux.h @@ -34,7 +34,7 @@ /* requires #include "priv_types_n_macros.h" */ // Run a thread from beginning to end. -extern VgSchedReturnCode VG_(thread_wrapper)(Word /*ThreadId*/ tid); +extern VgSchedReturnCode ML_(thread_wrapper)(Word /*ThreadId*/ tid); DECL_TEMPLATE(linux, sys_exit_group); diff --git a/coregrind/m_syswrap/priv_syswrap-main.h b/coregrind/m_syswrap/priv_syswrap-main.h index 652e612bee..78067b4749 100644 --- a/coregrind/m_syswrap/priv_syswrap-main.h +++ b/coregrind/m_syswrap/priv_syswrap-main.h @@ -33,7 +33,7 @@ /* Back up a thread so as to restart a system call. */ extern -void VG_(fixup_guest_state_to_restart_syscall) ( ThreadArchState* arch ); +void ML_(fixup_guest_state_to_restart_syscall) ( ThreadArchState* arch ); #endif // __PRIV_SYSWRAP_MAIN_H diff --git a/coregrind/m_syswrap/syswrap-generic.c b/coregrind/m_syswrap/syswrap-generic.c index f3c258ae43..db09e002bd 100644 --- a/coregrind/m_syswrap/syswrap-generic.c +++ b/coregrind/m_syswrap/syswrap-generic.c @@ -58,7 +58,7 @@ /* return true if address range entirely contained within client address space */ -Bool VG_(valid_client_addr)(Addr start, SizeT size, ThreadId tid, +Bool ML_(valid_client_addr)(Addr start, SizeT size, ThreadId tid, const Char *syscallname) { Addr end = start+size; @@ -93,7 +93,7 @@ Bool VG_(valid_client_addr)(Addr start, SizeT size, ThreadId tid, return ret; } -Bool VG_(client_signal_OK)(Int sigNo) +Bool ML_(client_signal_OK)(Int sigNo) { /* signal 0 is OK for kill */ Bool ret = sigNo >= 0 && sigNo <= VG_SIGVGRTUSERMAX; @@ -130,7 +130,7 @@ void mash_addr_and_len( Addr* a, SizeT* len) *a = ra; } -void VG_(mmap_segment) ( Addr a, SizeT len, UInt prot, +void ML_(mmap_segment) ( Addr a, SizeT len, UInt prot, UInt mm_flags, Int fd, ULong offset ) { Bool rr, ww, xx; @@ -169,7 +169,7 @@ SysRes mremap_segment ( Addr old_addr, SizeT old_size, if (VG_PGROUNDDN(old_addr) != old_addr) return VG_(mk_SysRes_Error)( VKI_EINVAL ); - if (!VG_(valid_client_addr)(old_addr, old_size, tid, "mremap(old_addr)")) + if (!ML_(valid_client_addr)(old_addr, old_size, tid, "mremap(old_addr)")) return VG_(mk_SysRes_Error)( VKI_EFAULT ); /* fixed at the current address means we don't move it */ @@ -180,7 +180,7 @@ SysRes mremap_segment ( Addr old_addr, SizeT old_size, if (VG_PGROUNDDN(new_addr) != new_addr) return VG_(mk_SysRes_Error)( VKI_EINVAL ); - if (!VG_(valid_client_addr)(new_addr, new_size, tid, "mremap(new_addr)")) + if (!ML_(valid_client_addr)(new_addr, new_size, tid, "mremap(new_addr)")) return VG_(mk_SysRes_Error)( VKI_ENOMEM ); /* check for overlaps */ @@ -345,7 +345,7 @@ void record_fd_close(ThreadId tid, Int fd) some such thing) or that we don't know the filename. If the fd is already open, then we're probably doing a dup2() to an existing fd, so just overwrite the existing one. */ -void VG_(record_fd_open)(ThreadId tid, Int fd, char *pathname) +void ML_(record_fd_open)(ThreadId tid, Int fd, char *pathname) { OpenFd *i; @@ -521,7 +521,7 @@ void do_hacky_preopened() for (i = 0; i < count; i++) if(VG_(fcntl)(i, VKI_F_GETFL, 0) != -1) - VG_(record_fd_open)(-1, i, NULL); + ML_(record_fd_open)(-1, i, NULL); } /* Initialize the list of open file descriptors with the file descriptors @@ -547,7 +547,7 @@ void VG_(init_preopened_fds)() if(fno != f) if(VG_(clo_track_fds)) - VG_(record_fd_open)(-1, fno, VG_(resolve_filename)(fno)); + ML_(record_fd_open)(-1, fno, VG_(resolve_filename)(fno)); } VG_(lseek)(f, d.d_off, VKI_SEEK_SET); @@ -646,7 +646,7 @@ static void check_cmsg_for_fds(ThreadId tid, struct vki_msghdr *msg) if(VG_(clo_track_fds)) // XXX: must we check the range on these fds with // VG_(fd_allowed)()? - VG_(record_fd_open) (tid, fds[i], VG_(resolve_filename)(fds[i])); + ML_(record_fd_open) (tid, fds[i], VG_(resolve_filename)(fds[i])); } cm = VKI_CMSG_NXTHDR(msg, cm); @@ -838,7 +838,7 @@ static Addr do_brk(Addr newbrk) ------------------------------------------------------------------ */ /* Return true if we're allowed to use or create this fd */ -Bool VG_(fd_allowed)(Int fd, const Char *syscallname, ThreadId tid, Bool soft) +Bool ML_(fd_allowed)(Int fd, const Char *syscallname, ThreadId tid, Bool soft) { if (fd < 0 || fd >= VG_(fd_hard_limit) || fd == VG_(clo_log_fd)) { VG_(message)(Vg_UserMsg, @@ -873,7 +873,7 @@ Bool VG_(fd_allowed)(Int fd, const Char *syscallname, ThreadId tid, Bool soft) /* ------ */ void -VG_(generic_PRE_sys_socketpair) ( ThreadId tid, +ML_(generic_PRE_sys_socketpair) ( ThreadId tid, UWord arg0, UWord arg1, UWord arg2, UWord arg3 ) { @@ -883,7 +883,7 @@ VG_(generic_PRE_sys_socketpair) ( ThreadId tid, } SysRes -VG_(generic_POST_sys_socketpair) ( ThreadId tid, +ML_(generic_POST_sys_socketpair) ( ThreadId tid, SysRes res, UWord arg0, UWord arg1, UWord arg2, UWord arg3 ) @@ -893,16 +893,16 @@ VG_(generic_POST_sys_socketpair) ( ThreadId tid, Int fd1 = ((Int*)arg3)[0]; Int fd2 = ((Int*)arg3)[1]; POST_MEM_WRITE( arg3, 2*sizeof(int) ); - if (!VG_(fd_allowed)(fd1, "socketcall.socketpair", tid, True) || - !VG_(fd_allowed)(fd2, "socketcall.socketpair", tid, True)) { + if (!ML_(fd_allowed)(fd1, "socketcall.socketpair", tid, True) || + !ML_(fd_allowed)(fd2, "socketcall.socketpair", tid, True)) { VG_(close)(fd1); VG_(close)(fd2); r = VG_(mk_SysRes_Error)( VKI_EMFILE ); } else { POST_MEM_WRITE( arg3, 2*sizeof(int) ); if (VG_(clo_track_fds)) { - VG_(record_fd_open)(tid, fd1, NULL); - VG_(record_fd_open)(tid, fd2, NULL); + ML_(record_fd_open)(tid, fd1, NULL); + ML_(record_fd_open)(tid, fd2, NULL); } } return r; @@ -911,16 +911,16 @@ VG_(generic_POST_sys_socketpair) ( ThreadId tid, /* ------ */ SysRes -VG_(generic_POST_sys_socket) ( ThreadId tid, SysRes res ) +ML_(generic_POST_sys_socket) ( ThreadId tid, SysRes res ) { SysRes r = res; vg_assert(!res.isError); /* guaranteed by caller */ - if (!VG_(fd_allowed)(res.val, "socket", tid, True)) { + if (!ML_(fd_allowed)(res.val, "socket", tid, True)) { VG_(close)(res.val); r = VG_(mk_SysRes_Error)( VKI_EMFILE ); } else { if (VG_(clo_track_fds)) - VG_(record_fd_open)(tid, res.val, NULL); + ML_(record_fd_open)(tid, res.val, NULL); } return r; } @@ -928,7 +928,7 @@ VG_(generic_POST_sys_socket) ( ThreadId tid, SysRes res ) /* ------ */ void -VG_(generic_PRE_sys_bind) ( ThreadId tid, +ML_(generic_PRE_sys_bind) ( ThreadId tid, UWord arg0, UWord arg1, UWord arg2 ) { /* int bind(int sockfd, struct sockaddr *my_addr, @@ -942,7 +942,7 @@ VG_(generic_PRE_sys_bind) ( ThreadId tid, /* ------ */ void -VG_(generic_PRE_sys_accept) ( ThreadId tid, +ML_(generic_PRE_sys_accept) ( ThreadId tid, UWord arg0, UWord arg1, UWord arg2 ) { /* int accept(int s, struct sockaddr *addr, int *addrlen); */ @@ -955,13 +955,13 @@ VG_(generic_PRE_sys_accept) ( ThreadId tid, } SysRes -VG_(generic_POST_sys_accept) ( ThreadId tid, +ML_(generic_POST_sys_accept) ( ThreadId tid, SysRes res, UWord arg0, UWord arg1, UWord arg2 ) { SysRes r = res; vg_assert(!res.isError); /* guaranteed by caller */ - if (!VG_(fd_allowed)(res.val, "accept", tid, True)) { + if (!ML_(fd_allowed)(res.val, "accept", tid, True)) { VG_(close)(res.val); r = VG_(mk_SysRes_Error)( VKI_EMFILE ); } else { @@ -971,7 +971,7 @@ VG_(generic_POST_sys_accept) ( ThreadId tid, buf_and_len_post_check ( tid, res, addr_p, addrlen_p, "socketcall.accept(addrlen_out)" ); if (VG_(clo_track_fds)) - VG_(record_fd_open)(tid, res.val, NULL); + ML_(record_fd_open)(tid, res.val, NULL); } return r; } @@ -979,7 +979,7 @@ VG_(generic_POST_sys_accept) ( ThreadId tid, /* ------ */ void -VG_(generic_PRE_sys_sendto) ( ThreadId tid, +ML_(generic_PRE_sys_sendto) ( ThreadId tid, UWord arg0, UWord arg1, UWord arg2, UWord arg3, UWord arg4, UWord arg5 ) { @@ -998,7 +998,7 @@ VG_(generic_PRE_sys_sendto) ( ThreadId tid, /* ------ */ void -VG_(generic_PRE_sys_send) ( ThreadId tid, +ML_(generic_PRE_sys_send) ( ThreadId tid, UWord arg0, UWord arg1, UWord arg2 ) { /* int send(int s, const void *msg, size_t len, int flags); */ @@ -1011,7 +1011,7 @@ VG_(generic_PRE_sys_send) ( ThreadId tid, /* ------ */ void -VG_(generic_PRE_sys_recvfrom) ( ThreadId tid, +ML_(generic_PRE_sys_recvfrom) ( ThreadId tid, UWord arg0, UWord arg1, UWord arg2, UWord arg3, UWord arg4, UWord arg5 ) { @@ -1029,7 +1029,7 @@ VG_(generic_PRE_sys_recvfrom) ( ThreadId tid, } void -VG_(generic_POST_sys_recvfrom) ( ThreadId tid, +ML_(generic_POST_sys_recvfrom) ( ThreadId tid, SysRes res, UWord arg0, UWord arg1, UWord arg2, UWord arg3, UWord arg4, UWord arg5 ) @@ -1049,7 +1049,7 @@ VG_(generic_POST_sys_recvfrom) ( ThreadId tid, /* ------ */ void -VG_(generic_PRE_sys_recv) ( ThreadId tid, +ML_(generic_PRE_sys_recv) ( ThreadId tid, UWord arg0, UWord arg1, UWord arg2 ) { /* int recv(int s, void *buf, int len, unsigned int flags); */ @@ -1064,7 +1064,7 @@ VG_(generic_PRE_sys_recv) ( ThreadId tid, } void -VG_(generic_POST_sys_recv) ( ThreadId tid, +ML_(generic_POST_sys_recv) ( ThreadId tid, UWord res, UWord arg0, UWord arg1, UWord arg2 ) { @@ -1077,7 +1077,7 @@ VG_(generic_POST_sys_recv) ( ThreadId tid, /* ------ */ void -VG_(generic_PRE_sys_connect) ( ThreadId tid, +ML_(generic_PRE_sys_connect) ( ThreadId tid, UWord arg0, UWord arg1, UWord arg2 ) { /* int connect(int sockfd, @@ -1093,7 +1093,7 @@ VG_(generic_PRE_sys_connect) ( ThreadId tid, /* ------ */ void -VG_(generic_PRE_sys_setsockopt) ( ThreadId tid, +ML_(generic_PRE_sys_setsockopt) ( ThreadId tid, UWord arg0, UWord arg1, UWord arg2, UWord arg3, UWord arg4 ) { @@ -1107,7 +1107,7 @@ VG_(generic_PRE_sys_setsockopt) ( ThreadId tid, /* ------ */ void -VG_(generic_PRE_sys_getsockopt) ( ThreadId tid, +ML_(generic_PRE_sys_getsockopt) ( ThreadId tid, UWord arg0, UWord arg1, UWord arg2, UWord arg3, UWord arg4 ) { @@ -1123,7 +1123,7 @@ VG_(generic_PRE_sys_getsockopt) ( ThreadId tid, } void -VG_(generic_POST_sys_getsockopt) ( ThreadId tid, +ML_(generic_POST_sys_getsockopt) ( ThreadId tid, SysRes res, UWord arg0, UWord arg1, UWord arg2, UWord arg3, UWord arg4 ) @@ -1139,7 +1139,7 @@ VG_(generic_POST_sys_getsockopt) ( ThreadId tid, /* ------ */ void -VG_(generic_PRE_sys_getsockname) ( ThreadId tid, +ML_(generic_PRE_sys_getsockname) ( ThreadId tid, UWord arg0, UWord arg1, UWord arg2 ) { /* int getsockname(int s, struct sockaddr* name, int* namelen) */ @@ -1152,7 +1152,7 @@ VG_(generic_PRE_sys_getsockname) ( ThreadId tid, } void -VG_(generic_POST_sys_getsockname) ( ThreadId tid, +ML_(generic_POST_sys_getsockname) ( ThreadId tid, SysRes res, UWord arg0, UWord arg1, UWord arg2 ) { @@ -1166,7 +1166,7 @@ VG_(generic_POST_sys_getsockname) ( ThreadId tid, /* ------ */ void -VG_(generic_PRE_sys_getpeername) ( ThreadId tid, +ML_(generic_PRE_sys_getpeername) ( ThreadId tid, UWord arg0, UWord arg1, UWord arg2 ) { /* int getpeername(int s, struct sockaddr* name, int* namelen) */ @@ -1179,7 +1179,7 @@ VG_(generic_PRE_sys_getpeername) ( ThreadId tid, } void -VG_(generic_POST_sys_getpeername) ( ThreadId tid, +ML_(generic_POST_sys_getpeername) ( ThreadId tid, SysRes res, UWord arg0, UWord arg1, UWord arg2 ) { @@ -1193,7 +1193,7 @@ VG_(generic_POST_sys_getpeername) ( ThreadId tid, /* ------ */ void -VG_(generic_PRE_sys_sendmsg) ( ThreadId tid, +ML_(generic_PRE_sys_sendmsg) ( ThreadId tid, UWord arg0, UWord arg1 ) { /* int sendmsg(int s, const struct msghdr *msg, int flags); */ @@ -1204,7 +1204,7 @@ VG_(generic_PRE_sys_sendmsg) ( ThreadId tid, /* ------ */ void -VG_(generic_PRE_sys_recvmsg) ( ThreadId tid, +ML_(generic_PRE_sys_recvmsg) ( ThreadId tid, UWord arg0, UWord arg1 ) { /* int recvmsg(int s, struct msghdr *msg, int flags); */ @@ -1213,7 +1213,7 @@ VG_(generic_PRE_sys_recvmsg) ( ThreadId tid, } void -VG_(generic_POST_sys_recvmsg) ( ThreadId tid, +ML_(generic_POST_sys_recvmsg) ( ThreadId tid, UWord arg0, UWord arg1 ) { struct vki_msghdr *msg = (struct vki_msghdr *)arg1; @@ -1229,7 +1229,7 @@ VG_(generic_POST_sys_recvmsg) ( ThreadId tid, /* ------ */ void -VG_(generic_PRE_sys_semop) ( ThreadId tid, +ML_(generic_PRE_sys_semop) ( ThreadId tid, UWord arg0, UWord arg1, UWord arg2 ) { /* int semop(int semid, struct sembuf *sops, unsigned nsops); */ @@ -1239,7 +1239,7 @@ VG_(generic_PRE_sys_semop) ( ThreadId tid, /* ------ */ void -VG_(generic_PRE_sys_semtimedop) ( ThreadId tid, +ML_(generic_PRE_sys_semtimedop) ( ThreadId tid, UWord arg0, UWord arg1, UWord arg2, UWord arg3 ) { @@ -1274,7 +1274,7 @@ UInt get_sem_count( Int semid ) } void -VG_(generic_PRE_sys_semctl) ( ThreadId tid, +ML_(generic_PRE_sys_semctl) ( ThreadId tid, UWord arg0, UWord arg1, UWord arg2, UWord arg3 ) { @@ -1323,7 +1323,7 @@ VG_(generic_PRE_sys_semctl) ( ThreadId tid, } void -VG_(generic_POST_sys_semctl) ( ThreadId tid, +ML_(generic_POST_sys_semctl) ( ThreadId tid, UWord res, UWord arg0, UWord arg1, UWord arg2, UWord arg3 ) @@ -1356,7 +1356,7 @@ VG_(generic_POST_sys_semctl) ( ThreadId tid, /* ------ */ void -VG_(generic_PRE_sys_msgsnd) ( ThreadId tid, +ML_(generic_PRE_sys_msgsnd) ( ThreadId tid, UWord arg0, UWord arg1, UWord arg2, UWord arg3 ) { @@ -1369,7 +1369,7 @@ VG_(generic_PRE_sys_msgsnd) ( ThreadId tid, /* ------ */ void -VG_(generic_PRE_sys_msgrcv) ( ThreadId tid, +ML_(generic_PRE_sys_msgrcv) ( ThreadId tid, UWord arg0, UWord arg1, UWord arg2, UWord arg3, UWord arg4 ) { @@ -1381,7 +1381,7 @@ VG_(generic_PRE_sys_msgrcv) ( ThreadId tid, } void -VG_(generic_POST_sys_msgrcv) ( ThreadId tid, +ML_(generic_POST_sys_msgrcv) ( ThreadId tid, UWord res, UWord arg0, UWord arg1, UWord arg2, UWord arg3, UWord arg4 ) @@ -1394,7 +1394,7 @@ VG_(generic_POST_sys_msgrcv) ( ThreadId tid, /* ------ */ void -VG_(generic_PRE_sys_msgctl) ( ThreadId tid, +ML_(generic_PRE_sys_msgctl) ( ThreadId tid, UWord arg0, UWord arg1, UWord arg2 ) { /* int msgctl(int msqid, int cmd, struct msqid_ds *buf); */ @@ -1428,7 +1428,7 @@ VG_(generic_PRE_sys_msgctl) ( ThreadId tid, } void -VG_(generic_POST_sys_msgctl) ( ThreadId tid, +ML_(generic_POST_sys_msgctl) ( ThreadId tid, UWord res, UWord arg0, UWord arg1, UWord arg2 ) { @@ -1470,20 +1470,20 @@ UInt get_shm_size ( Int shmid ) } UWord -VG_(generic_PRE_sys_shmat) ( ThreadId tid, +ML_(generic_PRE_sys_shmat) ( ThreadId tid, UWord arg0, UWord arg1, UWord arg2 ) { /* void *shmat(int shmid, const void *shmaddr, int shmflg); */ UInt segmentSize = get_shm_size ( arg0 ); if (arg1 == 0) arg1 = VG_(find_map_space)(0, segmentSize, True); - else if (!VG_(valid_client_addr)(arg1, segmentSize, tid, "shmat")) + else if (!ML_(valid_client_addr)(arg1, segmentSize, tid, "shmat")) arg1 = 0; return arg1; } void -VG_(generic_POST_sys_shmat) ( ThreadId tid, +ML_(generic_POST_sys_shmat) ( ThreadId tid, UWord res, UWord arg0, UWord arg1, UWord arg2 ) { @@ -1503,14 +1503,14 @@ VG_(generic_POST_sys_shmat) ( ThreadId tid, /* ------ */ Bool -VG_(generic_PRE_sys_shmdt) ( ThreadId tid, UWord arg0 ) +ML_(generic_PRE_sys_shmdt) ( ThreadId tid, UWord arg0 ) { /* int shmdt(const void *shmaddr); */ - return VG_(valid_client_addr)(arg0, 1, tid, "shmdt"); + return ML_(valid_client_addr)(arg0, 1, tid, "shmdt"); } void -VG_(generic_POST_sys_shmdt) ( ThreadId tid, UWord res, UWord arg0 ) +ML_(generic_POST_sys_shmdt) ( ThreadId tid, UWord res, UWord arg0 ) { Segment *s = VG_(find_segment)(arg0); @@ -1522,7 +1522,7 @@ VG_(generic_POST_sys_shmdt) ( ThreadId tid, UWord res, UWord arg0 ) /* ------ */ void -VG_(generic_PRE_sys_shmctl) ( ThreadId tid, +ML_(generic_PRE_sys_shmctl) ( ThreadId tid, UWord arg0, UWord arg1, UWord arg2 ) { /* int shmctl(int shmid, int cmd, struct shmid_ds *buf); */ @@ -1562,7 +1562,7 @@ VG_(generic_PRE_sys_shmctl) ( ThreadId tid, } void -VG_(generic_POST_sys_shmctl) ( ThreadId tid, +ML_(generic_POST_sys_shmctl) ( ThreadId tid, UWord res, UWord arg0, UWord arg1, UWord arg2 ) { @@ -2488,7 +2488,7 @@ PRE(sys_close) PRE_REG_READ1(long, "close", unsigned int, fd); /* Detect and negate attempts by the client to close Valgrind's log fd */ - if (!VG_(fd_allowed)(ARG1, "close", tid, False)) + if (!ML_(fd_allowed)(ARG1, "close", tid, False)) SET_STATUS_Failure( VKI_EBADF ); } @@ -2506,12 +2506,12 @@ PRE(sys_dup) POST(sys_dup) { vg_assert(SUCCESS); - if (!VG_(fd_allowed)(RES, "dup", tid, True)) { + if (!ML_(fd_allowed)(RES, "dup", tid, True)) { VG_(close)(RES); SET_STATUS_Failure( VKI_EMFILE ); } else { if (VG_(clo_track_fds)) - VG_(record_fd_open)(tid, RES, VG_(resolve_filename)(RES)); + ML_(record_fd_open)(tid, RES, VG_(resolve_filename)(RES)); } } @@ -2519,7 +2519,7 @@ PRE(sys_dup2) { PRINT("sys_dup2 ( %d, %d )", ARG1,ARG2); PRE_REG_READ2(long, "dup2", unsigned int, oldfd, unsigned int, newfd); - if (!VG_(fd_allowed)(ARG2, "dup2", tid, True)) + if (!ML_(fd_allowed)(ARG2, "dup2", tid, True)) SET_STATUS_Failure( VKI_EBADF ); } @@ -2527,7 +2527,7 @@ POST(sys_dup2) { vg_assert(SUCCESS); if (VG_(clo_track_fds)) - VG_(record_fd_open)(tid, RES, VG_(resolve_filename)(RES)); + ML_(record_fd_open)(tid, RES, VG_(resolve_filename)(RES)); } PRE(sys_fchdir) @@ -2607,12 +2607,12 @@ POST(sys_fcntl) { vg_assert(SUCCESS); if (ARG2 == VKI_F_DUPFD) { - if (!VG_(fd_allowed)(RES, "fcntl(DUPFD)", tid, True)) { + if (!ML_(fd_allowed)(RES, "fcntl(DUPFD)", tid, True)) { VG_(close)(RES); SET_STATUS_Failure( VKI_EMFILE ); } else { if (VG_(clo_track_fds)) - VG_(record_fd_open)(tid, RES, VG_(resolve_filename)(RES)); + ML_(record_fd_open)(tid, RES, VG_(resolve_filename)(RES)); } } } @@ -2673,12 +2673,12 @@ POST(sys_fcntl64) { vg_assert(SUCCESS); if (ARG2 == VKI_F_DUPFD) { - if (!VG_(fd_allowed)(RES, "fcntl64(DUPFD)", tid, True)) { + if (!ML_(fd_allowed)(RES, "fcntl64(DUPFD)", tid, True)) { VG_(close)(RES); SET_STATUS_Failure( VKI_EMFILE ); } else { if (VG_(clo_track_fds)) - VG_(record_fd_open)(tid, RES, + ML_(record_fd_open)(tid, RES, VG_(resolve_filename)(RES)); } } @@ -4311,7 +4311,7 @@ POST(sys_ioctl) "tgid" is a thread group id. If it is not -1, then the target thread must be in that thread group. */ -Bool VG_(do_sigkill)(Int pid, Int tgid) +Bool ML_(do_sigkill)(Int pid, Int tgid) { ThreadState *tst; ThreadId tid; @@ -4351,14 +4351,14 @@ PRE(sys_kill) /* int kill(pid_t pid, int sig); */ PRINT("sys_kill ( %d, %d )", ARG1,ARG2); PRE_REG_READ2(long, "kill", int, pid, int, sig); - if (!VG_(client_signal_OK)(ARG2)) { + if (!ML_(client_signal_OK)(ARG2)) { SET_STATUS_Failure( VKI_EINVAL ); return; } /* If we're sending SIGKILL, check to see if the target is one of our threads and handle it specially. */ - if (ARG2 == VKI_SIGKILL && VG_(do_sigkill)(ARG1, -1)) + if (ARG2 == VKI_SIGKILL && ML_(do_sigkill)(ARG1, -1)) SET_STATUS_Success(0); else SET_STATUS_from_SysRes( VG_(do_syscall2)(SYSNO, ARG1, ARG2) ); @@ -4441,7 +4441,7 @@ PRE(sys_mmap2) } if (ARG4 & VKI_MAP_FIXED) { - if (!VG_(valid_client_addr)(ARG1, ARG2, tid, "mmap2")) + if (!ML_(valid_client_addr)(ARG1, ARG2, tid, "mmap2")) SET_STATUS_Failure( VKI_ENOMEM ); } else { Addr a = VG_(find_map_space)(ARG1, ARG2, True); @@ -4459,8 +4459,8 @@ PRE(sys_mmap2) POST(sys_mmap2) { vg_assert(SUCCESS); - vg_assert(VG_(valid_client_addr)(RES, ARG2, tid, "mmap2")); - VG_(mmap_segment)( (Addr)RES, ARG2, ARG3, ARG4, ARG5, + vg_assert(ML_(valid_client_addr)(RES, ARG2, tid, "mmap2")); + ML_(mmap_segment)( (Addr)RES, ARG2, ARG3, ARG4, ARG5, ARG6 * (ULong)VKI_PAGE_SIZE ); } @@ -4470,7 +4470,7 @@ PRE(sys_mprotect) PRE_REG_READ3(long, "mprotect", unsigned long, addr, vki_size_t, len, unsigned long, prot); - if (!VG_(valid_client_addr)(ARG1, ARG2, tid, "mprotect")) + if (!ML_(valid_client_addr)(ARG1, ARG2, tid, "mprotect")) SET_STATUS_Failure( VKI_ENOMEM ); } @@ -4494,7 +4494,7 @@ PRE(sys_munmap) PRINT("sys_munmap ( %p, %llu )", ARG1,(ULong)ARG2); PRE_REG_READ2(long, "munmap", unsigned long, start, vki_size_t, length); - if (!VG_(valid_client_addr)(ARG1, ARG2, tid, "munmap")) + if (!ML_(valid_client_addr)(ARG1, ARG2, tid, "munmap")) SET_STATUS_Failure( VKI_EINVAL ); } @@ -4559,12 +4559,12 @@ PRE(sys_open) POST(sys_open) { vg_assert(SUCCESS); - if (!VG_(fd_allowed)(RES, "open", tid, True)) { + if (!ML_(fd_allowed)(RES, "open", tid, True)) { VG_(close)(RES); SET_STATUS_Failure( VKI_EMFILE ); } else { if (VG_(clo_track_fds)) - VG_(record_fd_open)(tid, RES, + ML_(record_fd_open)(tid, RES, VG_(arena_strdup)(VG_AR_CORE, (Char*)ARG1)); } } @@ -4576,7 +4576,7 @@ PRE(sys_read) PRE_REG_READ3(ssize_t, "read", unsigned int, fd, char *, buf, vki_size_t, count); - if (!VG_(fd_allowed)(ARG1, "read", tid, False)) + if (!ML_(fd_allowed)(ARG1, "read", tid, False)) SET_STATUS_Failure( VKI_EBADF ); else PRE_MEM_WRITE( "read(buf)", ARG2, ARG3 ); @@ -4594,7 +4594,7 @@ PRE(sys_write) PRINT("sys_write ( %d, %p, %llu )", ARG1, ARG2, (ULong)ARG3); PRE_REG_READ3(ssize_t, "write", unsigned int, fd, const char *, buf, vki_size_t, count); - if (!VG_(fd_allowed)(ARG1, "write", tid, False)) + if (!ML_(fd_allowed)(ARG1, "write", tid, False)) SET_STATUS_Failure( VKI_EBADF ); else PRE_MEM_READ( "write(buf)", ARG2, ARG3 ); @@ -4611,12 +4611,12 @@ PRE(sys_creat) POST(sys_creat) { vg_assert(SUCCESS); - if (!VG_(fd_allowed)(RES, "creat", tid, True)) { + if (!ML_(fd_allowed)(RES, "creat", tid, True)) { VG_(close)(RES); SET_STATUS_Failure( VKI_EMFILE ); } else { if (VG_(clo_track_fds)) - VG_(record_fd_open)(tid, RES, VG_(arena_strdup)(VG_AR_CORE, (Char*)ARG1)); + ML_(record_fd_open)(tid, RES, VG_(arena_strdup)(VG_AR_CORE, (Char*)ARG1)); } } @@ -4632,16 +4632,16 @@ POST(sys_pipe) { Int *p = (Int *)ARG1; - if (!VG_(fd_allowed)(p[0], "pipe", tid, True) || - !VG_(fd_allowed)(p[1], "pipe", tid, True)) { + if (!ML_(fd_allowed)(p[0], "pipe", tid, True) || + !ML_(fd_allowed)(p[1], "pipe", tid, True)) { VG_(close)(p[0]); VG_(close)(p[1]); SET_STATUS_Failure( VKI_EMFILE ); } else { POST_MEM_WRITE( ARG1, 2*sizeof(int) ); if (VG_(clo_track_fds)) { - VG_(record_fd_open)(tid, p[0], NULL); - VG_(record_fd_open)(tid, p[1], NULL); + ML_(record_fd_open)(tid, p[0], NULL); + ML_(record_fd_open)(tid, p[1], NULL); } } } @@ -4726,7 +4726,7 @@ PRE(sys_readv) PRE_REG_READ3(ssize_t, "readv", unsigned long, fd, const struct iovec *, vector, unsigned long, count); - if (!VG_(fd_allowed)(ARG1, "readv", tid, False)) { + if (!ML_(fd_allowed)(ARG1, "readv", tid, False)) { SET_STATUS_Failure( VKI_EBADF ); } else { PRE_MEM_READ( "readv(vector)", ARG2, ARG3 * sizeof(struct vki_iovec) ); @@ -5096,7 +5096,7 @@ PRE(sys_writev) PRE_REG_READ3(ssize_t, "writev", unsigned long, fd, const struct iovec *, vector, unsigned long, count); - if (!VG_(fd_allowed)(ARG1, "writev", tid, False)) { + if (!ML_(fd_allowed)(ARG1, "writev", tid, False)) { SET_STATUS_Failure( VKI_EBADF ); } else { PRE_MEM_READ( "writev(vector)", @@ -5221,7 +5221,7 @@ PRE(sys_rt_sigqueueinfo) } POST(sys_rt_sigqueueinfo) { - if (!VG_(client_signal_OK)(ARG2)) + if (!ML_(client_signal_OK)(ARG2)) SET_STATUS_Failure( VKI_EINVAL ); } @@ -5407,12 +5407,12 @@ PRE(sys_mq_open) POST(sys_mq_open) { vg_assert(SUCCESS); - if (!VG_(fd_allowed)(RES, "mq_open", tid, True)) { + if (!ML_(fd_allowed)(RES, "mq_open", tid, True)) { VG_(close)(RES); SET_STATUS_Failure( VKI_EMFILE ); } else { if (VG_(clo_track_fds)) - VG_(record_fd_open)(tid, RES, VG_(arena_strdup)(VG_AR_CORE, (Char*)ARG1)); + ML_(record_fd_open)(tid, RES, VG_(arena_strdup)(VG_AR_CORE, (Char*)ARG1)); } } @@ -5431,7 +5431,7 @@ PRE(sys_mq_timedsend) PRE_REG_READ5(long, "mq_timedsend", vki_mqd_t, mqdes, const char *, msg_ptr, vki_size_t, msg_len, unsigned int, msg_prio, const struct timespec *, abs_timeout); - if (!VG_(fd_allowed)(ARG1, "mq_timedsend", tid, False)) { + if (!ML_(fd_allowed)(ARG1, "mq_timedsend", tid, False)) { SET_STATUS_Failure( VKI_EBADF ); } else { PRE_MEM_READ( "mq_timedsend(msg_ptr)", ARG2, ARG3 ); @@ -5450,7 +5450,7 @@ PRE(sys_mq_timedreceive) vki_mqd_t, mqdes, char *, msg_ptr, vki_size_t, msg_len, unsigned int *, msg_prio, const struct timespec *, abs_timeout); - if (!VG_(fd_allowed)(ARG1, "mq_timedreceive", tid, False)) { + if (!ML_(fd_allowed)(ARG1, "mq_timedreceive", tid, False)) { SET_STATUS_Failure( VKI_EBADF ); } else { PRE_MEM_WRITE( "mq_timedreceive(msg_ptr)", ARG2, ARG3 ); @@ -5475,7 +5475,7 @@ PRE(sys_mq_notify) PRINT("sys_mq_notify( %d, %p )", ARG1,ARG2 ); PRE_REG_READ2(long, "mq_notify", vki_mqd_t, mqdes, const struct sigevent *, notification); - if (!VG_(fd_allowed)(ARG1, "mq_notify", tid, False)) + if (!ML_(fd_allowed)(ARG1, "mq_notify", tid, False)) SET_STATUS_Failure( VKI_EBADF ); else if (ARG2 != 0) PRE_MEM_READ( "mq_notify(notification)", @@ -5488,7 +5488,7 @@ PRE(sys_mq_getsetattr) PRE_REG_READ3(long, "mq_getsetattr", vki_mqd_t, mqdes, const struct mq_attr *, mqstat, struct mq_attr *, omqstat); - if (!VG_(fd_allowed)(ARG1, "mq_getsetattr", tid, False)) { + if (!ML_(fd_allowed)(ARG1, "mq_getsetattr", tid, False)) { SET_STATUS_Failure( VKI_EBADF ); } else { if (ARG2 != 0) { diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index a50190c340..5a6c0eb7cd 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -50,7 +50,7 @@ // Run a thread from beginning to end and return the thread's // scheduler-return-code. -VgSchedReturnCode VG_(thread_wrapper)(Word /*ThreadId*/ tidW) +VgSchedReturnCode ML_(thread_wrapper)(Word /*ThreadId*/ tidW) { VG_(debugLog)(1, "core_os", "VG_(thread_wrapper)(tid=%lld): entry\n", @@ -530,12 +530,12 @@ POST(sys_futex) vg_assert(SUCCESS); POST_MEM_WRITE( ARG1, sizeof(int) ); if (ARG2 == VKI_FUTEX_FD) { - if (!VG_(fd_allowed)(RES, "futex", tid, True)) { + if (!ML_(fd_allowed)(RES, "futex", tid, True)) { VG_(close)(RES); SET_STATUS_Failure( VKI_EMFILE ); } else { if (VG_(clo_track_fds)) - VG_(record_fd_open)(tid, RES, VG_(arena_strdup)(VG_AR_CORE, (Char*)ARG1)); + ML_(record_fd_open)(tid, RES, VG_(arena_strdup)(VG_AR_CORE, (Char*)ARG1)); } } } @@ -548,12 +548,12 @@ PRE(sys_epoll_create) POST(sys_epoll_create) { vg_assert(SUCCESS); - if (!VG_(fd_allowed)(RES, "epoll_create", tid, True)) { + if (!ML_(fd_allowed)(RES, "epoll_create", tid, True)) { VG_(close)(RES); SET_STATUS_Failure( VKI_EMFILE ); } else { if (VG_(clo_track_fds)) - VG_(record_fd_open) (tid, RES, NULL); + ML_(record_fd_open) (tid, RES, NULL); } } @@ -622,14 +622,14 @@ PRE(sys_tgkill) /* int tgkill(pid_t tgid, pid_t tid, int sig); */ PRINT("sys_tgkill ( %d, %d, %d )", ARG1,ARG2,ARG3); PRE_REG_READ3(long, "tgkill", int, tgid, int, tid, int, sig); - if (!VG_(client_signal_OK)(ARG3)) { + if (!ML_(client_signal_OK)(ARG3)) { SET_STATUS_Failure( VKI_EINVAL ); return; } /* If we're sending SIGKILL, check to see if the target is one of our threads and handle it specially. */ - if (ARG3 == VKI_SIGKILL && VG_(do_sigkill)(ARG2, ARG1)) + if (ARG3 == VKI_SIGKILL && ML_(do_sigkill)(ARG2, ARG1)) SET_STATUS_Success(0); else SET_STATUS_from_SysRes(VG_(do_syscall3)(SYSNO, ARG1, ARG2, ARG3)); @@ -694,7 +694,7 @@ PRE(sys_io_setup) struct vki_aio_ring *r = *(struct vki_aio_ring **)ARG2; vg_assert(addr == (Addr)r); - vg_assert(VG_(valid_client_addr)(addr, size, tid, "io_setup")); + vg_assert(ML_(valid_client_addr)(addr, size, tid, "io_setup")); VG_TRACK( new_mem_mmap, addr, size, True, True, False ); POST_MEM_WRITE( ARG2, sizeof(vki_aio_context_t) ); diff --git a/coregrind/m_syswrap/syswrap-main.c b/coregrind/m_syswrap/syswrap-main.c index dc8c5861a0..c2a557a2d1 100644 --- a/coregrind/m_syswrap/syswrap-main.c +++ b/coregrind/m_syswrap/syswrap-main.c @@ -912,7 +912,7 @@ extern const Addr VGA_(blksys_finished); /* Back up guest state to restart a system call. */ -void VG_(fixup_guest_state_to_restart_syscall) ( ThreadArchState* arch ) +void ML_(fixup_guest_state_to_restart_syscall) ( ThreadArchState* arch ) { #if defined(VGP_x86_linux) arch->vex.guest_EIP -= 2; // sizeof(int $0x80) @@ -1064,7 +1064,7 @@ VG_(fixup_guest_state_after_syscall_interrupted)( ThreadId tid, if (debug) VG_(printf)(" not started: restart\n"); vg_assert(sci->status.what == SsHandToKernel); - VG_(fixup_guest_state_to_restart_syscall)(th_regs); + ML_(fixup_guest_state_to_restart_syscall)(th_regs); } else @@ -1073,7 +1073,7 @@ VG_(fixup_guest_state_after_syscall_interrupted)( ThreadId tid, and the kernel restarted it. Restart if asked, otherwise EINTR it. */ if (restart) - VG_(fixup_guest_state_to_restart_syscall)(th_regs); + ML_(fixup_guest_state_to_restart_syscall)(th_regs); else { canonical = convert_SysRes_to_SyscallStatus( VG_(mk_SysRes_Error)( VKI_EINTR ) diff --git a/coregrind/m_syswrap/syswrap-x86-linux.c b/coregrind/m_syswrap/syswrap-x86-linux.c index 684f00d797..243ad0bddb 100644 --- a/coregrind/m_syswrap/syswrap-x86-linux.c +++ b/coregrind/m_syswrap/syswrap-x86-linux.c @@ -147,7 +147,7 @@ static void run_a_thread_NORETURN ( Word tidW ) (ULong)tidW); /* Run the thread all the way through. */ - VgSchedReturnCode src = VG_(thread_wrapper)(tid); + VgSchedReturnCode src = ML_(thread_wrapper)(tid); VG_(debugLog)(1, "syswrap-x86-linux", "run_a_thread_NORETURN(tid=%lld): " @@ -1067,7 +1067,7 @@ PRE(sys_clone) cloneflags = ARG1; - if (!VG_(client_signal_OK)(ARG1 & VKI_CSIGNAL)) { + if (!ML_(client_signal_OK)(ARG1 & VKI_CSIGNAL)) { SET_STATUS_Failure( VKI_EINVAL ); return; } @@ -1168,7 +1168,7 @@ PRE(sys_sigreturn) /* This is only so that the EIP is (might be) useful to report if something goes wrong in the sigreturn */ - VG_(fixup_guest_state_to_restart_syscall)(&tst->arch); + ML_(fixup_guest_state_to_restart_syscall)(&tst->arch); VG_(sigframe_destroy)(tid, False); @@ -1199,7 +1199,7 @@ PRE(sys_rt_sigreturn) /* This is only so that the EIP is (might be) useful to report if something goes wrong in the sigreturn */ - VG_(fixup_guest_state_to_restart_syscall)(&tst->arch); + ML_(fixup_guest_state_to_restart_syscall)(&tst->arch); VG_(sigframe_destroy)(tid, True); @@ -1343,7 +1343,7 @@ PRE(sys_ipc) switch (ARG1 /* call */) { case VKI_SEMOP: - VG_(generic_PRE_sys_semop)( tid, ARG2, ARG5, ARG3 ); + ML_(generic_PRE_sys_semop)( tid, ARG2, ARG5, ARG3 ); *flags |= SfMayBlock; break; case VKI_SEMGET: @@ -1351,15 +1351,15 @@ PRE(sys_ipc) case VKI_SEMCTL: { UWord arg = deref_Addr( tid, ARG5, "semctl(arg)" ); - VG_(generic_PRE_sys_semctl)( tid, ARG2, ARG3, ARG4, arg ); + ML_(generic_PRE_sys_semctl)( tid, ARG2, ARG3, ARG4, arg ); break; } case VKI_SEMTIMEDOP: - VG_(generic_PRE_sys_semtimedop)( tid, ARG2, ARG5, ARG3, ARG6 ); + ML_(generic_PRE_sys_semtimedop)( tid, ARG2, ARG5, ARG3, ARG6 ); *flags |= SfMayBlock; break; case VKI_MSGSND: - VG_(generic_PRE_sys_msgsnd)( tid, ARG2, ARG5, ARG3, ARG4 ); + ML_(generic_PRE_sys_msgsnd)( tid, ARG2, ARG5, ARG3, ARG4 ); if ((ARG4 & VKI_IPC_NOWAIT) == 0) *flags |= SfMayBlock; break; @@ -1375,7 +1375,7 @@ PRE(sys_ipc) (Addr) (&((struct vki_ipc_kludge *)ARG5)->msgtyp), "msgrcv(msgp)" ); - VG_(generic_PRE_sys_msgrcv)( tid, ARG2, msgp, ARG3, msgtyp, ARG4 ); + ML_(generic_PRE_sys_msgrcv)( tid, ARG2, msgp, ARG3, msgtyp, ARG4 ); if ((ARG4 & VKI_IPC_NOWAIT) == 0) *flags |= SfMayBlock; @@ -1384,13 +1384,13 @@ PRE(sys_ipc) case VKI_MSGGET: break; case VKI_MSGCTL: - VG_(generic_PRE_sys_msgctl)( tid, ARG2, ARG3, ARG5 ); + ML_(generic_PRE_sys_msgctl)( tid, ARG2, ARG3, ARG5 ); break; case VKI_SHMAT: { UWord w; PRE_MEM_WRITE( "shmat(raddr)", ARG4, sizeof(Addr) ); - w = VG_(generic_PRE_sys_shmat)( tid, ARG2, ARG5, ARG3 ); + w = ML_(generic_PRE_sys_shmat)( tid, ARG2, ARG5, ARG3 ); if (w == 0) SET_STATUS_Failure( VKI_EINVAL ); else @@ -1398,13 +1398,13 @@ PRE(sys_ipc) break; } case VKI_SHMDT: - if (!VG_(generic_PRE_sys_shmdt)(tid, ARG5)) + if (!ML_(generic_PRE_sys_shmdt)(tid, ARG5)) SET_STATUS_Failure( VKI_EINVAL ); break; case VKI_SHMGET: break; case VKI_SHMCTL: /* IPCOP_shmctl */ - VG_(generic_PRE_sys_shmctl)( tid, ARG2, ARG3, ARG5 ); + ML_(generic_PRE_sys_shmctl)( tid, ARG2, ARG3, ARG5 ); break; default: VG_(message)(Vg_DebugMsg, "FATAL: unhandled syscall(ipc) %d", ARG1 ); @@ -1423,7 +1423,7 @@ POST(sys_ipc) case VKI_SEMCTL: { UWord arg = deref_Addr( tid, ARG5, "semctl(arg)" ); - VG_(generic_PRE_sys_semctl)( tid, ARG2, ARG3, ARG4, arg ); + ML_(generic_PRE_sys_semctl)( tid, ARG2, ARG3, ARG4, arg ); break; } case VKI_SEMTIMEDOP: @@ -1441,13 +1441,13 @@ POST(sys_ipc) (Addr) (&((struct vki_ipc_kludge *)ARG5)->msgtyp), "msgrcv(msgp)" ); - VG_(generic_POST_sys_msgrcv)( tid, RES, ARG2, msgp, ARG3, msgtyp, ARG4 ); + ML_(generic_POST_sys_msgrcv)( tid, RES, ARG2, msgp, ARG3, msgtyp, ARG4 ); break; } case VKI_MSGGET: break; case VKI_MSGCTL: - VG_(generic_POST_sys_msgctl)( tid, RES, ARG2, ARG3, ARG5 ); + ML_(generic_POST_sys_msgctl)( tid, RES, ARG2, ARG3, ARG5 ); break; case VKI_SHMAT: { @@ -1460,17 +1460,17 @@ POST(sys_ipc) addr = deref_Addr ( tid, ARG4, "shmat(addr)" ); if ( addr > 0 ) { - VG_(generic_POST_sys_shmat)( tid, addr, ARG2, ARG5, ARG3 ); + ML_(generic_POST_sys_shmat)( tid, addr, ARG2, ARG5, ARG3 ); } break; } case VKI_SHMDT: - VG_(generic_POST_sys_shmdt)( tid, RES, ARG5 ); + ML_(generic_POST_sys_shmdt)( tid, RES, ARG5 ); break; case VKI_SHMGET: break; case VKI_SHMCTL: - VG_(generic_POST_sys_shmctl)( tid, RES, ARG2, ARG3, ARG5 ); + ML_(generic_POST_sys_shmctl)( tid, RES, ARG2, ARG3, ARG5 ); break; default: VG_(message)(Vg_DebugMsg, @@ -1521,7 +1521,7 @@ PRE(old_mmap) } if (a4 & VKI_MAP_FIXED) { - if (!VG_(valid_client_addr)(a1, a2, tid, "old_mmap")) { + if (!ML_(valid_client_addr)(a1, a2, tid, "old_mmap")) { PRINT("old_mmap failing: %p-%p\n", a1, a1+a2); SET_STATUS_Failure( VKI_ENOMEM ); } @@ -1543,8 +1543,8 @@ PRE(old_mmap) SysRes res = VG_(mmap_native)((void*)a1, a2, a3, a4, a5, a6); SET_STATUS_from_SysRes(res); if (!res.isError) { - vg_assert(VG_(valid_client_addr)(res.val, a2, tid, "old_mmap")); - VG_(mmap_segment)( (Addr)res.val, a2, a3, a4, a5, a6 ); + vg_assert(ML_(valid_client_addr)(res.val, a2, tid, "old_mmap")); + ML_(mmap_segment)( (Addr)res.val, a2, a3, a4, a5, a6 ); } } @@ -1622,7 +1622,7 @@ PRE(sys_socketcall) case VKI_SYS_SOCKETPAIR: /* int socketpair(int d, int type, int protocol, int sv[2]); */ PRE_MEM_READ( "socketcall.socketpair(args)", ARG2, 4*sizeof(Addr) ); - VG_(generic_PRE_sys_socketpair)( tid, ARG2_0, ARG2_1, ARG2_2, ARG2_3 ); + ML_(generic_PRE_sys_socketpair)( tid, ARG2_0, ARG2_1, ARG2_2, ARG2_3 ); break; case VKI_SYS_SOCKET: @@ -1634,7 +1634,7 @@ PRE(sys_socketcall) /* int bind(int sockfd, struct sockaddr *my_addr, int addrlen); */ PRE_MEM_READ( "socketcall.bind(args)", ARG2, 3*sizeof(Addr) ); - VG_(generic_PRE_sys_bind)( tid, ARG2_0, ARG2_1, ARG2_2 ); + ML_(generic_PRE_sys_bind)( tid, ARG2_0, ARG2_1, ARG2_2 ); break; case VKI_SYS_LISTEN: @@ -1645,7 +1645,7 @@ PRE(sys_socketcall) case VKI_SYS_ACCEPT: { /* int accept(int s, struct sockaddr *addr, int *addrlen); */ PRE_MEM_READ( "socketcall.accept(args)", ARG2, 3*sizeof(Addr) ); - VG_(generic_PRE_sys_accept)( tid, ARG2_0, ARG2_1, ARG2_2 ); + ML_(generic_PRE_sys_accept)( tid, ARG2_0, ARG2_1, ARG2_2 ); break; } @@ -1654,21 +1654,21 @@ PRE(sys_socketcall) unsigned int flags, const struct sockaddr *to, int tolen); */ PRE_MEM_READ( "socketcall.sendto(args)", ARG2, 6*sizeof(Addr) ); - VG_(generic_PRE_sys_sendto)( tid, ARG2_0, ARG2_1, ARG2_2, + ML_(generic_PRE_sys_sendto)( tid, ARG2_0, ARG2_1, ARG2_2, ARG2_3, ARG2_4, ARG2_5 ); break; case VKI_SYS_SEND: /* int send(int s, const void *msg, size_t len, int flags); */ PRE_MEM_READ( "socketcall.send(args)", ARG2, 4*sizeof(Addr) ); - VG_(generic_PRE_sys_send)( tid, ARG2_0, ARG2_1, ARG2_2 ); + ML_(generic_PRE_sys_send)( tid, ARG2_0, ARG2_1, ARG2_2 ); break; case VKI_SYS_RECVFROM: /* int recvfrom(int s, void *buf, int len, unsigned int flags, struct sockaddr *from, int *fromlen); */ PRE_MEM_READ( "socketcall.recvfrom(args)", ARG2, 6*sizeof(Addr) ); - VG_(generic_PRE_sys_recvfrom)( tid, ARG2_0, ARG2_1, ARG2_2, + ML_(generic_PRE_sys_recvfrom)( tid, ARG2_0, ARG2_1, ARG2_2, ARG2_3, ARG2_4, ARG2_5 ); break; @@ -1680,21 +1680,21 @@ PRE(sys_socketcall) from parameter. */ PRE_MEM_READ( "socketcall.recv(args)", ARG2, 4*sizeof(Addr) ); - VG_(generic_PRE_sys_recv)( tid, ARG2_0, ARG2_1, ARG2_2 ); + ML_(generic_PRE_sys_recv)( tid, ARG2_0, ARG2_1, ARG2_2 ); break; case VKI_SYS_CONNECT: /* int connect(int sockfd, struct sockaddr *serv_addr, int addrlen ); */ PRE_MEM_READ( "socketcall.connect(args)", ARG2, 3*sizeof(Addr) ); - VG_(generic_PRE_sys_connect)( tid, ARG2_0, ARG2_1, ARG2_2 ); + ML_(generic_PRE_sys_connect)( tid, ARG2_0, ARG2_1, ARG2_2 ); break; case VKI_SYS_SETSOCKOPT: /* int setsockopt(int s, int level, int optname, const void *optval, int optlen); */ PRE_MEM_READ( "socketcall.setsockopt(args)", ARG2, 5*sizeof(Addr) ); - VG_(generic_PRE_sys_setsockopt)( tid, ARG2_0, ARG2_1, ARG2_2, + ML_(generic_PRE_sys_setsockopt)( tid, ARG2_0, ARG2_1, ARG2_2, ARG2_3, ARG2_4 ); break; @@ -1702,20 +1702,20 @@ PRE(sys_socketcall) /* int getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen); */ PRE_MEM_READ( "socketcall.getsockopt(args)", ARG2, 5*sizeof(Addr) ); - VG_(generic_PRE_sys_getsockopt)( tid, ARG2_0, ARG2_1, ARG2_2, + ML_(generic_PRE_sys_getsockopt)( tid, ARG2_0, ARG2_1, ARG2_2, ARG2_3, ARG2_4 ); break; case VKI_SYS_GETSOCKNAME: /* int getsockname(int s, struct sockaddr* name, int* namelen) */ PRE_MEM_READ( "socketcall.getsockname(args)", ARG2, 3*sizeof(Addr) ); - VG_(generic_PRE_sys_getsockname)( tid, ARG2_0, ARG2_1, ARG2_2 ); + ML_(generic_PRE_sys_getsockname)( tid, ARG2_0, ARG2_1, ARG2_2 ); break; case VKI_SYS_GETPEERNAME: /* int getpeername(int s, struct sockaddr* name, int* namelen) */ PRE_MEM_READ( "socketcall.getpeername(args)", ARG2, 3*sizeof(Addr) ); - VG_(generic_PRE_sys_getpeername)( tid, ARG2_0, ARG2_1, ARG2_2 ); + ML_(generic_PRE_sys_getpeername)( tid, ARG2_0, ARG2_1, ARG2_2 ); break; case VKI_SYS_SHUTDOWN: @@ -1730,7 +1730,7 @@ PRE(sys_socketcall) * (after all it's glibc providing the arguments array) PRE_MEM_READ( "socketcall.sendmsg(args)", ARG2, 3*sizeof(Addr) ); */ - VG_(generic_PRE_sys_sendmsg)( tid, ARG2_0, ARG2_1 ); + ML_(generic_PRE_sys_sendmsg)( tid, ARG2_0, ARG2_1 ); break; } @@ -1741,7 +1741,7 @@ PRE(sys_socketcall) * (after all it's glibc providing the arguments array) PRE_MEM_READ("socketcall.recvmsg(args)", ARG2, 3*sizeof(Addr) ); */ - VG_(generic_PRE_sys_recvmsg)( tid, ARG2_0, ARG2_1 ); + ML_(generic_PRE_sys_recvmsg)( tid, ARG2_0, ARG2_1 ); break; } @@ -1772,7 +1772,7 @@ POST(sys_socketcall) switch (ARG1 /* request */) { case VKI_SYS_SOCKETPAIR: - r = VG_(generic_POST_sys_socketpair)( + r = ML_(generic_POST_sys_socketpair)( tid, VG_(mk_SysRes_Success)(RES), ARG2_0, ARG2_1, ARG2_2, ARG2_3 ); @@ -1780,7 +1780,7 @@ POST(sys_socketcall) break; case VKI_SYS_SOCKET: - r = VG_(generic_POST_sys_socket)( tid, VG_(mk_SysRes_Success)(RES) ); + r = ML_(generic_POST_sys_socket)( tid, VG_(mk_SysRes_Success)(RES) ); SET_STATUS_from_SysRes(r); break; @@ -1795,7 +1795,7 @@ POST(sys_socketcall) case VKI_SYS_ACCEPT: /* int accept(int s, struct sockaddr *addr, int *addrlen); */ - r = VG_(generic_POST_sys_accept)( tid, VG_(mk_SysRes_Success)(RES), + r = ML_(generic_POST_sys_accept)( tid, VG_(mk_SysRes_Success)(RES), ARG2_0, ARG2_1, ARG2_2 ); SET_STATUS_from_SysRes(r); break; @@ -1807,13 +1807,13 @@ POST(sys_socketcall) break; case VKI_SYS_RECVFROM: - VG_(generic_POST_sys_recvfrom)( tid, VG_(mk_SysRes_Success)(RES), + ML_(generic_POST_sys_recvfrom)( tid, VG_(mk_SysRes_Success)(RES), ARG2_0, ARG2_1, ARG2_2, ARG2_3, ARG2_4, ARG2_5 ); break; case VKI_SYS_RECV: - VG_(generic_POST_sys_recv)( tid, RES, ARG2_0, ARG2_1, ARG2_2 ); + ML_(generic_POST_sys_recv)( tid, RES, ARG2_0, ARG2_1, ARG2_2 ); break; case VKI_SYS_CONNECT: @@ -1823,18 +1823,18 @@ POST(sys_socketcall) break; case VKI_SYS_GETSOCKOPT: - VG_(generic_POST_sys_getsockopt)( tid, VG_(mk_SysRes_Success)(RES), + ML_(generic_POST_sys_getsockopt)( tid, VG_(mk_SysRes_Success)(RES), ARG2_0, ARG2_1, ARG2_2, ARG2_3, ARG2_4 ); break; case VKI_SYS_GETSOCKNAME: - VG_(generic_POST_sys_getsockname)( tid, VG_(mk_SysRes_Success)(RES), + ML_(generic_POST_sys_getsockname)( tid, VG_(mk_SysRes_Success)(RES), ARG2_0, ARG2_1, ARG2_2 ); break; case VKI_SYS_GETPEERNAME: - VG_(generic_POST_sys_getpeername)( tid, VG_(mk_SysRes_Success)(RES), + ML_(generic_POST_sys_getpeername)( tid, VG_(mk_SysRes_Success)(RES), ARG2_0, ARG2_1, ARG2_2 ); break; @@ -1845,7 +1845,7 @@ POST(sys_socketcall) break; case VKI_SYS_RECVMSG: - VG_(generic_POST_sys_recvmsg)( tid, ARG2_0, ARG2_1 ); + ML_(generic_POST_sys_recvmsg)( tid, ARG2_0, ARG2_1 ); break; default: diff --git a/include/pub_tool_basics_asm.h b/include/pub_tool_basics_asm.h index 4de39fea82..42f13dc01c 100644 --- a/include/pub_tool_basics_asm.h +++ b/include/pub_tool_basics_asm.h @@ -38,7 +38,17 @@ #define VGAPPEND(str1,str2) str1##str2 -#define VG_(str) VGAPPEND(vgPlain_, str) +/* VG_ is for symbols exported from modules. ML_ (module-local) is + for symbols which are not intended to be visible outside modules, + but which cannot be declared as C 'static's since they need to be + visible across C files within a given module. It is a mistake for + a ML_ name to appear in a pub_core_*.h or pub_tool_*.h file. + Likewise it is a mistake for a VG_ name to appear in a priv_*.h + file. +*/ +#define VG_(str) VGAPPEND(vgPlain_, str) +#define ML_(str) VGAPPEND(vgModuleLocal_, str) + #define VGA_(str) VGAPPEND(vgArch_, str) #define VGO_(str) VGAPPEND(vgOS_, str) #define VGP_(str) VGAPPEND(vgPlatform_, str)