From 6cc01612be86a1fef6ea098f790c0c1f8d4c68e8 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 8 Apr 2011 14:25:30 +0200 Subject: dwarflint: Default to --dups=16. --- dwarflint/messages.cc | 9 ++++++--- dwarflint/option.hh | 5 +++++ dwarflint/tests/run-check_duplicate_DW_tag_variable.sh | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) (limited to 'dwarflint') diff --git a/dwarflint/messages.cc b/dwarflint/messages.cc index a803a50a..2c0810ee 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 9dccc2f7..5e4eb487 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 3a4de1b7..36725b70 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 <