]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Misc changes needed to support exp-drd (Bart Van Assche).
authorJulian Seward <jseward@acm.org>
Sun, 25 Nov 2007 14:08:53 +0000 (14:08 +0000)
committerJulian Seward <jseward@acm.org>
Sun, 25 Nov 2007 14:08:53 +0000 (14:08 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7213

Makefile.am
configure.in
coregrind/m_debuginfo/debuginfo.c
coregrind/m_libcbase.c
coregrind/m_machine.c
include/pub_tool_debuginfo.h
include/pub_tool_libcbase.h
include/pub_tool_machine.h

index f53bf5d14bf2b50e249e796fa845c2fbd9e20499..ef84ca8e97748ea4a92a45803c600784d85c37ad 100644 (file)
@@ -9,19 +9,22 @@ TOOLS =               memcheck \
                massif \
                lackey \
                none \
-               helgrind \
-               exp-omega
+               helgrind
+
+EXP_TOOLS =    exp-omega \
+               exp-drd
 
 # Put docs last because building the HTML is slow and we want to get
 # everything else working before we try it.
-SUBDIRS = include coregrind . tests perf auxprogs $(TOOLS) docs
+SUBDIRS = include coregrind . tests perf auxprogs $(TOOLS) $(EXP_TOOLS) docs
 DIST_SUBDIRS  = $(SUBDIRS)
 
 SUPP_FILES = \
        glibc-2.2.supp glibc-2.3.supp glibc-2.4.supp glibc-2.5.supp \
        glibc-2.6.supp aix5libc.supp xfree-3.supp xfree-4.supp \
        glibc-2.34567-NPTL-helgrind.supp \
-       glibc-2.2-LinuxThreads-helgrind.supp
+       glibc-2.2-LinuxThreads-helgrind.supp \
+       glibc-2.X-drd.supp
 
 dist_val_DATA = $(SUPP_FILES) default.supp
 
@@ -65,6 +68,8 @@ default.supp: $(SUPP_FILES)
 ## Preprend @PERL@ because tests/vg_regtest isn't executable
 regtest: check
        @PERL@ tests/vg_regtest $(TOOLS)
+exp-regtest: check
+       @PERL@ tests/vg_regtest $(EXP_TOOLS)
 
 ## Preprend @PERL@ because tests/vg_per isn't executable
 perf: check
index bfac904a367acd0e5268549b8441df8809ef8402..adb1877300ed8eab734c5b8ce1248f9728633327 100644 (file)
@@ -1018,6 +1018,9 @@ AC_OUTPUT(
    exp-omega/Makefile
    exp-omega/tests/Makefile
    exp-omega/docs/Makefile
+   exp-drd/Makefile
+   exp-drd/docs/Makefile
+   exp-drd/tests/Makefile
 ) 
 
 cat<<EOF
index 39ed3a706d94577bd327b863ca510aeeeeb2942c..3b763e8e4921e083b57d9890ced265fbfd970701 100644 (file)
@@ -1290,7 +1290,7 @@ VgSectKind VG_(seginfo_sect_kind)(Addr a)
    }
 
    if (si != NULL)
-      vg_assert(ret != VgSectUnknown);
+      vg_assert(ret != Vg_SectUnknown);
 
    if (0 && si) {
       VG_(printf)(
@@ -1305,6 +1305,33 @@ VgSectKind VG_(seginfo_sect_kind)(Addr a)
    return ret;
 }
 
+Char* VG_(seginfo_sect_kind_name)(Addr a, Char* buf, UInt n_buf)
+{
+   switch (VG_(seginfo_sect_kind)(a)) {
+      case Vg_SectUnknown:
+         VG_(snprintf)(buf, n_buf, "Unknown");
+         break;
+      case Vg_SectText:
+         VG_(snprintf)(buf, n_buf, "Text");
+         break;
+      case Vg_SectData:
+         VG_(snprintf)(buf, n_buf, "Data");
+         break;
+      case Vg_SectBSS:
+         VG_(snprintf)(buf, n_buf, "BSS");
+         break;
+      case Vg_SectGOT:
+         VG_(snprintf)(buf, n_buf, "GOT");
+         break;
+      case Vg_SectPLT:
+         VG_(snprintf)(buf, n_buf, "PLT");
+         break;
+      default:
+         vg_assert(0);
+   }
+   return buf;
+}
+
 Int VG_(seginfo_syms_howmany) ( const SegInfo *si )
 {
    return si->symtab_used;
index 280efedff85d78d9ee6639003ea1f98c005bf65a..d895bd3b02c2d0f13395b6c3a5e3a8314b117efa 100644 (file)
@@ -501,6 +501,24 @@ void* VG_(memcpy) ( void *dest, const void *src, SizeT sz )
    return dest;
 }
 
+void* VG_(memmove)(void *dest, const void *src, SizeT sz)
+{
+   SizeT i;
+   if (sz == 0)
+      return dest;
+   if (dest < src) {
+      for (i = 0; i < sz; i++) {
+         ((UChar*)dest)[i] = ((UChar*)src)[i];
+      }
+   }
+   else if (dest > src) {
+      for (i = sz - 1; i >= 0; i--) {
+         ((UChar*)dest)[i] = ((UChar*)src)[i];
+      }
+   }
+   return dest;
+}
+
 void* VG_(memset) ( void *dest, Int c, SizeT sz )
 {
    Char *d = (Char *)dest;
index 358cc652dcba5092499c5c5c71303bf4f5b47705..bb4faf706487f71beebaa95b3a7ce69c07cc8824 100644 (file)
@@ -215,6 +215,13 @@ Bool VG_(thread_stack_next)(ThreadId* tid, Addr* stack_min, Addr* stack_max)
    return False;
 }
 
+Addr VG_(thread_get_stack_max)(ThreadId tid)
+{
+   vg_assert(0 <= tid && tid < VG_N_THREADS && tid != VG_INVALID_THREADID);
+   vg_assert(VG_(threads)[tid].status != VgTs_Empty);
+   return VG_(threads)[tid].client_stack_highest_word;
+}
+
 //-------------------------------------------------------------
 /* Details about the capabilities of the underlying (host) CPU.  These
    details are acquired by (1) enquiring with the CPU at startup, or
index 76dd6b22b19f59e2adc551836491bc6425a8c198..0387d1fe4f8c3f74f115b9e7a252dfd8125c6916 100644 (file)
@@ -136,6 +136,9 @@ typedef
 
 extern VgSectKind VG_(seginfo_sect_kind)(Addr);
 
+extern Char* VG_(seginfo_sect_kind_name)(Addr a, Char* buf, UInt n_buf);
+
+
 #endif   // __PUB_TOOL_DEBUGINFO_H
 
 /*--------------------------------------------------------------------*/
index 0be7534e510048f911aa91823ea6cab05a2d2e9b..f2623771607226d49ee83189d9f666e4900ae462 100644 (file)
@@ -104,6 +104,7 @@ extern Bool  VG_(string_match)   ( const Char* pat, const Char* str );
    ------------------------------------------------------------------ */
 
 extern void* VG_(memcpy) ( void *d, const void *s, SizeT sz );
+extern void* VG_(memmove)( void *d, const void *s, SizeT sz );
 extern void* VG_(memset) ( void *s, Int c, SizeT sz );
 extern Int   VG_(memcmp) ( const void* s1, const void* s2, SizeT n );
 
index 338c3b8c6a2c259162eb10dcc48eda6ea73dfdde..04831e4b7de7898dbbba7fe157025c9bb38d2052 100644 (file)
@@ -100,6 +100,9 @@ extern void VG_(thread_stack_reset_iter) ( void );
 extern Bool VG_(thread_stack_next)       ( ThreadId* tid, Addr* stack_min,
                                                           Addr* stack_max );
 
+// Returns .client_stack_highest_word for the given thread
+extern Addr VG_(thread_get_stack_max) ( ThreadId tid );
+
 // Given a pointer to a function as obtained by "& functionname" in C,
 // produce a pointer to the actual entry point for the function.  For
 // most platforms it's the identity function.  Unfortunately, on