core: Add command-line option --defaultsupp

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14080 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_main.c b/coregrind/m_main.c
index c34d3ea..ba12b4b 100644
--- a/coregrind/m_main.c
+++ b/coregrind/m_main.c
@@ -127,6 +127,7 @@
 "    --error-limit=no|yes      stop showing new errors if too many? [yes]\n"
 "    --error-exitcode=<number> exit code to return if errors found [0=disable]\n"
 "    --show-below-main=no|yes  continue stack traces below main() [no]\n"
+"    --defaultsupp=yes|no      load default suppressions [yes]\n"
 "    --suppressions=<filename> suppress errors described in <filename>\n"
 "    --gen-suppressions=no|yes|all    print suppressions for errors? [no]\n"
 "    --db-attach=no|yes        start debugger when errors detected? [no]\n"
@@ -690,6 +691,8 @@
       else if VG_STR_CLO(arg, "--xml-user-comment",
                               VG_(clo_xml_user_comment)) {}
 
+      else if VG_BOOL_CLO(arg, "--defaultsupp", VG_(clo_default_supp)) { }
+
       else if VG_STR_CLO(arg, "--suppressions", tmp_str) {
          if (VG_(clo_n_suppressions) >= VG_CLO_MAX_SFILES) {
             VG_(fmsg_bad_option)(arg,
@@ -1114,7 +1117,8 @@
 
    // Suppressions related stuff
 
-   if (VG_(clo_n_suppressions) < VG_CLO_MAX_SFILES-1 &&
+   if (VG_(clo_default_supp) &&
+       VG_(clo_n_suppressions) < VG_CLO_MAX_SFILES-1 &&
        (VG_(needs).core_errors || VG_(needs).tool_errors)) {
       /* If we haven't reached the max number of suppressions, load
          the default one. */
diff --git a/coregrind/m_options.c b/coregrind/m_options.c
index b9edd11..a331f0e 100644
--- a/coregrind/m_options.c
+++ b/coregrind/m_options.c
@@ -78,6 +78,7 @@
 HChar* VG_(clo_xml_fname_expanded) = NULL;
 Bool   VG_(clo_time_stamp)     = False;
 Int    VG_(clo_input_fd)       = 0; /* stdin */
+Bool   VG_(clo_default_supp)   = True;
 Int    VG_(clo_n_suppressions) = 0;
 const HChar* VG_(clo_suppressions)[VG_CLO_MAX_SFILES];
 Int    VG_(clo_n_fullpath_after) = 0;
diff --git a/coregrind/pub_core_options.h b/coregrind/pub_core_options.h
index d296929..97aa3f5 100644
--- a/coregrind/pub_core_options.h
+++ b/coregrind/pub_core_options.h
@@ -139,6 +139,8 @@
 /* The file descriptor to read for input.  default: 0 == stdin */
 extern Int   VG_(clo_input_fd);
 
+/* Whether or not to load the default suppressions. */
+extern Bool  VG_(clo_default_supp);
 /* The number of suppression files specified. */
 extern Int   VG_(clo_n_suppressions);
 /* The names of the suppression files. */