From: Petr Machata Date: Thu, 5 Mar 2009 12:13:38 +0000 (+0100) Subject: dwarflint: Add --nohl switch that turns off high-level checks X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c5f208ed81a0efd88701cc56d3cae12f958080d3;p=thirdparty%2Felfutils.git dwarflint: Add --nohl switch that turns off high-level checks --- diff --git a/src/ChangeLog b/src/ChangeLog index a8e46552f..4e0f52bff 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2009-03-05 Petr Machata + + * dwarflint.c: Add --nohl command line switch. + 2009-01-28 Petr Machata * dwarflint.c: Coding style cleanups. diff --git a/src/dwarflint.c b/src/dwarflint.c index 57e5dfe97..c37e6c71d 100644 --- a/src/dwarflint.c +++ b/src/dwarflint.c @@ -59,6 +59,7 @@ const char *argp_program_bug_address = PACKAGE_BUGREPORT; #define ARGP_gnu 301 #define ARGP_tolerant 302 #define ARGP_ref 303 +#define ARGP_nohl 304 #undef FIND_SECTION_HOLES @@ -78,6 +79,8 @@ broken in certain ways"), 0 }, { "ref", ARGP_ref, NULL, 0, N_("When validating .debug_loc and .debug_ranges, display information about \ the DIE referring to the entry in consideration"), 0 }, + { "nohl", ARGP_nohl, NULL, 0, + N_("Don't run high-level tests"), 0 }, { NULL, 0, NULL, 0, NULL, 0 } }; @@ -230,6 +233,7 @@ static bool be_strict = false; /* --strict */ static bool be_gnu = false; /* --gnu */ static bool be_tolerant = false; /* --tolerant */ static bool show_refs = false; /* --ref */ +static bool do_high_level = true; /* ! --nohl */ int main (int argc, char *argv[]) @@ -338,6 +342,10 @@ parse_opt (int key, char *arg __attribute__ ((unused)), show_refs = true; break; + case ARGP_nohl: + do_high_level = false; + break; + case 'i': tolerate_nodebug = true; break; @@ -997,7 +1005,7 @@ process_file (Dwarf *dwarf, const char *fname, bool only_one) { cu_chain = check_info_structural (&info_data, abbrev_chain, str_data.data); - if (cu_chain != NULL) + if (cu_chain != NULL && do_high_level) check_expected_trees (hlctx); } else if (!tolerate_nodebug) @@ -1011,7 +1019,7 @@ process_file (Dwarf *dwarf, const char *fname, bool only_one) else ranges_sound = false; - if (loc_data.data != NULL && cu_chain != NULL) + if (loc_data.data != NULL && cu_chain != NULL && do_high_level) check_loc_or_range_structural (&loc_data, cu_chain); if (aranges_data.data != NULL)