Author: sewardj
Date: 2007-11-25 14:08:53 +0000 (Sun, 25 Nov 2007)
New Revision: 7213

Log:
Misc changes needed to support exp-drd (Bart Van Assche).

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


Modified: trunk/Makefile.am
===================================================================
--- trunk/Makefile.am   2007-11-25 14:06:06 UTC (rev 7212)
+++ trunk/Makefile.am   2007-11-25 14:08:53 UTC (rev 7213)
@@ -9,19 +9,22 @@
                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 @@
 ## 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

Modified: trunk/configure.in
===================================================================
--- trunk/configure.in  2007-11-25 14:06:06 UTC (rev 7212)
+++ trunk/configure.in  2007-11-25 14:08:53 UTC (rev 7213)
@@ -1018,6 +1018,9 @@
    exp-omega/Makefile
    exp-omega/tests/Makefile
    exp-omega/docs/Makefile
+   exp-drd/Makefile
+   exp-drd/docs/Makefile
+   exp-drd/tests/Makefile
 ) 
 
 cat<<EOF

Modified: trunk/coregrind/m_debuginfo/debuginfo.c
===================================================================
--- trunk/coregrind/m_debuginfo/debuginfo.c     2007-11-25 14:06:06 UTC (rev 
7212)
+++ trunk/coregrind/m_debuginfo/debuginfo.c     2007-11-25 14:08:53 UTC (rev 
7213)
@@ -1290,7 +1290,7 @@
    }
 
    if (si != NULL)
-      vg_assert(ret != VgSectUnknown);
+      vg_assert(ret != Vg_SectUnknown);
 
    if (0 && si) {
       VG_(printf)(
@@ -1305,6 +1305,33 @@
    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;

Modified: trunk/coregrind/m_libcbase.c
===================================================================
--- trunk/coregrind/m_libcbase.c        2007-11-25 14:06:06 UTC (rev 7212)
+++ trunk/coregrind/m_libcbase.c        2007-11-25 14:08:53 UTC (rev 7213)
@@ -501,6 +501,24 @@
    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;

Modified: trunk/coregrind/m_machine.c
===================================================================
--- trunk/coregrind/m_machine.c 2007-11-25 14:06:06 UTC (rev 7212)
+++ trunk/coregrind/m_machine.c 2007-11-25 14:08:53 UTC (rev 7213)
@@ -215,6 +215,13 @@
    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

Modified: trunk/include/pub_tool_debuginfo.h
===================================================================
--- trunk/include/pub_tool_debuginfo.h  2007-11-25 14:06:06 UTC (rev 7212)
+++ trunk/include/pub_tool_debuginfo.h  2007-11-25 14:08:53 UTC (rev 7213)
@@ -136,6 +136,9 @@
 
 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
 
 /*--------------------------------------------------------------------*/

Modified: trunk/include/pub_tool_libcbase.h
===================================================================
--- trunk/include/pub_tool_libcbase.h   2007-11-25 14:06:06 UTC (rev 7212)
+++ trunk/include/pub_tool_libcbase.h   2007-11-25 14:08:53 UTC (rev 7213)
@@ -104,6 +104,7 @@
    ------------------------------------------------------------------ */
 
 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 );
 

Modified: trunk/include/pub_tool_machine.h
===================================================================
--- trunk/include/pub_tool_machine.h    2007-11-25 14:06:06 UTC (rev 7212)
+++ trunk/include/pub_tool_machine.h    2007-11-25 14:08:53 UTC (rev 7213)
@@ -100,6 +100,9 @@
 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


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Valgrind-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-developers

Reply via email to