]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add intercepts for operator new(unsigned long) and operator
authorJulian Seward <jseward@acm.org>
Sun, 24 Apr 2005 00:04:42 +0000 (00:04 +0000)
committerJulian Seward <jseward@acm.org>
Sun, 24 Apr 2005 00:04:42 +0000 (00:04 +0000)
new[](unsigned long).  The 32-bit ones take unsigned int args, not
unsigned longs, and so the existing name-set did not capture them.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3549

NOTES.txt
coregrind/vg_replace_malloc.c

index 7c8b7fe7126718498e69a909ebd34f063959803a..6b6d7bc544f8ba0e2a51c22fc7dcb3c86b464b77 100644 (file)
--- a/NOTES.txt
+++ b/NOTES.txt
@@ -1,12 +1,18 @@
 
 23 Apr 05 (memcheck-on-amd64 notes)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* If a thread is given an initial stack with address range [lo .. hi],
+  we need to tell memcheck that the area [lo - VGA_STACK_REDZONE_SIZE
+  .. hi] is valid, rather than just [lo .. hi] as has been the case on
+  x86-only systems.  However, am not sure where to look for the call
+  into memcheck that states the new stack area.
+
+* vg_replace_malloc.c: need to create intercepts for
+  64-bit versions of
+     operator new(unsigned, std::nothrow_t const&)
+  and 
+     operator new[](unsigned, std::nothrow_t const&)
 
-If a thread is given an initial stack with address range [lo .. hi],
-we need to tell memcheck that the area [lo - VGA_STACK_REDZONE_SIZE
-.. hi] is valid, rather than just [lo .. hi] as has been the case on
-x86-only systems.  However, am not sure where to look for the 
-call into memcheck that states the new stack area.
 
 
 9 Apr 05 (starting work on memcheck for 32/64-bit and big/little endian)
index 6d5a69807c98c0de9440ada966d00c7d5d17c8b5..c9ba6f32ecb6b7939164938c5240c62332def3c3 100644 (file)
@@ -215,19 +215,27 @@ ALLOC_or_NULL(m_libstc_plus_plus_star, malloc,      malloc);
 ALLOC_or_NULL(m_libc_dot_so_dot_6,     malloc,      malloc);
 //ALLOC_or_NULL(m_libpgc_dot_so,         malloc,      malloc);
 
-// operator new(unsigned int), GNU mangling
+// operator new(unsigned int), GNU mangling, 32-bit platforms
 ALLOC_or_BOMB(m_libstc_plus_plus_star, builtin_new,    __builtin_new);
 ALLOC_or_BOMB(m_libc_dot_so_dot_6,     builtin_new,    __builtin_new);
 
 ALLOC_or_BOMB(m_libstc_plus_plus_star, __builtin_new,  __builtin_new);
 ALLOC_or_BOMB(m_libc_dot_so_dot_6,     __builtin_new,  __builtin_new);
 
+// TODO: these should only exist on 32-bit platforms
 ALLOC_or_BOMB(m_libstc_plus_plus_star, _Znwj,          __builtin_new);
 ALLOC_or_BOMB(m_libc_dot_so_dot_6,     _Znwj,          __builtin_new);
 
+// TODO: these should only exist on 64-bit platforms
+// operator new(unsigned long), GNU mangling, 64-bit platforms
+ALLOC_or_BOMB(m_libstc_plus_plus_star, _Znwm,          __builtin_new);
+ALLOC_or_BOMB(m_libc_dot_so_dot_6,     _Znwm,          __builtin_new);
+
+
 // operator new(unsigned int), ARM/cfront mangling
 //ALLOC_or_BOMB(m_libpgc_dot_so,         __nw__FUi,      __builtin_new);
 
+// TODO: create 64-bit version
 // operator new(unsigned, std::nothrow_t const&), GNU mangling
 ALLOC_or_NULL(m_libstc_plus_plus_star, _ZnwjRKSt9nothrow_t,  __builtin_new);
 ALLOC_or_NULL(m_libc_dot_so_dot_6,     _ZnwjRKSt9nothrow_t,  __builtin_new);
@@ -235,9 +243,17 @@ ALLOC_or_NULL(m_libc_dot_so_dot_6,     _ZnwjRKSt9nothrow_t,  __builtin_new);
 // operator new[](unsigned int), GNU mangling
 ALLOC_or_BOMB(m_libstc_plus_plus_star, __builtin_vec_new, __builtin_vec_new );
 ALLOC_or_BOMB(m_libc_dot_so_dot_6,     __builtin_vec_new, __builtin_vec_new );
+
+// TODO: these should only exist on 32-bit platforms
 ALLOC_or_BOMB(m_libstc_plus_plus_star, _Znaj,             __builtin_vec_new );
 ALLOC_or_BOMB(m_libc_dot_so_dot_6,     _Znaj,             __builtin_vec_new );
 
+// TODO: these should only exist on 64-bit platforms
+// operator new[](unsigned long), GNU mangling, 64-bit platforms
+ALLOC_or_BOMB(m_libstc_plus_plus_star, _Znam,             __builtin_vec_new );
+ALLOC_or_BOMB(m_libc_dot_so_dot_6,     _Znam,             __builtin_vec_new );
+
+// TODO: create 64-bit version
 // operator new[](unsigned, std::nothrow_t const&), GNU mangling
 ALLOC_or_NULL(m_libstc_plus_plus_star, _ZnajRKSt9nothrow_t, __builtin_vec_new );
 ALLOC_or_NULL(m_libc_dot_so_dot_6,     _ZnajRKSt9nothrow_t, __builtin_vec_new );