diff options
author | Mark Wielaard <mjw@redhat.com> | 2011-04-09 00:25:47 +0200 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2011-04-09 00:25:47 +0200 |
commit | 22bdce8fee0ffcc85e1c429647e4afbf64ad1f54 (patch) | |
tree | a2047e074b515bcb7a7c2b5aebd7fe95bc5ef78c /dwarflint | |
parent | 27a593a9dd44788c7f35ae8a5f777c328ba71dfc (diff) | |
parent | 6cc01612be86a1fef6ea098f790c0c1f8d4c68e8 (diff) | |
download | elfutils-22bdce8fee0ffcc85e1c429647e4afbf64ad1f54.tar.gz |
Merge branch 'default_dups' into dwarf
Diffstat (limited to 'dwarflint')
-rw-r--r-- | dwarflint/messages.cc | 9 | ||||
-rw-r--r-- | dwarflint/option.hh | 5 | ||||
-rwxr-xr-x | dwarflint/tests/run-check_duplicate_DW_tag_variable.sh | 2 |
3 files changed, 12 insertions, 4 deletions
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<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); 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 <<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. |