From: Mark Wielaard Date: Fri, 8 Apr 2011 12:25:30 +0000 (+0200) Subject: dwarflint: Default to --dups=16. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6cc01612be86a1fef6ea098f790c0c1f8d4c68e8;p=thirdparty%2Felfutils.git dwarflint: Default to --dups=16. --- diff --git a/dwarflint/messages.cc b/dwarflint/messages.cc index a803a50a3..2c0810eeb 100644 --- a/dwarflint/messages.cc +++ b/dwarflint/messages.cc @@ -302,7 +302,9 @@ namespace } global_opt - 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); diff --git a/dwarflint/option.hh b/dwarflint/option.hh index 9dccc2f75..5e4eb4877 100644 --- a/dwarflint/option.hh +++ b/dwarflint/option.hh @@ -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; diff --git a/dwarflint/tests/run-check_duplicate_DW_tag_variable.sh b/dwarflint/tests/run-check_duplicate_DW_tag_variable.sh index 3a4de1b77..36725b703 100755 --- a/dwarflint/tests/run-check_duplicate_DW_tag_variable.sh +++ b/dwarflint/tests/run-check_duplicate_DW_tag_variable.sh @@ -29,7 +29,7 @@ srcdir=$srcdir/tests testfiles crc7.ko.debug -testrun_compare ./dwarflint --check check_duplicate_DW_tag_variable crc7.ko.debug <