]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: Default to --dups=16.
authorMark Wielaard <mjw@redhat.com>
Fri, 8 Apr 2011 12:25:30 +0000 (14:25 +0200)
committerMark Wielaard <mjw@redhat.com>
Fri, 8 Apr 2011 12:25:30 +0000 (14:25 +0200)
dwarflint/messages.cc
dwarflint/option.hh
dwarflint/tests/run-check_duplicate_DW_tag_variable.sh

index a803a50a3dead3538ffd8093d2cb962bd0405d25..2c0810eeb84726c43323b278a7815a6dfa33f44a 100644 (file)
@@ -302,7 +302,9 @@ namespace
 }
 
 global_opt<unsigned_option>
-  dup_threshold_opt ("Threshold for duplicate messages.",
+  dup_threshold_opt ("Threshold for duplicate messages."
+                    " Defaults to 16."
+                    " Use zero for no limit.",
                     "count", "dups");
 
 namespace
@@ -310,7 +312,7 @@ namespace
   unsigned
   dup_threshold ()
   {
-    static unsigned t = dup_threshold_opt.value ();
+    static unsigned t = dup_threshold_opt.value (16);
     if (t == 0)
       t = -1;
     return t;
@@ -369,7 +371,8 @@ message_context::id (void const *key, bool &whether)
   else if (int status = _m_filter->should_emit (key))
     {
       if (status == -1)
-       get_stream () << "(threshold reached for the following message)"
+       get_stream () << "(threshold [--dups=" << dup_threshold ()
+                     << "] reached for the following message)"
                      << std::endl;
       whether = true;
       return when (true);
index 9dccc2f75e5e3e6722b68507f5f85d7bcc0586b0..5e4eb4877381778bc8a9b41ce3f92ef8eadcfbb5 100644 (file)
@@ -159,6 +159,11 @@ public:
     return _m_arg;
   }
 
+  arg_type const &value (arg_type arg)
+  {
+    return seen () ? _m_arg : arg;
+  }
+
   error_t parse_opt (char *arg, __attribute__ ((unused)) argp_state *state)
   {
     _m_seen = true;
index 3a4de1b770ed0a68af73b3772007bcc0584faf52..36725b70379cc7b0bb1e998b13346113f3dab950 100755 (executable)
@@ -29,7 +29,7 @@ srcdir=$srcdir/tests
 
 testfiles crc7.ko.debug
 
-testrun_compare ./dwarflint --check check_duplicate_DW_tag_variable crc7.ko.debug <<EOF
+testrun_compare ./dwarflint --dups=0 --check check_duplicate_DW_tag_variable crc7.ko.debug <<EOF
 warning: .debug_info: DIE 0x40f1: DW_AT_low_pc value not below DW_AT_high_pc.
 warning: .debug_info: CU 16614: no aranges table is associated with this CU.
 warning: .debug_info: DIE 0x3d21: Redeclaration of variable 'console_printk', originally seen at DIE 37f3.