../memcheck/mac_leakcheck.o \
../memcheck/mac_malloc_wrappers.o \
../memcheck/mac_needs.o \
+ ../memcheck/mac_replace_strmem.o \
../coregrind/vg_replace_malloc.o
mac_leakcheck.c \
mac_malloc_wrappers.c \
mac_needs.c \
+ mac_replace_strmem.c \
mc_main.c \
mc_clientreqs.c \
mc_errcontext.c \
mc_from_ucode.c \
- mc_replace_strmem.c \
mc_translate.c \
mc_helpers.S
vgskin_memcheck_so_LDFLAGS = -shared
mc_constants.h \
mc_include.h
-mc_replace_strmem.o: CFLAGS += -fno-omit-frame-pointer
+mac_replace_strmem.o: CFLAGS += -fno-omit-frame-pointer
MAC_(pp_AddrInfo)(VG_(get_error_address)(err), &err_extra->addrinfo);
break;
+ case OverlapErr:
+ VG_(message)(Vg_UserMsg,
+ "Source and destination overlap in %s",
+ VG_(get_error_string)(err));
+ VG_(pp_ExeContext)( VG_(get_error_where)(err) );
+ break;
+
case LeakErr: {
/* Totally abusing the types of these spare fields... oh well. */
UInt n_this_record = (UInt)VG_(get_error_address)(err);
VG_(maybe_record_error)( tst, FreeMismatchErr, a, /*s*/NULL, &err_extra );
}
+
+void MAC_(record_overlap_error) ( ThreadState* tst, Char* function )
+{
+ MAC_Error err_extra;
+
+ MAC_(clear_MAC_Error)( &err_extra );
+ VG_(maybe_record_error)( tst, OverlapErr, /*addr*/0, function, &err_extra );
+}
+
+
/* Updates the copy with address info if necessary (but not for LeakErrs). */
UInt SK_(update_extra)( Error* err )
{
/*--------------------------------------------------------------------*/
/*--- Replacements for strcpy(), memcpy() et al, which run on the ---*/
/*--- simulated CPU. ---*/
-/*--- mc_replace_strmem.c ---*/
+/*--- mac_replace_strmem.c ---*/
/*--------------------------------------------------------------------*/
/*
{
Char buf[256];
snprintf(buf, 100, "%s(%p, %p)", s, dst, src );
- VALGRIND_NON_SIMD_tstCALL1( MC_(record_overlap_error), buf );
+ VALGRIND_NON_SIMD_tstCALL1( MAC_(record_overlap_error), buf );
}
static __inline__
{
Char buf[256];
snprintf(buf, 100, "%s(%p, %p, %d)", s, dst, src, n );
- VALGRIND_NON_SIMD_tstCALL1( MC_(record_overlap_error), buf );
+ VALGRIND_NON_SIMD_tstCALL1( MAC_(record_overlap_error), buf );
}
char* strrchr ( const char* s, int c )
/*--------------------------------------------------------------------*/
-/*--- end mc_replace_strmem.c ---*/
+/*--- end mac_replace_strmem.c ---*/
/*--------------------------------------------------------------------*/
extern void MAC_(record_jump_error) ( ThreadState* tst, Addr a );
extern void MAC_(record_free_error) ( ThreadState* tst, Addr a );
extern void MAC_(record_freemismatch_error)( ThreadState* tst, Addr a );
+extern void MAC_(record_overlap_error) ( ThreadState* tst, Char* function );
extern void MAC_(pp_shared_SkinError) ( Error* err);
MAC_(pp_AddrInfo)(VG_(get_error_address)(err), &err_extra->addrinfo);
break;
- case OverlapErr:
- VG_(message)(Vg_UserMsg,
- "Source and destination overlap in %s",
- VG_(get_error_string)(err));
- VG_(pp_ExeContext)( VG_(get_error_where)(err) );
- break;
-
default:
MAC_(pp_shared_SkinError)(err);
break;
VG_(maybe_record_error)( tst, ValueErr, /*addr*/0, /*s*/NULL, &err_extra );
}
-/* These two called from non-generated code */
+/* This called from non-generated code */
void MC_(record_user_error) ( ThreadState* tst, Addr a, Bool isWrite )
{
VG_(maybe_record_error)( tst, UserErr, a, /*s*/NULL, &err_extra );
}
-void MC_(record_overlap_error) ( ThreadState* tst, Char* function )
-{
- MAC_Error err_extra;
-
- MAC_(clear_MAC_Error)( &err_extra );
- VG_(maybe_record_error)( tst, OverlapErr, /*addr*/0, function, &err_extra );
-}
-
/*------------------------------------------------------------*/
/*--- Suppressions ---*/
/*------------------------------------------------------------*/
/*--- Functions ---*/
/*------------------------------------------------------------*/
-/* Functions defined in vg_memcheck_helpers.S */
+/* Functions defined in mc_helpers.S */
extern void MC_(helper_value_check4_fail) ( void );
extern void MC_(helper_value_check2_fail) ( void );
extern void MC_(helper_value_check1_fail) ( void );
extern void MC_(helper_value_check0_fail) ( void );
-/* Functions defined in vg_memcheck.c */
+/* Functions defined in mc_main.c */
extern void MC_(helperc_STOREV4) ( Addr, UInt );
extern void MC_(helperc_STOREV2) ( Addr, UInt );
extern void MC_(helperc_STOREV1) ( Addr, UInt );
Bool setting /* True <=> set vbits, False <=> get vbits */
);
-/* Functions defined in vg_memcheck_clientreqs.c */
+/* Functions defined in mc_clientreqs.c */
extern Bool MC_(client_perm_maybe_describe)( Addr a, AddrInfo* ai );
extern void MC_(show_client_block_stats) ( void );
-/* Functions defined in vg_memcheck_errcontext.c */
+/* Functions defined in mc_errcontext.c */
extern void MC_(record_value_error) ( ThreadState* tst, Int size );
extern void MC_(record_user_error) ( ThreadState* tst, Addr a, Bool isWrite );
-extern void MC_(record_overlap_error)( ThreadState* tst, Char* function );
#endif
# Anonymise addresses
$dir/../../tests/filter_addresses |
-# Anonymise line numbers in mc_replace_strmem.c
-sed "s/mc_replace_strmem.c:[0-9]\+/mc_replace_strmem.c:.../" |
+# Anonymise line numbers in mac_replace_strmem.c
+sed "s/mac_replace_strmem.c:[0-9]\+/mac_replace_strmem.c:.../" |
$dir/../../tests/filter_test_paths |
Source and destination overlap in memcpy(0x........, 0x........, 21)
- at 0x........: memcpy (mc_replace_strmem.c:...)
+ at 0x........: memcpy (mac_replace_strmem.c:...)
by 0x........: main (overlap.c:40)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
Source and destination overlap in memcpy(0x........, 0x........, 21)
- at 0x........: memcpy (mc_replace_strmem.c:...)
+ at 0x........: memcpy (mac_replace_strmem.c:...)
by 0x........: main (overlap.c:42)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
Source and destination overlap in strncpy(0x........, 0x........, 21)
- at 0x........: strncpy (mc_replace_strmem.c:...)
+ at 0x........: strncpy (mac_replace_strmem.c:...)
by 0x........: main (overlap.c:45)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
Source and destination overlap in strncpy(0x........, 0x........, 21)
- at 0x........: strncpy (mc_replace_strmem.c:...)
+ at 0x........: strncpy (mac_replace_strmem.c:...)
by 0x........: main (overlap.c:47)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
Source and destination overlap in strcpy(0x........, 0x........)
- at 0x........: strcpy (mc_replace_strmem.c:...)
+ at 0x........: strcpy (mac_replace_strmem.c:...)
by 0x........: main (overlap.c:54)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
Source and destination overlap in strncat(0x........, 0x........, 21)
- at 0x........: strncat (mc_replace_strmem.c:...)
+ at 0x........: strncat (mac_replace_strmem.c:...)
by 0x........: main (overlap.c:112)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
Source and destination overlap in strncat(0x........, 0x........, 21)
- at 0x........: strncat (mc_replace_strmem.c:...)
+ at 0x........: strncat (mac_replace_strmem.c:...)
by 0x........: main (overlap.c:113)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...