On Jan 1, 2008 7:11 PM, Julian Seward <[EMAIL PROTECTED]> wrote:
>
> A more serious module-related question for drd is that it should not
> include pub_core_*.h.  Tools may only include pub_tool_*.h, in order
> to control the complexity of the core/tool interface.  For one thing
> that will require adding the drd suppression file to DEFAULT_SUPP
> in configure.in - not a problem.  Can you list precisely the stuff from
> the core_*.h includes that you need, that is not present in the
> tool_*.h files?

The attached patch solves this issue for exp-drd/drd_main.c. Can you
please review and apply the attached patch ?

Thanks,

Bart.
Index: configure.in
===================================================================
--- configure.in	(revision 7313)
+++ configure.in	(working copy)
@@ -485,6 +485,7 @@
 	AC_DEFINE([GLIBC_2_2], 1, [Define to 1 if you're using glibc 2.2.x])
 	DEFAULT_SUPP="glibc-2.2.supp ${DEFAULT_SUPP}"
 	DEFAULT_SUPP="glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}"
+	DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
 	;;
 
      2.3)
@@ -492,6 +493,7 @@
 	AC_DEFINE([GLIBC_2_3], 1, [Define to 1 if you're using glibc 2.3.x])
 	DEFAULT_SUPP="glibc-2.3.supp ${DEFAULT_SUPP}"
 	DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+	DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
 	;;
 
      2.4)
@@ -499,6 +501,7 @@
 	AC_DEFINE([GLIBC_2_4], 1, [Define to 1 if you're using glibc 2.4.x])
 	DEFAULT_SUPP="glibc-2.4.supp ${DEFAULT_SUPP}"
 	DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+	DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
 	;;
 
      2.5)
@@ -506,18 +509,21 @@
 	AC_DEFINE([GLIBC_2_5], 1, [Define to 1 if you're using glibc 2.5.x])
 	DEFAULT_SUPP="glibc-2.5.supp ${DEFAULT_SUPP}"
 	DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+	DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
 	;;
      2.6)
 	AC_MSG_RESULT(2.6 family)
 	AC_DEFINE([GLIBC_2_6], 1, [Define to 1 if you're using glibc 2.6.x])
 	DEFAULT_SUPP="glibc-2.6.supp ${DEFAULT_SUPP}"
 	DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+	DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
 	;;
      2.7)
 	AC_MSG_RESULT(2.7 family)
 	AC_DEFINE([GLIBC_2_7], 1, [Define to 1 if you're using glibc 2.7.x])
 	DEFAULT_SUPP="glibc-2.7.supp ${DEFAULT_SUPP}"
 	DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+	DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
 	;;
      aix5)
 	AC_MSG_RESULT(AIX 5.1 or 5.2 or 5.3)
Index: exp-drd/drd_main.c
===================================================================
--- exp-drd/drd_main.c	(revision 7313)
+++ exp-drd/drd_main.c	(working copy)
@@ -35,8 +35,6 @@
 #include "drd_track.h"
 #include "drd_vc.h"
 #include "priv_drd_clientreq.h"
-#include "pub_core_mallocfree.h"
-#include "pub_core_options.h"
 #include "pub_tool_vki.h"
 #include "pub_tool_basics.h"
 #include "pub_tool_debuginfo.h"   // VG_(describe_IP)()
@@ -152,8 +150,7 @@
                    thread_get_name(thread_get_running_tid()),
                    VG_(get_running_tid)(),
                    thread_get_running_tid());
-      VG_(get_and_pp_StackTrace)(VG_(get_running_tid)(),
-                                 VG_(clo_backtrace_size));
+      VG_(get_and_pp_StackTrace)(VG_(get_running_tid)(), 12);
       tl_assert(DrdThreadIdToVgThreadId(thread_get_running_tid())
                 == VG_(get_running_tid)());
    }
@@ -195,8 +192,7 @@
                    VG_(get_running_tid)(),
                    thread_get_running_tid(),
                    addr - thread_get_stack_min(thread_get_running_tid()));
-      VG_(get_and_pp_StackTrace)(VG_(get_running_tid)(),
-                                 VG_(clo_backtrace_size));
+      VG_(get_and_pp_StackTrace)(VG_(get_running_tid)(), 12);
       tl_assert(DrdThreadIdToVgThreadId(thread_get_running_tid())
                 == VG_(get_running_tid)());
    }
@@ -251,8 +247,7 @@
       VG_(message)(Vg_UserMsg, "start 0x%lx size %ld %s (tracing 0x%lx)",
                    a1, a2 - a1, thread_get_name(thread_get_running_tid()),
                    drd_trace_address);
-      VG_(get_and_pp_StackTrace)(VG_(get_running_tid)(),
-                                 VG_(clo_backtrace_size));
+      VG_(get_and_pp_StackTrace)(VG_(get_running_tid)(), 12);
    }
 }
 
@@ -264,8 +259,7 @@
       VG_(message)(Vg_UserMsg, "end   0x%lx size %ld %s (tracing 0x%lx)",
                    a1, a2 - a1, thread_get_name(thread_get_running_tid()),
                    drd_trace_address);
-      VG_(get_and_pp_StackTrace)(VG_(get_running_tid)(),
-                                 VG_(clo_backtrace_size));
+      VG_(get_and_pp_StackTrace)(VG_(get_running_tid)(), 12);
    }
    thread_stop_using_mem(a1, a2);
    mutex_stop_using_mem(a1, a2);
@@ -684,21 +678,6 @@
    }
 }
 
-static void drd_load_suppression_file(void)
-{
-   tl_assert(VG_(clo_n_suppressions) < VG_CLO_MAX_SFILES - 1);
-   {
-      /* If we haven't reached the max number of suppression files, load
-         the drd suppression patterns file. */
-      static const Char drd_supp[] = "glibc-2.X-drd.supp";
-      const Int len = VG_(strlen)(VG_(libdir)) + 1 + sizeof(drd_supp);
-      Char* const buf = VG_(arena_malloc)(VG_AR_CORE, len);
-      VG_(snprintf)(buf, len, "%s/%s", VG_(libdir), drd_supp);
-      VG_(clo_suppressions)[VG_(clo_n_suppressions)] = buf;
-      VG_(clo_n_suppressions)++;
-   }
-}
-
 static
 void drd_pre_clo_init(void)
 {
@@ -742,8 +721,6 @@
    drd_clientreq_init();
 
    drd_suppression_init();
-
-   drd_load_suppression_file();
 }
 
 
-------------------------------------------------------------------------
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