merge patches from Jeremy Fitzhardinge:
14-hg-tid
HELGRIND: This fixes a bug in Helgrind in which all memory access by
syscalls was being treated as if it were happening in thread 1. This
is because the eraser_mem_read/write functions were using
get_current_tid_1_if_root() to get the current tid. Unfortunately,
during syscalls there is no current thread, so it was getting
1_if_root. This patch fixes this by using what thread ID information
we're given, and only using get_current_tid() if we're recording a
memory access performed by code (rather than by a syscall).
... which relies on ...
06-memops
Implement VG_(memcpy/memset).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1247 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/vg_mylibc.c b/coregrind/vg_mylibc.c
index c94224d..ebefad6 100644
--- a/coregrind/vg_mylibc.c
+++ b/coregrind/vg_mylibc.c
@@ -895,6 +895,31 @@
}
+void* VG_(memcpy) ( void *dest, const void *src, Int sz )
+{
+ const Char *s = (const Char *)src;
+ Char *d = (Char *)dest;
+ vg_assert(sz >= 0);
+
+ while (sz--)
+ *d++ = *s++;
+
+ return dest;
+}
+
+
+void* VG_(memset) ( void *dest, Int c, Int sz )
+{
+ Char *d = (Char *)dest;
+ vg_assert(sz >= 0);
+
+ while (sz--)
+ *d++ = c;
+
+ return dest;
+}
+
+
Char VG_(toupper) ( Char c )
{
if (c >= 'a' && c <= 'z')